Merge lp:~jose-exposito89/ubuntuone-ios-files/arc into lp:ubuntuone-ios-files
- arc
- Merge into trunk
Proposed by
José Expósito
Status: | Rejected |
---|---|
Rejected by: | Natalia Bidart |
Proposed branch: | lp:~jose-exposito89/ubuntuone-ios-files/arc |
Merge into: | lp:ubuntuone-ios-files |
Diff against target: |
15826 lines (+4138/-6882) 185 files modified
Dependencies/About dependencies.txt (+8/-0) Dependencies/JSONKit.framework/Versions/A/Headers/JSONKit.h (+251/-0) Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.h (+36/-0) Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.m (+83/-0) Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.h (+32/-0) Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.m (+47/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/Base64Transcoder.h (+36/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSMutableURLRequest+Parameters.h (+37/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSString+URLEncoding.h (+35/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSURL+Base.h (+34/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAAttachment.h (+26/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OACall.h (+63/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAConsumer.h (+42/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OADataFetcher.h (+44/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAHMAC_SHA1SignatureProvider.h (+32/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAMutableURLRequest.h (+65/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAPlaintextSignatureProvider.h (+31/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAProblem.h (+53/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OARequestParameter.h (+48/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAServiceTicket.h (+46/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OASignatureProviding.h (+34/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAToken.h (+73/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OATokenManager.h (+68/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAuthConsumer.h (+40/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/hmac.h (+31/-0) Dependencies/OAuthConsumer.framework/Versions/A/Headers/sha1.h (+13/-0) Dependencies/PullToRefresh.framework/Headers/PullRefreshTableViewController.h (+77/-0) Dependencies/PullToRefresh/.gitignore (+0/-15) Dependencies/PullToRefresh/Classes/DemoTableViewController.h (+0/-16) Dependencies/PullToRefresh/Classes/DemoTableViewController.m (+0/-65) Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.h (+0/-59) Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.m (+0/-188) Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.h (+0/-20) Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.m (+0/-41) Dependencies/PullToRefresh/LICENSE (+0/-20) Dependencies/PullToRefresh/PullToRefresh-Info.plist (+0/-28) Dependencies/PullToRefresh/PullToRefresh.xcodeproj/project.pbxproj (+0/-268) Dependencies/PullToRefresh/PullToRefresh_Prefix.pch (+0/-14) Dependencies/PullToRefresh/README.markdown (+0/-27) Dependencies/PullToRefresh/main.m (+0/-17) Dependencies/RIButtonItem.h (+0/-23) Dependencies/RIButtonItem.m (+0/-35) Dependencies/Reachability/Reachability.h (+111/-81) Dependencies/Reachability/Reachability.m (+490/-259) Dependencies/SVProgressHUD/SVProgressHUD/SVProgressHUD.m (+8/-18) Dependencies/UIActionSheet+Blocks.h (+0/-16) Dependencies/UIActionSheet+Blocks.m (+0/-71) Dependencies/UIAlertView+Blocks.h (+0/-16) Dependencies/UIAlertView+Blocks.m (+0/-61) Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.h (+0/-37) Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.m (+0/-116) Dependencies/oauthconsumer/Categories/NSString+URLEncoding.h (+0/-35) Dependencies/oauthconsumer/Categories/NSString+URLEncoding.m (+0/-73) Dependencies/oauthconsumer/Categories/NSURL+Base.h (+0/-34) Dependencies/oauthconsumer/Categories/NSURL+Base.m (+0/-37) Dependencies/oauthconsumer/Crypto/Base64Transcoder.c (+0/-230) Dependencies/oauthconsumer/Crypto/Base64Transcoder.h (+0/-36) Dependencies/oauthconsumer/Crypto/hmac.c (+0/-88) Dependencies/oauthconsumer/Crypto/hmac.h (+0/-31) Dependencies/oauthconsumer/Crypto/sha1.c (+0/-171) Dependencies/oauthconsumer/Crypto/sha1.h (+0/-13) Dependencies/oauthconsumer/OAAttachment.h (+0/-26) Dependencies/oauthconsumer/OAAttachment.m (+0/-33) Dependencies/oauthconsumer/OACall.h (+0/-63) Dependencies/oauthconsumer/OACall.m (+0/-170) Dependencies/oauthconsumer/OAConsumer.h (+0/-42) Dependencies/oauthconsumer/OAConsumer.m (+0/-60) Dependencies/oauthconsumer/OADataFetcher.h (+0/-44) Dependencies/oauthconsumer/OADataFetcher.m (+0/-90) Dependencies/oauthconsumer/OAHMAC_SHA1SignatureProvider.h (+0/-32) Dependencies/oauthconsumer/OAHMAC_SHA1SignatureProvider.m (+0/-58) Dependencies/oauthconsumer/OAMutableURLRequest.h (+0/-65) Dependencies/oauthconsumer/OAMutableURLRequest.m (+0/-222) Dependencies/oauthconsumer/OAPlaintextSignatureProvider.h (+0/-31) Dependencies/oauthconsumer/OAPlaintextSignatureProvider.m (+0/-40) Dependencies/oauthconsumer/OAProblem.h (+0/-53) Dependencies/oauthconsumer/OAProblem.m (+0/-172) Dependencies/oauthconsumer/OARequestParameter.h (+0/-48) Dependencies/oauthconsumer/OARequestParameter.m (+0/-80) Dependencies/oauthconsumer/OAServiceTicket.h (+0/-46) Dependencies/oauthconsumer/OAServiceTicket.m (+0/-59) Dependencies/oauthconsumer/OASignatureProviding.h (+0/-34) Dependencies/oauthconsumer/OATestServer.rb (+0/-37) Dependencies/oauthconsumer/OAToken.h (+0/-73) Dependencies/oauthconsumer/OAToken.m (+0/-356) Dependencies/oauthconsumer/OATokenManager.h (+0/-68) Dependencies/oauthconsumer/OATokenManager.m (+0/-403) Dependencies/oauthconsumer/OAuthConsumer.h (+0/-40) Dependencies/oauthconsumer/README (+0/-15) Files.xcodeproj/project.pbxproj (+89/-233) Files/AbstractNetworkOperation.h (+1/-1) Files/AbstractNetworkOperation.m (+0/-10) Files/Files-Info.plist (+1/-1) Files/FilesAppDelegate.h (+6/-6) Files/FilesAppDelegate.m (+36/-55) Files/Generated/_U1Asset.h (+22/-21) Files/Generated/_U1Asset.m (+5/-4) Files/Generated/_U1FileNode.h (+16/-15) Files/Generated/_U1FileNode.m (+5/-4) Files/Generated/_U1FolderNode.h (+3/-2) Files/Generated/_U1FolderNode.m (+1/-0) Files/Generated/_U1Node.h (+39/-38) Files/Generated/_U1Node.m (+9/-8) Files/Generated/_U1Volume.h (+3/-2) Files/Generated/_U1Volume.m (+1/-0) Files/NSString+Extras.m (+1/-1) Files/U1AccountManager.m (+6/-6) Files/U1AssetRepresenationDataProvider.h (+1/-1) Files/U1AssetRepresenationDataProvider.m (+1/-7) Files/U1AutoUploadOperation.h (+4/-4) Files/U1AutoUploadOperation.m (+0/-8) Files/U1AutoUploadsManager.h (+3/-3) Files/U1AutoUploadsManager.m (+6/-14) Files/U1DataRepository.m (+18/-32) Files/U1FileDetailsViewController.h (+23/-18) Files/U1FileDetailsViewController.m (+45/-64) Files/U1FileDetailsViewController.xib (+68/-16) Files/U1FilePreviewViewController.h (+10/-8) Files/U1FilePreviewViewController.m (+27/-39) Files/U1FilePreviewViewController.xib (+25/-64) Files/U1FilesClient.h (+2/-2) Files/U1FilesClient.m (+13/-29) Files/U1FilesService.m (+9/-19) Files/U1FolderItemCell.h (+6/-6) Files/U1FolderItemCell.m (+1/-11) Files/U1FolderItemCell.xib (+24/-21) Files/U1FolderNode.h (+1/-1) Files/U1FolderViewController.h (+4/-5) Files/U1FolderViewController.m (+16/-30) Files/U1FolderViewController.xib (+24/-22) Files/U1HTTPRequestOperation.h (+3/-3) Files/U1HTTPRequestOperation.m (+7/-29) Files/U1HUDAlert.m (+1/-1) Files/U1LocalFileInfo.m (+0/-5) Files/U1LoginController.h (+2/-2) Files/U1LoginController.m (+27/-33) Files/U1MagicUploadDataProvider.h (+1/-1) Files/U1MagicUploadDataProvider.m (+1/-6) Files/U1NavigationBar.m (+0/-1) Files/U1Node.m (+1/-1) Files/U1NodeChildrenResultSet.h (+1/-1) Files/U1NodeChildrenResultSet.m (+2/-9) Files/U1ReportingInputStream.m (+3/-9) Files/U1SSOAccountResponse.m (+0/-9) Files/U1SSOAuthenticateResponse.m (+0/-9) Files/U1SSOCaptchaResponse.m (+0/-6) Files/U1SSOCredentialsViewController.h (+10/-5) Files/U1SSOCredentialsViewController.m (+8/-10) Files/U1SSOCredentialsViewController.xib (+137/-23) Files/U1SSOEmailVerificationViewController.m (+23/-1) Files/U1SSOEmailVerificationViewController.xib (+52/-17) Files/U1SSOLandingPageViewController.h (+3/-0) Files/U1SSOLandingPageViewController.m (+17/-7) Files/U1SSOLandingPageViewController.xib (+49/-14) Files/U1SSOResponse.m (+1/-8) Files/U1SSOSignUpViewController.h (+1/-1) Files/U1SSOSignUpViewController.m (+65/-49) Files/U1SSOSignUpViewController.xib (+175/-69) Files/U1ScrollView.h (+1/-1) Files/U1ScrollView.m (+0/-1) Files/U1SettingsViewController.h (+16/-13) Files/U1SettingsViewController.m (+33/-35) Files/U1SettingsViewController.xib (+49/-19) Files/U1SingleSignOnProvider.h (+1/-1) Files/U1SingleSignOnProvider.m (+14/-17) Files/U1UploadOperation.h (+5/-5) Files/U1UploadOperation.m (+2/-12) Files/U1UploadsPoolViewController.h (+6/-4) Files/U1UploadsPoolViewController.m (+33/-35) Files/U1UploadsPoolViewController.xib (+97/-19) Files/U1ViewNibLoader.h (+1/-1) Files/U1ViewNibLoader.m (+4/-9) Files/U1VolumesViewController.h (+4/-5) Files/U1VolumesViewController.m (+11/-17) Files/U1VolumesViewController.xib (+18/-14) Files/UIActionSheet+U1Additions.m (+1/-8) Files/UOHTTPFetchOperation.m (+3/-9) Files/UOJSONFetchOperation.m (+3/-9) Files/URLQueryStringParser.h (+1/-1) Files/URLQueryStringParser.m (+0/-4) Files/en.lproj/Localizable.strings (+14/-0) Files/iPad/en.lproj/MainWindow_iPad.xib (+0/-193) Files/iPhone/en.lproj/MainWindow.xib (+658/-0) Files/iPhone/en.lproj/MainWindow_iPhone.xib (+0/-567) Files/main.m (+4/-4) |
To merge this branch: | bzr merge lp:~jose-exposito89/ubuntuone-ios-files/arc |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu One iOS Client Team | Pending | ||
Review via email: mp+160079@code.launchpad.net |
Commit message
Description of the change
Added ARC support, i18n and iPad support
To post a comment you must log in.
- 74. By José Expósito
-
Branch merged with the current trunk
Unmerged revisions
- 74. By José Expósito
-
Branch merged with the current trunk
- 73. By José Expósito
-
Added full ARC support
- 72. By José Expósito
-
About dependencies.txt updated with all dependencies
- 71. By José Expósito
-
UIActionSheet+
Blocks replaced by UIActionSheet+ Modal, more easy to use and ARC compatible - 70. By José Expósito
-
JSONKit compiled as universal framework
- 69. By José Expósito
-
Added an about dependencies text file with the link and license of all dependencies
- 68. By José Expósito
-
Reachability ported to https:/
/github. com/tonymillion /Reachability that is ARC compatible and incorpores more features - 67. By José Expósito
-
Added missing files
- 66. By José Expósito
-
OAuthConsumer compiled as universal framework to add ARC compatibility
- 65. By José Expósito
-
PullToRefresh compiled as Universal Framework with ARC support and beter iPad suppor https:/
/github. com/JoseExposit o/PullToRefresh
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'Dependencies/About dependencies.txt' |
2 | --- Dependencies/About dependencies.txt 1970-01-01 00:00:00 +0000 |
3 | +++ Dependencies/About dependencies.txt 2013-04-26 15:39:24 +0000 |
4 | @@ -0,0 +1,8 @@ |
5 | +About dependencies: |
6 | + |
7 | + - PullToRefresh https://github.com/leah/PullToRefresh MIT License |
8 | + - OAuthConsumer https://github.com/jdg/oauthconsumer Apache License 2.0 |
9 | + - Reachability https://github.com/tonymillion/Reachability BSD License |
10 | + - JSONKit https://github.com/johnezang/JSONKit Dual licensed BSD/Apache |
11 | + - Modal UIAlertView/UIActionSheet http://code.google.com/p/modal-uialertview-uiactionsheet MIT License |
12 | + - SVProgressHUD https://github.com/samvermette/SVProgressHUD MIT License |
13 | \ No newline at end of file |
14 | |
15 | === removed directory 'Dependencies/JSONKit' |
16 | === added directory 'Dependencies/JSONKit.framework' |
17 | === added symlink 'Dependencies/JSONKit.framework/Headers' |
18 | === target is u'Versions/Current/Headers' |
19 | === added symlink 'Dependencies/JSONKit.framework/JSONKit' |
20 | === target is u'Versions/Current/JSONKit' |
21 | === added directory 'Dependencies/JSONKit.framework/Versions' |
22 | === added directory 'Dependencies/JSONKit.framework/Versions/A' |
23 | === added directory 'Dependencies/JSONKit.framework/Versions/A/Headers' |
24 | === added file 'Dependencies/JSONKit.framework/Versions/A/Headers/JSONKit.h' |
25 | --- Dependencies/JSONKit.framework/Versions/A/Headers/JSONKit.h 1970-01-01 00:00:00 +0000 |
26 | +++ Dependencies/JSONKit.framework/Versions/A/Headers/JSONKit.h 2013-04-26 15:39:24 +0000 |
27 | @@ -0,0 +1,251 @@ |
28 | +// |
29 | +// JSONKit.h |
30 | +// http://github.com/johnezang/JSONKit |
31 | +// Dual licensed under either the terms of the BSD License, or alternatively |
32 | +// under the terms of the Apache License, Version 2.0, as specified below. |
33 | +// |
34 | + |
35 | +/* |
36 | + Copyright (c) 2011, John Engelhart |
37 | + |
38 | + All rights reserved. |
39 | + |
40 | + Redistribution and use in source and binary forms, with or without |
41 | + modification, are permitted provided that the following conditions are met: |
42 | + |
43 | + * Redistributions of source code must retain the above copyright |
44 | + notice, this list of conditions and the following disclaimer. |
45 | + |
46 | + * Redistributions in binary form must reproduce the above copyright |
47 | + notice, this list of conditions and the following disclaimer in the |
48 | + documentation and/or other materials provided with the distribution. |
49 | + |
50 | + * Neither the name of the Zang Industries nor the names of its |
51 | + contributors may be used to endorse or promote products derived from |
52 | + this software without specific prior written permission. |
53 | + |
54 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
55 | + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
56 | + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
57 | + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
58 | + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
59 | + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
60 | + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
61 | + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
62 | + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
63 | + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
64 | + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
65 | +*/ |
66 | + |
67 | +/* |
68 | + Copyright 2011 John Engelhart |
69 | + |
70 | + Licensed under the Apache License, Version 2.0 (the "License"); |
71 | + you may not use this file except in compliance with the License. |
72 | + You may obtain a copy of the License at |
73 | + |
74 | + http://www.apache.org/licenses/LICENSE-2.0 |
75 | + |
76 | + Unless required by applicable law or agreed to in writing, software |
77 | + distributed under the License is distributed on an "AS IS" BASIS, |
78 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
79 | + See the License for the specific language governing permissions and |
80 | + limitations under the License. |
81 | +*/ |
82 | + |
83 | +#include <stddef.h> |
84 | +#include <stdint.h> |
85 | +#include <limits.h> |
86 | +#include <TargetConditionals.h> |
87 | +#include <AvailabilityMacros.h> |
88 | + |
89 | +#ifdef __OBJC__ |
90 | +#import <Foundation/NSArray.h> |
91 | +#import <Foundation/NSData.h> |
92 | +#import <Foundation/NSDictionary.h> |
93 | +#import <Foundation/NSError.h> |
94 | +#import <Foundation/NSObjCRuntime.h> |
95 | +#import <Foundation/NSString.h> |
96 | +#endif // __OBJC__ |
97 | + |
98 | +#ifdef __cplusplus |
99 | +extern "C" { |
100 | +#endif |
101 | + |
102 | + |
103 | +// For Mac OS X < 10.5. |
104 | +#ifndef NSINTEGER_DEFINED |
105 | +#define NSINTEGER_DEFINED |
106 | +#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) |
107 | +typedef long NSInteger; |
108 | +typedef unsigned long NSUInteger; |
109 | +#define NSIntegerMin LONG_MIN |
110 | +#define NSIntegerMax LONG_MAX |
111 | +#define NSUIntegerMax ULONG_MAX |
112 | +#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) |
113 | +typedef int NSInteger; |
114 | +typedef unsigned int NSUInteger; |
115 | +#define NSIntegerMin INT_MIN |
116 | +#define NSIntegerMax INT_MAX |
117 | +#define NSUIntegerMax UINT_MAX |
118 | +#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) |
119 | +#endif // NSINTEGER_DEFINED |
120 | + |
121 | + |
122 | +#ifndef _JSONKIT_H_ |
123 | +#define _JSONKIT_H_ |
124 | + |
125 | +#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465) |
126 | +#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) |
127 | +#else |
128 | +#define JK_DEPRECATED_ATTRIBUTE |
129 | +#endif |
130 | + |
131 | +#define JSONKIT_VERSION_MAJOR 1 |
132 | +#define JSONKIT_VERSION_MINOR 4 |
133 | + |
134 | +typedef NSUInteger JKFlags; |
135 | + |
136 | +/* |
137 | + JKParseOptionComments : Allow C style // and /_* ... *_/ (without a _, obviously) comments in JSON. |
138 | + JKParseOptionUnicodeNewlines : Allow Unicode recommended (?:\r\n|[\n\v\f\r\x85\p{Zl}\p{Zp}]) newlines. |
139 | + JKParseOptionLooseUnicode : Normally the decoder will stop with an error at any malformed Unicode. |
140 | + This option allows JSON with malformed Unicode to be parsed without reporting an error. |
141 | + Any malformed Unicode is replaced with \uFFFD, or "REPLACEMENT CHARACTER". |
142 | + */ |
143 | + |
144 | +enum { |
145 | + JKParseOptionNone = 0, |
146 | + JKParseOptionStrict = 0, |
147 | + JKParseOptionComments = (1 << 0), |
148 | + JKParseOptionUnicodeNewlines = (1 << 1), |
149 | + JKParseOptionLooseUnicode = (1 << 2), |
150 | + JKParseOptionPermitTextAfterValidJSON = (1 << 3), |
151 | + JKParseOptionValidFlags = (JKParseOptionComments | JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode | JKParseOptionPermitTextAfterValidJSON), |
152 | +}; |
153 | +typedef JKFlags JKParseOptionFlags; |
154 | + |
155 | +enum { |
156 | + JKSerializeOptionNone = 0, |
157 | + JKSerializeOptionPretty = (1 << 0), |
158 | + JKSerializeOptionEscapeUnicode = (1 << 1), |
159 | + JKSerializeOptionEscapeForwardSlashes = (1 << 4), |
160 | + JKSerializeOptionValidFlags = (JKSerializeOptionPretty | JKSerializeOptionEscapeUnicode | JKSerializeOptionEscapeForwardSlashes), |
161 | +}; |
162 | +typedef JKFlags JKSerializeOptionFlags; |
163 | + |
164 | +#ifdef __OBJC__ |
165 | + |
166 | +typedef struct JKParseState JKParseState; // Opaque internal, private type. |
167 | + |
168 | +// As a general rule of thumb, if you use a method that doesn't accept a JKParseOptionFlags argument, it defaults to JKParseOptionStrict |
169 | + |
170 | +@interface JSONDecoder : NSObject { |
171 | + JKParseState *parseState; |
172 | +} |
173 | ++ (id)decoder; |
174 | ++ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags; |
175 | +- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags; |
176 | +- (void)clearCache; |
177 | + |
178 | +// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods. |
179 | +- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length: instead. |
180 | +- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length:error: instead. |
181 | +// The NSData MUST be UTF8 encoded JSON. |
182 | +- (id)parseJSONData:(NSData *)jsonData JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData: instead. |
183 | +- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData:error: instead. |
184 | + |
185 | +// Methods that return immutable collection objects. |
186 | +- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length; |
187 | +- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error; |
188 | +// The NSData MUST be UTF8 encoded JSON. |
189 | +- (id)objectWithData:(NSData *)jsonData; |
190 | +- (id)objectWithData:(NSData *)jsonData error:(NSError **)error; |
191 | + |
192 | +// Methods that return mutable collection objects. |
193 | +- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length; |
194 | +- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error; |
195 | +// The NSData MUST be UTF8 encoded JSON. |
196 | +- (id)mutableObjectWithData:(NSData *)jsonData; |
197 | +- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error; |
198 | + |
199 | +@end |
200 | + |
201 | +//////////// |
202 | +#pragma mark Deserializing methods |
203 | +//////////// |
204 | + |
205 | +@interface NSString (JSONKitDeserializing) |
206 | +- (id)objectFromJSONString; |
207 | +- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags; |
208 | +- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error; |
209 | +- (id)mutableObjectFromJSONString; |
210 | +- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags; |
211 | +- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error; |
212 | +@end |
213 | + |
214 | +@interface NSData (JSONKitDeserializing) |
215 | +// The NSData MUST be UTF8 encoded JSON. |
216 | +- (id)objectFromJSONData; |
217 | +- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags; |
218 | +- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error; |
219 | +- (id)mutableObjectFromJSONData; |
220 | +- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags; |
221 | +- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error; |
222 | +@end |
223 | + |
224 | +//////////// |
225 | +#pragma mark Serializing methods |
226 | +//////////// |
227 | + |
228 | +@interface NSString (JSONKitSerializing) |
229 | +// Convenience methods for those that need to serialize the receiving NSString (i.e., instead of having to serialize a NSArray with a single NSString, you can "serialize to JSON" just the NSString). |
230 | +// Normally, a string that is serialized to JSON has quotation marks surrounding it, which you may or may not want when serializing a single string, and can be controlled with includeQuotes: |
231 | +// includeQuotes:YES `a "test"...` -> `"a \"test\"..."` |
232 | +// includeQuotes:NO `a "test"...` -> `a \"test\"...` |
233 | +- (NSData *)JSONData; // Invokes JSONDataWithOptions:JKSerializeOptionNone includeQuotes:YES |
234 | +- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error; |
235 | +- (NSString *)JSONString; // Invokes JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES |
236 | +- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error; |
237 | +@end |
238 | + |
239 | +@interface NSArray (JSONKitSerializing) |
240 | +- (NSData *)JSONData; |
241 | +- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error; |
242 | +- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error; |
243 | +- (NSString *)JSONString; |
244 | +- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error; |
245 | +- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error; |
246 | +@end |
247 | + |
248 | +@interface NSDictionary (JSONKitSerializing) |
249 | +- (NSData *)JSONData; |
250 | +- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error; |
251 | +- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error; |
252 | +- (NSString *)JSONString; |
253 | +- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error; |
254 | +- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error; |
255 | +@end |
256 | + |
257 | +#ifdef __BLOCKS__ |
258 | + |
259 | +@interface NSArray (JSONKitSerializingBlockAdditions) |
260 | +- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error; |
261 | +- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error; |
262 | +@end |
263 | + |
264 | +@interface NSDictionary (JSONKitSerializingBlockAdditions) |
265 | +- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error; |
266 | +- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error; |
267 | +@end |
268 | + |
269 | +#endif |
270 | + |
271 | + |
272 | +#endif // __OBJC__ |
273 | + |
274 | +#endif // _JSONKIT_H_ |
275 | + |
276 | +#ifdef __cplusplus |
277 | +} // extern "C" |
278 | +#endif |
279 | |
280 | === added file 'Dependencies/JSONKit.framework/Versions/A/JSONKit' |
281 | Binary files Dependencies/JSONKit.framework/Versions/A/JSONKit 1970-01-01 00:00:00 +0000 and Dependencies/JSONKit.framework/Versions/A/JSONKit 2013-04-26 15:39:24 +0000 differ |
282 | === added symlink 'Dependencies/JSONKit.framework/Versions/Current' |
283 | === target is u'A' |
284 | === added directory 'Dependencies/Modal UIAlertView-UIActionSheet' |
285 | === added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.h' |
286 | --- Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.h 1970-01-01 00:00:00 +0000 |
287 | +++ Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.h 2013-04-26 15:39:24 +0000 |
288 | @@ -0,0 +1,36 @@ |
289 | +/* |
290 | + Copyright (c) 2012, José Expósito |
291 | + |
292 | + Permission is hereby granted, free of charge, to any |
293 | + person obtaining a copy of this software and associated |
294 | + documentation files (the "Software"), to deal in the |
295 | + Software without restriction, including without limitation |
296 | + the rights to use, copy, modify, merge, publish, |
297 | + distribute, sublicense, and/or sell copies of the |
298 | + Software, and to permit persons to whom the Software is |
299 | + furnished to do so, subject to the following conditions: |
300 | + |
301 | + The above copyright notice and this permission notice |
302 | + shall be included in all copies or substantial portions of |
303 | + the Software. |
304 | + |
305 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
306 | + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
307 | + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
308 | + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS |
309 | + OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
310 | + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
311 | + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
312 | + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
313 | + */ |
314 | +#import <UIKit/UIKit.h> |
315 | + |
316 | +@interface UIActionSheet (Modal) <UIActionSheetDelegate> |
317 | + |
318 | + - (NSInteger)showModalFromTabBar:(UITabBar *)view; |
319 | + - (NSInteger)showModalFromToolbar:(UIToolbar *)view; |
320 | + - (NSInteger)showModalInView:(UIView *)view; |
321 | + - (NSInteger)showModalFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated; |
322 | + - (NSInteger)showModalFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated; |
323 | + |
324 | +@end |
325 | |
326 | === added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.m' |
327 | --- Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.m 1970-01-01 00:00:00 +0000 |
328 | +++ Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.m 2013-04-26 15:39:24 +0000 |
329 | @@ -0,0 +1,83 @@ |
330 | +/* |
331 | + Copyright (c) 2012, José Expósito |
332 | + |
333 | + Permission is hereby granted, free of charge, to any |
334 | + person obtaining a copy of this software and associated |
335 | + documentation files (the "Software"), to deal in the |
336 | + Software without restriction, including without limitation |
337 | + the rights to use, copy, modify, merge, publish, |
338 | + distribute, sublicense, and/or sell copies of the |
339 | + Software, and to permit persons to whom the Software is |
340 | + furnished to do so, subject to the following conditions: |
341 | + |
342 | + The above copyright notice and this permission notice |
343 | + shall be included in all copies or substantial portions of |
344 | + the Software. |
345 | + |
346 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
347 | + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
348 | + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
349 | + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS |
350 | + OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
351 | + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
352 | + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
353 | + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
354 | + */ |
355 | +#import "UIActionSheet+Modal.h" |
356 | + |
357 | +NSInteger returnButtonIndex; |
358 | + |
359 | +@implementation UIActionSheet(Modal) |
360 | + |
361 | +- (NSInteger)showModalFromTabBar:(UITabBar *)view |
362 | +{ |
363 | + self.delegate = self; |
364 | + [self showFromTabBar:view]; |
365 | + |
366 | + CFRunLoopRun(); |
367 | + return returnButtonIndex; |
368 | +} |
369 | + |
370 | +- (NSInteger)showModalFromToolbar:(UIToolbar *)view |
371 | +{ |
372 | + self.delegate = self; |
373 | + [self showFromToolbar:view]; |
374 | + |
375 | + CFRunLoopRun(); |
376 | + return returnButtonIndex; |
377 | +} |
378 | + |
379 | +- (NSInteger)showModalInView:(UIView *)view |
380 | +{ |
381 | + self.delegate = self; |
382 | + [self showInView:view]; |
383 | + |
384 | + CFRunLoopRun(); |
385 | + return returnButtonIndex; |
386 | +} |
387 | + |
388 | +- (NSInteger)showModalFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated |
389 | +{ |
390 | + self.delegate = self; |
391 | + [self showFromBarButtonItem:item animated:animated]; |
392 | + |
393 | + CFRunLoopRun(); |
394 | + return returnButtonIndex; |
395 | +} |
396 | + |
397 | +- (NSInteger)showModalFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated |
398 | +{ |
399 | + self.delegate = self; |
400 | + [self showFromRect:rect inView:view animated:animated]; |
401 | + |
402 | + CFRunLoopRun(); |
403 | + return returnButtonIndex; |
404 | +} |
405 | + |
406 | +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex |
407 | +{ |
408 | + returnButtonIndex = buttonIndex; |
409 | + CFRunLoopStop(CFRunLoopGetCurrent()); |
410 | +} |
411 | + |
412 | +@end |
413 | |
414 | === added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.h' |
415 | --- Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.h 1970-01-01 00:00:00 +0000 |
416 | +++ Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.h 2013-04-26 15:39:24 +0000 |
417 | @@ -0,0 +1,32 @@ |
418 | +/* |
419 | + Copyright (c) 2012, José Expósito |
420 | + |
421 | + Permission is hereby granted, free of charge, to any |
422 | + person obtaining a copy of this software and associated |
423 | + documentation files (the "Software"), to deal in the |
424 | + Software without restriction, including without limitation |
425 | + the rights to use, copy, modify, merge, publish, |
426 | + distribute, sublicense, and/or sell copies of the |
427 | + Software, and to permit persons to whom the Software is |
428 | + furnished to do so, subject to the following conditions: |
429 | + |
430 | + The above copyright notice and this permission notice |
431 | + shall be included in all copies or substantial portions of |
432 | + the Software. |
433 | + |
434 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
435 | + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
436 | + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
437 | + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS |
438 | + OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
439 | + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
440 | + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
441 | + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
442 | + */ |
443 | +#import <UIKit/UIKit.h> |
444 | + |
445 | +@interface UIAlertView (Modal) <UIAlertViewDelegate> |
446 | + |
447 | + - (NSInteger)showModal; |
448 | + |
449 | +@end |
450 | |
451 | === added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.m' |
452 | --- Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.m 1970-01-01 00:00:00 +0000 |
453 | +++ Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.m 2013-04-26 15:39:24 +0000 |
454 | @@ -0,0 +1,47 @@ |
455 | +/* |
456 | + Copyright (c) 2012, José Expósito |
457 | + |
458 | + Permission is hereby granted, free of charge, to any |
459 | + person obtaining a copy of this software and associated |
460 | + documentation files (the "Software"), to deal in the |
461 | + Software without restriction, including without limitation |
462 | + the rights to use, copy, modify, merge, publish, |
463 | + distribute, sublicense, and/or sell copies of the |
464 | + Software, and to permit persons to whom the Software is |
465 | + furnished to do so, subject to the following conditions: |
466 | + |
467 | + The above copyright notice and this permission notice |
468 | + shall be included in all copies or substantial portions of |
469 | + the Software. |
470 | + |
471 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
472 | + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
473 | + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
474 | + PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS |
475 | + OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
476 | + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
477 | + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
478 | + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
479 | + */ |
480 | +#import "UIAlertView+Modal.h" |
481 | + |
482 | +NSInteger returnButtonIndex; |
483 | + |
484 | +@implementation UIAlertView (Modal) |
485 | + |
486 | +- (NSInteger)showModal |
487 | +{ |
488 | + self.delegate = self; |
489 | + [self show]; |
490 | + |
491 | + CFRunLoopRun(); |
492 | + return returnButtonIndex; |
493 | +} |
494 | + |
495 | +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex |
496 | +{ |
497 | + returnButtonIndex = buttonIndex; |
498 | + CFRunLoopStop(CFRunLoopGetCurrent()); |
499 | +} |
500 | + |
501 | +@end |
502 | |
503 | === added directory 'Dependencies/OAuthConsumer.framework' |
504 | === added symlink 'Dependencies/OAuthConsumer.framework/Headers' |
505 | === target is u'Versions/Current/Headers' |
506 | === added symlink 'Dependencies/OAuthConsumer.framework/OAuthConsumer' |
507 | === target is u'Versions/Current/OAuthConsumer' |
508 | === added directory 'Dependencies/OAuthConsumer.framework/Versions' |
509 | === added directory 'Dependencies/OAuthConsumer.framework/Versions/A' |
510 | === added directory 'Dependencies/OAuthConsumer.framework/Versions/A/Headers' |
511 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/Base64Transcoder.h' |
512 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/Base64Transcoder.h 1970-01-01 00:00:00 +0000 |
513 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/Base64Transcoder.h 2013-04-26 15:39:24 +0000 |
514 | @@ -0,0 +1,36 @@ |
515 | +/* |
516 | + * Base64Transcoder.h |
517 | + * Base64Test |
518 | + * |
519 | + * Created by Jonathan Wight on Tue Mar 18 2003. |
520 | + * Copyright (c) 2003 Toxic Software. All rights reserved. |
521 | + * |
522 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
523 | + * of this software and associated documentation files (the "Software"), to deal |
524 | + * in the Software without restriction, including without limitation the rights |
525 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
526 | + * copies of the Software, and to permit persons to whom the Software is |
527 | + * furnished to do so, subject to the following conditions: |
528 | + * |
529 | + * The above copyright notice and this permission notice shall be included in |
530 | + * all copies or substantial portions of the Software. |
531 | + * |
532 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
533 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
534 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
535 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
536 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
537 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
538 | + * THE SOFTWARE. |
539 | + * |
540 | + */ |
541 | + |
542 | +#include <stdlib.h> |
543 | +#include <stdbool.h> |
544 | + |
545 | +extern size_t EstimateBas64EncodedDataSize(size_t inDataSize); |
546 | +extern size_t EstimateBas64DecodedDataSize(size_t inDataSize); |
547 | + |
548 | +extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize); |
549 | +extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize); |
550 | + |
551 | |
552 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSMutableURLRequest+Parameters.h' |
553 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSMutableURLRequest+Parameters.h 1970-01-01 00:00:00 +0000 |
554 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSMutableURLRequest+Parameters.h 2013-04-26 15:39:24 +0000 |
555 | @@ -0,0 +1,37 @@ |
556 | +// |
557 | +// NSMutableURLRequest+Parameters.h |
558 | +// |
559 | +// Created by Jon Crosby on 10/19/07. |
560 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
561 | +// |
562 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
563 | +// of this software and associated documentation files (the "Software"), to deal |
564 | +// in the Software without restriction, including without limitation the rights |
565 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
566 | +// copies of the Software, and to permit persons to whom the Software is |
567 | +// furnished to do so, subject to the following conditions: |
568 | +// |
569 | +// The above copyright notice and this permission notice shall be included in |
570 | +// all copies or substantial portions of the Software. |
571 | +// |
572 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
573 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
574 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
575 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
576 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
577 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
578 | +// THE SOFTWARE. |
579 | + |
580 | +#import <Foundation/Foundation.h> |
581 | +#import "OARequestParameter.h" |
582 | +#import "NSURL+Base.h" |
583 | + |
584 | + |
585 | +@interface NSMutableURLRequest (OAParameterAdditions) |
586 | + |
587 | +@property(nonatomic, retain) NSArray *parameters; |
588 | + |
589 | +- (void)setHTTPBodyWithString:(NSString *)body; |
590 | +- (void)attachFileWithName:(NSString *)name filename:(NSString*)filename contentType:(NSString *)contentType data:(NSData*)data; |
591 | + |
592 | +@end |
593 | |
594 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSString+URLEncoding.h' |
595 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSString+URLEncoding.h 1970-01-01 00:00:00 +0000 |
596 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSString+URLEncoding.h 2013-04-26 15:39:24 +0000 |
597 | @@ -0,0 +1,35 @@ |
598 | +// |
599 | +// NSString+URLEncoding.h |
600 | +// |
601 | +// Created by Jon Crosby on 10/19/07. |
602 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
603 | +// |
604 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
605 | +// of this software and associated documentation files (the "Software"), to deal |
606 | +// in the Software without restriction, including without limitation the rights |
607 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
608 | +// copies of the Software, and to permit persons to whom the Software is |
609 | +// furnished to do so, subject to the following conditions: |
610 | +// |
611 | +// The above copyright notice and this permission notice shall be included in |
612 | +// all copies or substantial portions of the Software. |
613 | +// |
614 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
615 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
616 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
617 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
618 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
619 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
620 | +// THE SOFTWARE. |
621 | + |
622 | + |
623 | +#import <Foundation/Foundation.h> |
624 | + |
625 | + |
626 | +@interface NSString (OAURLEncodingAdditions) |
627 | + |
628 | +- (NSString *)encodedURLString; |
629 | +- (NSString *)encodedURLParameterString; |
630 | +- (NSString *)decodedURLString; |
631 | +- (NSString *)removeQuotes; |
632 | +@end |
633 | |
634 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSURL+Base.h' |
635 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSURL+Base.h 1970-01-01 00:00:00 +0000 |
636 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSURL+Base.h 2013-04-26 15:39:24 +0000 |
637 | @@ -0,0 +1,34 @@ |
638 | +// |
639 | +// NSURL+Base.h |
640 | +// OAuthConsumer |
641 | +// |
642 | +// Created by Jon Crosby on 10/19/07. |
643 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
644 | +// |
645 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
646 | +// of this software and associated documentation files (the "Software"), to deal |
647 | +// in the Software without restriction, including without limitation the rights |
648 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
649 | +// copies of the Software, and to permit persons to whom the Software is |
650 | +// furnished to do so, subject to the following conditions: |
651 | +// |
652 | +// The above copyright notice and this permission notice shall be included in |
653 | +// all copies or substantial portions of the Software. |
654 | +// |
655 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
656 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
657 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
658 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
659 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
660 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
661 | +// THE SOFTWARE. |
662 | + |
663 | + |
664 | +#import <Foundation/Foundation.h> |
665 | + |
666 | + |
667 | +@interface NSURL (OABaseAdditions) |
668 | + |
669 | +- (NSString *)URLStringWithoutQuery; |
670 | + |
671 | +@end |
672 | |
673 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAAttachment.h' |
674 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAAttachment.h 1970-01-01 00:00:00 +0000 |
675 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAAttachment.h 2013-04-26 15:39:24 +0000 |
676 | @@ -0,0 +1,26 @@ |
677 | +// |
678 | +// OAAttachment.h |
679 | +// Zeus |
680 | +// |
681 | +// Created by Jamie Pinkham on 2/3/11. |
682 | +// Copyright 2011 Tumblr. All rights reserved. |
683 | +// |
684 | + |
685 | +#import <Foundation/Foundation.h> |
686 | + |
687 | + |
688 | +@interface OAAttachment : NSObject { |
689 | + NSString *name; |
690 | + NSString *fileName; |
691 | + NSString *contentType; |
692 | + NSData *data; |
693 | +} |
694 | + |
695 | +@property (nonatomic, copy) NSString *name; |
696 | +@property (nonatomic, copy) NSString *fileName; |
697 | +@property (nonatomic, copy) NSString *contentType; |
698 | +@property (nonatomic, copy) NSData *data; |
699 | + |
700 | +- (id)initWithName:(NSString *)aName filename:(NSString *)aFilename contentType:(NSString *)aContentType data:(NSData *)aData; |
701 | + |
702 | +@end |
703 | |
704 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OACall.h' |
705 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OACall.h 1970-01-01 00:00:00 +0000 |
706 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OACall.h 2013-04-26 15:39:24 +0000 |
707 | @@ -0,0 +1,63 @@ |
708 | +// |
709 | +// OACall.h |
710 | +// OAuthConsumer |
711 | +// |
712 | +// Created by Alberto García Hierro on 04/09/08. |
713 | +// Copyright 2008 Alberto García Hierro. All rights reserved. |
714 | +// bynotes.com |
715 | + |
716 | +#import <Foundation/Foundation.h> |
717 | + |
718 | +@class OAProblem; |
719 | +@class OACall; |
720 | + |
721 | +@protocol OACallDelegate |
722 | + |
723 | +- (void)call:(OACall *)call failedWithError:(NSError *)error; |
724 | +- (void)call:(OACall *)call failedWithProblem:(OAProblem *)problem; |
725 | + |
726 | +@end |
727 | + |
728 | +@class OAConsumer; |
729 | +@class OAToken; |
730 | +@class OADataFetcher; |
731 | +@class OAMutableURLRequest; |
732 | +@class OAServiceTicket; |
733 | + |
734 | +@interface OACall : NSObject { |
735 | + NSURL *url; |
736 | + NSString *method; |
737 | + NSArray *parameters; |
738 | + NSDictionary *files; |
739 | + NSObject <OACallDelegate> *delegate; |
740 | + SEL finishedSelector; |
741 | + OADataFetcher *fetcher; |
742 | + OAMutableURLRequest *request; |
743 | + OAServiceTicket *ticket; |
744 | +} |
745 | + |
746 | +@property(readonly) NSURL *url; |
747 | +@property(readonly) NSString *method; |
748 | +@property(readonly) NSArray *parameters; |
749 | +@property(readonly) NSDictionary *files; |
750 | +@property(nonatomic, retain) OAServiceTicket *ticket; |
751 | + |
752 | +- (id)init; |
753 | +- (id)initWithURL:(NSURL *)aURL; |
754 | +- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod; |
755 | +- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters; |
756 | +- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters; |
757 | +- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters files:(NSDictionary*)theFiles; |
758 | + |
759 | +- (id)initWithURL:(NSURL *)aURL |
760 | + method:(NSString *)aMethod |
761 | + parameters:(NSArray *)theParameters |
762 | + files:(NSDictionary*)theFiles; |
763 | + |
764 | +- (void)perform:(OAConsumer *)consumer |
765 | + token:(OAToken *)token |
766 | + realm:(NSString *)realm |
767 | + delegate:(NSObject <OACallDelegate> *)aDelegate |
768 | + didFinish:(SEL)finished; |
769 | + |
770 | +@end |
771 | |
772 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAConsumer.h' |
773 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAConsumer.h 1970-01-01 00:00:00 +0000 |
774 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAConsumer.h 2013-04-26 15:39:24 +0000 |
775 | @@ -0,0 +1,42 @@ |
776 | +// |
777 | +// OAConsumer.h |
778 | +// OAuthConsumer |
779 | +// |
780 | +// Created by Jon Crosby on 10/19/07. |
781 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
782 | +// |
783 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
784 | +// of this software and associated documentation files (the "Software"), to deal |
785 | +// in the Software without restriction, including without limitation the rights |
786 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
787 | +// copies of the Software, and to permit persons to whom the Software is |
788 | +// furnished to do so, subject to the following conditions: |
789 | +// |
790 | +// The above copyright notice and this permission notice shall be included in |
791 | +// all copies or substantial portions of the Software. |
792 | +// |
793 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
794 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
795 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
796 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
797 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
798 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
799 | +// THE SOFTWARE. |
800 | + |
801 | + |
802 | +#import <Foundation/Foundation.h> |
803 | + |
804 | + |
805 | +@interface OAConsumer : NSObject { |
806 | +@protected |
807 | + NSString *key; |
808 | + NSString *secret; |
809 | +} |
810 | +@property(copy, readwrite) NSString *key; |
811 | +@property(copy, readwrite) NSString *secret; |
812 | + |
813 | +- (id)initWithKey:(const NSString *)aKey secret:(const NSString *)aSecret; |
814 | + |
815 | +- (BOOL)isEqualToConsumer:(OAConsumer *)aConsumer; |
816 | + |
817 | +@end |
818 | |
819 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OADataFetcher.h' |
820 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OADataFetcher.h 1970-01-01 00:00:00 +0000 |
821 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OADataFetcher.h 2013-04-26 15:39:24 +0000 |
822 | @@ -0,0 +1,44 @@ |
823 | +// |
824 | +// OADataFetcher.h |
825 | +// OAuthConsumer |
826 | +// |
827 | +// Created by Jon Crosby on 11/5/07. |
828 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
829 | +// |
830 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
831 | +// of this software and associated documentation files (the "Software"), to deal |
832 | +// in the Software without restriction, including without limitation the rights |
833 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
834 | +// copies of the Software, and to permit persons to whom the Software is |
835 | +// furnished to do so, subject to the following conditions: |
836 | +// |
837 | +// The above copyright notice and this permission notice shall be included in |
838 | +// all copies or substantial portions of the Software. |
839 | +// |
840 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
841 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
842 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
843 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
844 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
845 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
846 | +// THE SOFTWARE. |
847 | + |
848 | +#import <Foundation/Foundation.h> |
849 | +#import "OAMutableURLRequest.h" |
850 | +#import "OAServiceTicket.h" |
851 | + |
852 | + |
853 | +@interface OADataFetcher : NSObject { |
854 | +@private |
855 | + OAMutableURLRequest *request; |
856 | + NSURLResponse *response; |
857 | + NSURLConnection *connection; |
858 | + NSMutableData *responseData; |
859 | + id delegate; |
860 | + SEL didFinishSelector; |
861 | + SEL didFailSelector; |
862 | +} |
863 | + |
864 | +- (void)fetchDataWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector; |
865 | + |
866 | +@end |
867 | |
868 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAHMAC_SHA1SignatureProvider.h' |
869 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAHMAC_SHA1SignatureProvider.h 1970-01-01 00:00:00 +0000 |
870 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAHMAC_SHA1SignatureProvider.h 2013-04-26 15:39:24 +0000 |
871 | @@ -0,0 +1,32 @@ |
872 | +// |
873 | +// OAHMAC_SHA1SignatureProvider.h |
874 | +// OAuthConsumer |
875 | +// |
876 | +// Created by Jon Crosby on 10/19/07. |
877 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
878 | +// |
879 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
880 | +// of this software and associated documentation files (the "Software"), to deal |
881 | +// in the Software without restriction, including without limitation the rights |
882 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
883 | +// copies of the Software, and to permit persons to whom the Software is |
884 | +// furnished to do so, subject to the following conditions: |
885 | +// |
886 | +// The above copyright notice and this permission notice shall be included in |
887 | +// all copies or substantial portions of the Software. |
888 | +// |
889 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
890 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
891 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
892 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
893 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
894 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
895 | +// THE SOFTWARE. |
896 | + |
897 | + |
898 | +#import <Foundation/Foundation.h> |
899 | +#import "OASignatureProviding.h" |
900 | + |
901 | + |
902 | +@interface OAHMAC_SHA1SignatureProvider : NSObject <OASignatureProviding> |
903 | +@end |
904 | |
905 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAMutableURLRequest.h' |
906 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAMutableURLRequest.h 1970-01-01 00:00:00 +0000 |
907 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAMutableURLRequest.h 2013-04-26 15:39:24 +0000 |
908 | @@ -0,0 +1,65 @@ |
909 | +// |
910 | +// OAMutableURLRequest.h |
911 | +// OAuthConsumer |
912 | +// |
913 | +// Created by Jon Crosby on 10/19/07. |
914 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
915 | +// |
916 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
917 | +// of this software and associated documentation files (the "Software"), to deal |
918 | +// in the Software without restriction, including without limitation the rights |
919 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
920 | +// copies of the Software, and to permit persons to whom the Software is |
921 | +// furnished to do so, subject to the following conditions: |
922 | +// |
923 | +// The above copyright notice and this permission notice shall be included in |
924 | +// all copies or substantial portions of the Software. |
925 | +// |
926 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
927 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
928 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
929 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
930 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
931 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
932 | +// THE SOFTWARE. |
933 | + |
934 | + |
935 | +#import <Foundation/Foundation.h> |
936 | +#import "OAConsumer.h" |
937 | +#import "OAToken.h" |
938 | +#import "OAHMAC_SHA1SignatureProvider.h" |
939 | +#import "OASignatureProviding.h" |
940 | +#import "NSMutableURLRequest+Parameters.h" |
941 | +#import "NSURL+Base.h" |
942 | + |
943 | + |
944 | +@interface OAMutableURLRequest : NSMutableURLRequest { |
945 | +@protected |
946 | + OAConsumer *consumer; |
947 | + OAToken *token; |
948 | + NSString *realm; |
949 | + NSString *signature; |
950 | + id<OASignatureProviding> signatureProvider; |
951 | + NSString *nonce; |
952 | + NSString *timestamp; |
953 | +} |
954 | +@property(readonly) NSString *signature; |
955 | +@property(readonly) NSString *nonce; |
956 | + |
957 | +- (id)initWithURL:(NSURL *)aUrl |
958 | + consumer:(OAConsumer *)aConsumer |
959 | + token:(OAToken *)aToken |
960 | + realm:(NSString *)aRealm |
961 | +signatureProvider:(id<OASignatureProviding>)aProvider; |
962 | + |
963 | +- (id)initWithURL:(NSURL *)aUrl |
964 | + consumer:(OAConsumer *)aConsumer |
965 | + token:(OAToken *)aToken |
966 | + realm:(NSString *)aRealm |
967 | +signatureProvider:(id<OASignatureProviding>)aProvider |
968 | + nonce:(NSString *)aNonce |
969 | + timestamp:(NSString *)aTimestamp; |
970 | + |
971 | +- (void)prepare; |
972 | + |
973 | +@end |
974 | |
975 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAPlaintextSignatureProvider.h' |
976 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAPlaintextSignatureProvider.h 1970-01-01 00:00:00 +0000 |
977 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAPlaintextSignatureProvider.h 2013-04-26 15:39:24 +0000 |
978 | @@ -0,0 +1,31 @@ |
979 | +// |
980 | +// OAPlaintextSignatureProvider.h |
981 | +// OAuthConsumer |
982 | +// |
983 | +// Created by Jon Crosby on 10/19/07. |
984 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
985 | +// |
986 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
987 | +// of this software and associated documentation files (the "Software"), to deal |
988 | +// in the Software without restriction, including without limitation the rights |
989 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
990 | +// copies of the Software, and to permit persons to whom the Software is |
991 | +// furnished to do so, subject to the following conditions: |
992 | +// |
993 | +// The above copyright notice and this permission notice shall be included in |
994 | +// all copies or substantial portions of the Software. |
995 | +// |
996 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
997 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
998 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
999 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1000 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1001 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1002 | +// THE SOFTWARE. |
1003 | + |
1004 | + |
1005 | +#import <Foundation/Foundation.h> |
1006 | +#import "OASignatureProviding.h" |
1007 | + |
1008 | +@interface OAPlaintextSignatureProvider : NSObject <OASignatureProviding> |
1009 | +@end |
1010 | |
1011 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAProblem.h' |
1012 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAProblem.h 1970-01-01 00:00:00 +0000 |
1013 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAProblem.h 2013-04-26 15:39:24 +0000 |
1014 | @@ -0,0 +1,53 @@ |
1015 | +// |
1016 | +// OAProblem.h |
1017 | +// OAuthConsumer |
1018 | +// |
1019 | +// Created by Alberto García Hierro on 03/09/08. |
1020 | +// Copyright 2008 Alberto García Hierro. All rights reserved. |
1021 | +// bynotes.com |
1022 | + |
1023 | +#import <Foundation/Foundation.h> |
1024 | + |
1025 | +enum { |
1026 | + kOAProblemSignatureMethodRejected = 0, |
1027 | + kOAProblemParameterAbsent, |
1028 | + kOAProblemVersionRejected, |
1029 | + kOAProblemConsumerKeyUnknown, |
1030 | + kOAProblemTokenRejected, |
1031 | + kOAProblemSignatureInvalid, |
1032 | + kOAProblemNonceUsed, |
1033 | + kOAProblemTimestampRefused, |
1034 | + kOAProblemTokenExpired, |
1035 | + kOAProblemTokenNotRenewable |
1036 | +}; |
1037 | + |
1038 | +@interface OAProblem : NSObject { |
1039 | + NSString *problem; |
1040 | +} |
1041 | + |
1042 | +@property (readonly) NSString *problem; |
1043 | + |
1044 | +- (id)initWithProblem:(NSString *)aProblem; |
1045 | +- (id)initWithResponseBody:(NSString *)response; |
1046 | + |
1047 | +- (BOOL)isEqualToProblem:(OAProblem *)aProblem; |
1048 | +- (BOOL)isEqualToString:(NSString *)aProblem; |
1049 | +- (BOOL)isEqualTo:(id)aProblem; |
1050 | +- (int)code; |
1051 | + |
1052 | ++ (OAProblem *)problemWithResponseBody:(NSString *)response; |
1053 | + |
1054 | ++ (NSArray *)validProblems; |
1055 | + |
1056 | ++ (OAProblem *)SignatureMethodRejected; |
1057 | ++ (OAProblem *)ParameterAbsent; |
1058 | ++ (OAProblem *)VersionRejected; |
1059 | ++ (OAProblem *)ConsumerKeyUnknown; |
1060 | ++ (OAProblem *)TokenRejected; |
1061 | ++ (OAProblem *)SignatureInvalid; |
1062 | ++ (OAProblem *)NonceUsed; |
1063 | ++ (OAProblem *)TimestampRefused; |
1064 | ++ (OAProblem *)TokenExpired; |
1065 | ++ (OAProblem *)TokenNotRenewable; |
1066 | + |
1067 | +@end |
1068 | |
1069 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OARequestParameter.h' |
1070 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OARequestParameter.h 1970-01-01 00:00:00 +0000 |
1071 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OARequestParameter.h 2013-04-26 15:39:24 +0000 |
1072 | @@ -0,0 +1,48 @@ |
1073 | +// |
1074 | +// OARequestParameter.h |
1075 | +// OAuthConsumer |
1076 | +// |
1077 | +// Created by Jon Crosby on 10/19/07. |
1078 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
1079 | +// |
1080 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
1081 | +// of this software and associated documentation files (the "Software"), to deal |
1082 | +// in the Software without restriction, including without limitation the rights |
1083 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
1084 | +// copies of the Software, and to permit persons to whom the Software is |
1085 | +// furnished to do so, subject to the following conditions: |
1086 | +// |
1087 | +// The above copyright notice and this permission notice shall be included in |
1088 | +// all copies or substantial portions of the Software. |
1089 | +// |
1090 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
1091 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
1092 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
1093 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1094 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1095 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1096 | +// THE SOFTWARE. |
1097 | + |
1098 | + |
1099 | +#import <Foundation/Foundation.h> |
1100 | +#import "NSString+URLEncoding.h" |
1101 | + |
1102 | + |
1103 | +@interface OARequestParameter : NSObject { |
1104 | +@protected |
1105 | + NSString *name; |
1106 | + NSString *value; |
1107 | +} |
1108 | +@property(copy, readwrite) NSString *name; |
1109 | +@property(copy, readwrite) NSString *value; |
1110 | + |
1111 | +- (id)initWithName:(NSString *)aName value:(NSString *)aValue; |
1112 | +- (NSString *)URLEncodedName; |
1113 | +- (NSString *)URLEncodedValue; |
1114 | +- (NSString *)URLEncodedNameValuePair; |
1115 | + |
1116 | +- (BOOL)isEqualToRequestParameter:(OARequestParameter *)parameter; |
1117 | + |
1118 | ++ (id)requestParameter:(NSString *)aName value:(NSString *)aValue; |
1119 | + |
1120 | +@end |
1121 | |
1122 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAServiceTicket.h' |
1123 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAServiceTicket.h 1970-01-01 00:00:00 +0000 |
1124 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAServiceTicket.h 2013-04-26 15:39:24 +0000 |
1125 | @@ -0,0 +1,46 @@ |
1126 | +// |
1127 | +// OAServiceTicket.h |
1128 | +// OAuthConsumer |
1129 | +// |
1130 | +// Created by Jon Crosby on 11/5/07. |
1131 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
1132 | +// |
1133 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
1134 | +// of this software and associated documentation files (the "Software"), to deal |
1135 | +// in the Software without restriction, including without limitation the rights |
1136 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
1137 | +// copies of the Software, and to permit persons to whom the Software is |
1138 | +// furnished to do so, subject to the following conditions: |
1139 | +// |
1140 | +// The above copyright notice and this permission notice shall be included in |
1141 | +// all copies or substantial portions of the Software. |
1142 | +// |
1143 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
1144 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
1145 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
1146 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1147 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1148 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1149 | +// THE SOFTWARE. |
1150 | + |
1151 | + |
1152 | +#import <Foundation/Foundation.h> |
1153 | +#import "OAMutableURLRequest.h" |
1154 | + |
1155 | + |
1156 | +@interface OAServiceTicket : NSObject { |
1157 | +@private |
1158 | + OAMutableURLRequest *request; |
1159 | + NSURLResponse *response; |
1160 | + NSData *data; |
1161 | + BOOL didSucceed; |
1162 | +} |
1163 | +@property(readonly) OAMutableURLRequest *request; |
1164 | +@property(readonly) NSURLResponse *response; |
1165 | +@property(readonly) NSData *data; |
1166 | +@property(readonly) BOOL didSucceed; |
1167 | +@property(readonly) NSString *body; |
1168 | + |
1169 | +- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSURLResponse *)aResponse data:(NSData *)aData didSucceed:(BOOL)success; |
1170 | + |
1171 | +@end |
1172 | |
1173 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OASignatureProviding.h' |
1174 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OASignatureProviding.h 1970-01-01 00:00:00 +0000 |
1175 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OASignatureProviding.h 2013-04-26 15:39:24 +0000 |
1176 | @@ -0,0 +1,34 @@ |
1177 | +// |
1178 | +// OASignatureProviding.h |
1179 | +// |
1180 | +// Created by Jon Crosby on 10/19/07. |
1181 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
1182 | +// |
1183 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
1184 | +// of this software and associated documentation files (the "Software"), to deal |
1185 | +// in the Software without restriction, including without limitation the rights |
1186 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
1187 | +// copies of the Software, and to permit persons to whom the Software is |
1188 | +// furnished to do so, subject to the following conditions: |
1189 | +// |
1190 | +// The above copyright notice and this permission notice shall be included in |
1191 | +// all copies or substantial portions of the Software. |
1192 | +// |
1193 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
1194 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
1195 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
1196 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1197 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1198 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1199 | +// THE SOFTWARE. |
1200 | + |
1201 | + |
1202 | +#import <Foundation/Foundation.h> |
1203 | + |
1204 | + |
1205 | +@protocol OASignatureProviding <NSObject> |
1206 | + |
1207 | +- (NSString *)name; |
1208 | +- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret; |
1209 | + |
1210 | +@end |
1211 | |
1212 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAToken.h' |
1213 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAToken.h 1970-01-01 00:00:00 +0000 |
1214 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAToken.h 2013-04-26 15:39:24 +0000 |
1215 | @@ -0,0 +1,73 @@ |
1216 | +// |
1217 | +// OAToken.h |
1218 | +// OAuthConsumer |
1219 | +// |
1220 | +// Created by Jon Crosby on 10/19/07. |
1221 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
1222 | +// |
1223 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
1224 | +// of this software and associated documentation files (the "Software"), to deal |
1225 | +// in the Software without restriction, including without limitation the rights |
1226 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
1227 | +// copies of the Software, and to permit persons to whom the Software is |
1228 | +// furnished to do so, subject to the following conditions: |
1229 | +// |
1230 | +// The above copyright notice and this permission notice shall be included in |
1231 | +// all copies or substantial portions of the Software. |
1232 | +// |
1233 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
1234 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
1235 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
1236 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1237 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1238 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1239 | +// THE SOFTWARE. |
1240 | + |
1241 | +#import <Foundation/Foundation.h> |
1242 | + |
1243 | +@interface OAToken : NSObject <NSCoding> { |
1244 | +@protected |
1245 | + NSString *key; |
1246 | + NSString *secret; |
1247 | + NSString *session; |
1248 | + NSNumber *duration; |
1249 | + NSMutableDictionary *attributes; |
1250 | + NSDate *created; |
1251 | + BOOL renewable; |
1252 | + BOOL forRenewal; |
1253 | +} |
1254 | +@property(retain, readwrite) NSString *key; |
1255 | +@property(retain, readwrite) NSString *secret; |
1256 | +@property(retain, readwrite) NSString *session; |
1257 | +@property(retain, readwrite) NSNumber *duration; |
1258 | +@property(retain, readwrite) NSString *verifier; |
1259 | +@property(nonatomic, retain, readwrite) NSDictionary *attributes; |
1260 | +@property(readwrite, getter=isForRenewal) BOOL forRenewal; |
1261 | + |
1262 | +- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret; |
1263 | +- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret session:(NSString *)aSession |
1264 | + duration:(NSNumber *)aDuration attributes:(NSDictionary *)theAttributes created:(NSDate *)creation |
1265 | + renewable:(BOOL)renew; |
1266 | +- (id)initWithHTTPResponseBody:(NSString *)body; |
1267 | + |
1268 | +- (id)initWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix; |
1269 | +- (int)storeInUserDefaultsWithServiceProviderName:(NSString *)provider prefix:(NSString *)prefix; |
1270 | + |
1271 | +- (BOOL)isValid; |
1272 | + |
1273 | +- (void)setAttribute:(NSString *)aKey value:(NSString *)aValue; |
1274 | +- (NSString *)attribute:(NSString *)aKey; |
1275 | +- (void)setAttributesWithString:(NSString *)aAttributes; |
1276 | +- (NSString *)attributeString; |
1277 | + |
1278 | +- (BOOL)hasExpired; |
1279 | +- (BOOL)isRenewable; |
1280 | +- (void)setDurationWithString:(NSString *)aDuration; |
1281 | +- (BOOL)hasAttributes; |
1282 | +- (NSDictionary *)parameters; |
1283 | + |
1284 | +- (BOOL)isEqualToToken:(OAToken *)aToken; |
1285 | + |
1286 | ++ (void)removeFromUserDefaultsWithServiceProviderName:(const NSString *)provider prefix:(const NSString *)prefix; |
1287 | + |
1288 | +@end |
1289 | |
1290 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OATokenManager.h' |
1291 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OATokenManager.h 1970-01-01 00:00:00 +0000 |
1292 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OATokenManager.h 2013-04-26 15:39:24 +0000 |
1293 | @@ -0,0 +1,68 @@ |
1294 | +// |
1295 | +// OATokenManager.h |
1296 | +// OAuthConsumer |
1297 | +// |
1298 | +// Created by Alberto García Hierro on 01/09/08. |
1299 | +// Copyright 2008 Alberto García Hierro. All rights reserved. |
1300 | +// bynotes.com |
1301 | + |
1302 | +#import <Foundation/Foundation.h> |
1303 | + |
1304 | +#import "OACall.h" |
1305 | + |
1306 | +@class OATokenManager; |
1307 | + |
1308 | +@protocol OATokenManagerDelegate |
1309 | + |
1310 | +- (BOOL)tokenManager:(OATokenManager *)manager failedCall:(OACall *)call withError:(NSError *)error; |
1311 | +- (BOOL)tokenManager:(OATokenManager *)manager failedCall:(OACall *)call withProblem:(OAProblem *)problem; |
1312 | + |
1313 | +@optional |
1314 | + |
1315 | +- (BOOL)tokenManagerNeedsToken:(OATokenManager *)manager; |
1316 | + |
1317 | +@end |
1318 | + |
1319 | +@class OAConsumer; |
1320 | +@class OAToken; |
1321 | + |
1322 | +@interface OATokenManager : NSObject<OACallDelegate> { |
1323 | + OAConsumer *consumer; |
1324 | + OAToken *acToken; |
1325 | + OAToken *reqToken; |
1326 | + OAToken *initialToken; |
1327 | + NSString *authorizedTokenKey; |
1328 | + NSString *oauthBase; |
1329 | + NSString *realm; |
1330 | + NSString *callback; |
1331 | + NSObject <OATokenManagerDelegate> *delegate; |
1332 | + NSMutableArray *calls; |
1333 | + NSMutableArray *selectors; |
1334 | + NSMutableDictionary *delegates; |
1335 | + BOOL isDispatching; |
1336 | +} |
1337 | + |
1338 | + |
1339 | +- (id)init; |
1340 | + |
1341 | +- (id)initWithConsumer:(OAConsumer *)aConsumer token:(OAToken *)aToken oauthBase:(const NSString *)base |
1342 | + realm:(const NSString *)aRealm callback:(const NSString *)aCallback |
1343 | + delegate:(NSObject <OATokenManagerDelegate> *)aDelegate; |
1344 | + |
1345 | +- (void)authorizedToken:(const NSString *)key; |
1346 | + |
1347 | +- (void)fetchData:(NSString *)aURL finished:(SEL)didFinish; |
1348 | + |
1349 | +- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters |
1350 | + finished:(SEL)didFinish; |
1351 | + |
1352 | +- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters |
1353 | + files:(NSDictionary *)theFiles finished:(SEL)didFinish; |
1354 | + |
1355 | +- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters |
1356 | + files:(NSDictionary *)theFiles finished:(SEL)didFinish delegate:(NSObject*)aDelegate; |
1357 | + |
1358 | +- (void)call:(OACall *)call failedWithError:(NSError *)error; |
1359 | +- (void)call:(OACall *)call failedWithProblem:(OAProblem *)problem; |
1360 | + |
1361 | +@end |
1362 | |
1363 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAuthConsumer.h' |
1364 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAuthConsumer.h 1970-01-01 00:00:00 +0000 |
1365 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAuthConsumer.h 2013-04-26 15:39:24 +0000 |
1366 | @@ -0,0 +1,40 @@ |
1367 | +// |
1368 | +// OAuthConsumer.h |
1369 | +// OAuthConsumer |
1370 | +// |
1371 | +// Created by Jon Crosby on 10/19/07. |
1372 | +// Copyright 2007 Kaboomerang LLC. All rights reserved. |
1373 | +// |
1374 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
1375 | +// of this software and associated documentation files (the "Software"), to deal |
1376 | +// in the Software without restriction, including without limitation the rights |
1377 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
1378 | +// copies of the Software, and to permit persons to whom the Software is |
1379 | +// furnished to do so, subject to the following conditions: |
1380 | +// |
1381 | +// The above copyright notice and this permission notice shall be included in |
1382 | +// all copies or substantial portions of the Software. |
1383 | +// |
1384 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
1385 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
1386 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
1387 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1388 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1389 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1390 | +// THE SOFTWARE. |
1391 | + |
1392 | +#import <Foundation/Foundation.h> |
1393 | +#import "OAProblem.h" |
1394 | +#import "OAToken.h" |
1395 | +#import "OAConsumer.h" |
1396 | +#import "OAMutableURLRequest.h" |
1397 | +#import "NSString+URLEncoding.h" |
1398 | +#import "NSMutableURLRequest+Parameters.h" |
1399 | +#import "NSURL+Base.h" |
1400 | +#import "OASignatureProviding.h" |
1401 | +#import "OAHMAC_SHA1SignatureProvider.h" |
1402 | +#import "OAPlaintextSignatureProvider.h" |
1403 | +#import "OARequestParameter.h" |
1404 | +#import "OAServiceTicket.h" |
1405 | +#import "OADataFetcher.h" |
1406 | +#import "OATokenManager.h" |
1407 | \ No newline at end of file |
1408 | |
1409 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/hmac.h' |
1410 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/hmac.h 1970-01-01 00:00:00 +0000 |
1411 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/hmac.h 2013-04-26 15:39:24 +0000 |
1412 | @@ -0,0 +1,31 @@ |
1413 | +// |
1414 | +// hmac.h |
1415 | +// OAuthConsumer |
1416 | +// |
1417 | +// Created by Jonathan Wight on 4/8/8. |
1418 | +// Copyright 2008 Jonathan Wight. All rights reserved. |
1419 | +// |
1420 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
1421 | +// of this software and associated documentation files (the "Software"), to deal |
1422 | +// in the Software without restriction, including without limitation the rights |
1423 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
1424 | +// copies of the Software, and to permit persons to whom the Software is |
1425 | +// furnished to do so, subject to the following conditions: |
1426 | +// |
1427 | +// The above copyright notice and this permission notice shall be included in |
1428 | +// all copies or substantial portions of the Software. |
1429 | +// |
1430 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
1431 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
1432 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
1433 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
1434 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
1435 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
1436 | +// THE SOFTWARE. |
1437 | + |
1438 | +#ifndef HMAC_H |
1439 | +#define HMAC_H 1 |
1440 | + |
1441 | +extern void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, const size_t inKeyLength, u_int8_t *outDigest); |
1442 | + |
1443 | +#endif /* HMAC_H */ |
1444 | \ No newline at end of file |
1445 | |
1446 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/sha1.h' |
1447 | --- Dependencies/OAuthConsumer.framework/Versions/A/Headers/sha1.h 1970-01-01 00:00:00 +0000 |
1448 | +++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/sha1.h 2013-04-26 15:39:24 +0000 |
1449 | @@ -0,0 +1,13 @@ |
1450 | +#include <sys/types.h> |
1451 | + |
1452 | +// From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c |
1453 | + |
1454 | +typedef struct { |
1455 | + u_int32_t state[5]; |
1456 | + u_int32_t count[2]; |
1457 | + u_int8_t buffer[64]; |
1458 | +} SHA1_CTX; |
1459 | + |
1460 | +extern void SHA1Init(SHA1_CTX* context); |
1461 | +extern void SHA1Update(SHA1_CTX* context, u_int8_t* data, u_int32_t len); |
1462 | +extern void SHA1Final(u_int8_t digest[20], SHA1_CTX* context); |
1463 | |
1464 | === added file 'Dependencies/OAuthConsumer.framework/Versions/A/OAuthConsumer' |
1465 | Binary files Dependencies/OAuthConsumer.framework/Versions/A/OAuthConsumer 1970-01-01 00:00:00 +0000 and Dependencies/OAuthConsumer.framework/Versions/A/OAuthConsumer 2013-04-26 15:39:24 +0000 differ |
1466 | === added symlink 'Dependencies/OAuthConsumer.framework/Versions/Current' |
1467 | === target is u'A' |
1468 | === removed directory 'Dependencies/PullToRefresh' |
1469 | === added directory 'Dependencies/PullToRefresh.framework' |
1470 | === added directory 'Dependencies/PullToRefresh.framework/Headers' |
1471 | === added file 'Dependencies/PullToRefresh.framework/Headers/PullRefreshTableViewController.h' |
1472 | --- Dependencies/PullToRefresh.framework/Headers/PullRefreshTableViewController.h 1970-01-01 00:00:00 +0000 |
1473 | +++ Dependencies/PullToRefresh.framework/Headers/PullRefreshTableViewController.h 2013-04-26 15:39:24 +0000 |
1474 | @@ -0,0 +1,77 @@ |
1475 | +// |
1476 | +// PullRefreshTableViewController.h |
1477 | +// Plancast |
1478 | +// |
1479 | +// Created by Leah Culver on 7/2/10. |
1480 | +// Copyright (c) 2010 Leah Culver |
1481 | +// |
1482 | +// Permission is hereby granted, free of charge, to any person |
1483 | +// obtaining a copy of this software and associated documentation |
1484 | +// files (the "Software"), to deal in the Software without |
1485 | +// restriction, including without limitation the rights to use, |
1486 | +// copy, modify, merge, publish, distribute, sublicense, and/or sell |
1487 | +// copies of the Software, and to permit persons to whom the |
1488 | +// Software is furnished to do so, subject to the following |
1489 | +// conditions: |
1490 | +// |
1491 | +// The above copyright notice and this permission notice shall be |
1492 | +// included in all copies or substantial portions of the Software. |
1493 | +// |
1494 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
1495 | +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
1496 | +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
1497 | +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
1498 | +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
1499 | +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
1500 | +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
1501 | +// OTHER DEALINGS IN THE SOFTWARE. |
1502 | +// |
1503 | + |
1504 | +#import <UIKit/UIKit.h> |
1505 | + |
1506 | + |
1507 | +@interface PullRefreshTableViewController : UITableViewController { |
1508 | + UIView *refreshHeaderView; |
1509 | + UILabel *refreshLabel; |
1510 | + UIImageView *refreshArrow; |
1511 | + UIActivityIndicatorView *refreshSpinner; |
1512 | + BOOL isDragging; |
1513 | + BOOL isLoading; |
1514 | + NSString *textPull; |
1515 | + NSString *textRelease; |
1516 | + NSString *textLoading; |
1517 | +} |
1518 | + |
1519 | +#ifndef PTR_STRONG |
1520 | +#if __has_feature(objc_arc) |
1521 | +#define PTR_STRONG strong |
1522 | +#else |
1523 | +#define PTR_STRONG retain |
1524 | +#endif |
1525 | +#endif |
1526 | + |
1527 | +#ifndef PTR_WEAK |
1528 | +#if __has_feature(objc_arc_weak) |
1529 | +#define PTR_WEAK weak |
1530 | +#elif __has_feature(objc_arc) |
1531 | +#define PTR_WEAK unsafe_unretained |
1532 | +#else |
1533 | +#define PTR_WEAK assign |
1534 | +#endif |
1535 | +#endif |
1536 | + |
1537 | +@property (nonatomic, PTR_STRONG) UIView *refreshHeaderView; |
1538 | +@property (nonatomic, PTR_STRONG) UILabel *refreshLabel; |
1539 | +@property (nonatomic, PTR_STRONG) UIImageView *refreshArrow; |
1540 | +@property (nonatomic, PTR_STRONG) UIActivityIndicatorView *refreshSpinner; |
1541 | +@property (nonatomic, copy) NSString *textPull; |
1542 | +@property (nonatomic, copy) NSString *textRelease; |
1543 | +@property (nonatomic, copy) NSString *textLoading; |
1544 | + |
1545 | +- (void)setupStrings; |
1546 | +- (void)addPullToRefreshHeader; |
1547 | +- (void)startLoading; |
1548 | +- (void)stopLoading; |
1549 | +- (void)refresh; |
1550 | + |
1551 | +@end |
1552 | |
1553 | === added file 'Dependencies/PullToRefresh.framework/PullToRefresh' |
1554 | Binary files Dependencies/PullToRefresh.framework/PullToRefresh 1970-01-01 00:00:00 +0000 and Dependencies/PullToRefresh.framework/PullToRefresh 2013-04-26 15:39:24 +0000 differ |
1555 | === added file 'Dependencies/PullToRefresh.framework/arrow.png' |
1556 | Binary files Dependencies/PullToRefresh.framework/arrow.png 1970-01-01 00:00:00 +0000 and Dependencies/PullToRefresh.framework/arrow.png 2013-04-26 15:39:24 +0000 differ |
1557 | === removed file 'Dependencies/PullToRefresh/.gitignore' |
1558 | --- Dependencies/PullToRefresh/.gitignore 2011-08-31 14:56:30 +0000 |
1559 | +++ Dependencies/PullToRefresh/.gitignore 1970-01-01 00:00:00 +0000 |
1560 | @@ -1,15 +0,0 @@ |
1561 | -# Xcode |
1562 | -build/* |
1563 | -*.pbxuser |
1564 | -!default.pbxuser |
1565 | -*.mode1v3 |
1566 | -!default.mode1v3 |
1567 | -*.mode2v3 |
1568 | -!default.mode2v3 |
1569 | -*.perspectivev3 |
1570 | -!default.perspectivev3 |
1571 | -*.xcworkspace |
1572 | -!default.xcworkspace |
1573 | -xcuserdata |
1574 | -profile |
1575 | -*.moved-aside |
1576 | |
1577 | === removed directory 'Dependencies/PullToRefresh/Classes' |
1578 | === removed file 'Dependencies/PullToRefresh/Classes/DemoTableViewController.h' |
1579 | --- Dependencies/PullToRefresh/Classes/DemoTableViewController.h 2011-08-31 14:56:30 +0000 |
1580 | +++ Dependencies/PullToRefresh/Classes/DemoTableViewController.h 1970-01-01 00:00:00 +0000 |
1581 | @@ -1,16 +0,0 @@ |
1582 | -// |
1583 | -// RootViewController.h |
1584 | -// PullToRefresh |
1585 | -// |
1586 | -// Created by Leah Culver on 7/25/10. |
1587 | -// Copyright Plancast 2010. All rights reserved. |
1588 | -// |
1589 | - |
1590 | -#import <UIKit/UIKit.h> |
1591 | -#import "PullRefreshTableViewController.h" |
1592 | - |
1593 | -@interface DemoTableViewController : PullRefreshTableViewController { |
1594 | - NSMutableArray *items; |
1595 | -} |
1596 | - |
1597 | -@end |
1598 | |
1599 | === removed file 'Dependencies/PullToRefresh/Classes/DemoTableViewController.m' |
1600 | --- Dependencies/PullToRefresh/Classes/DemoTableViewController.m 2011-08-31 14:56:30 +0000 |
1601 | +++ Dependencies/PullToRefresh/Classes/DemoTableViewController.m 1970-01-01 00:00:00 +0000 |
1602 | @@ -1,65 +0,0 @@ |
1603 | -// |
1604 | -// RootViewController.m |
1605 | -// PullToRefresh |
1606 | -// |
1607 | -// Created by Leah Culver on 7/25/10. |
1608 | -// Copyright Plancast 2010. All rights reserved. |
1609 | -// |
1610 | - |
1611 | -#import "DemoTableViewController.h" |
1612 | - |
1613 | - |
1614 | -@implementation DemoTableViewController |
1615 | - |
1616 | -- (void)viewDidLoad { |
1617 | - [super viewDidLoad]; |
1618 | - |
1619 | - self.title = @"Pull to Refresh"; |
1620 | - items = [[NSMutableArray alloc] initWithObjects:@"What time is it?", nil]; |
1621 | -} |
1622 | - |
1623 | -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { |
1624 | - return 1; |
1625 | -} |
1626 | - |
1627 | -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
1628 | - return [items count]; |
1629 | -} |
1630 | - |
1631 | -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
1632 | - |
1633 | - static NSString *CellIdentifier = @"CellIdentifier"; |
1634 | - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; |
1635 | - if (cell == nil) { |
1636 | - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; |
1637 | - } |
1638 | - |
1639 | - cell.textLabel.text = [items objectAtIndex:indexPath.row]; |
1640 | - cell.selectionStyle = UITableViewCellSelectionStyleNone; |
1641 | - |
1642 | - return cell; |
1643 | -} |
1644 | - |
1645 | -- (void)refresh { |
1646 | - [self performSelector:@selector(addItem) withObject:nil afterDelay:2.0]; |
1647 | -} |
1648 | - |
1649 | -- (void)addItem { |
1650 | - // Add a new time |
1651 | - NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; |
1652 | - [dateFormatter setTimeStyle:NSDateFormatterMediumStyle]; |
1653 | - NSString *now = [dateFormatter stringFromDate:[NSDate date]]; |
1654 | - [items insertObject:[NSString stringWithFormat:@"%@", now] atIndex:0]; |
1655 | - |
1656 | - [self.tableView reloadData]; |
1657 | - |
1658 | - [self stopLoading]; |
1659 | -} |
1660 | - |
1661 | -- (void)dealloc { |
1662 | - [items release]; |
1663 | - [super dealloc]; |
1664 | -} |
1665 | - |
1666 | -@end |
1667 | - |
1668 | |
1669 | === removed file 'Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.h' |
1670 | --- Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.h 2011-08-31 14:56:30 +0000 |
1671 | +++ Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.h 1970-01-01 00:00:00 +0000 |
1672 | @@ -1,59 +0,0 @@ |
1673 | -// |
1674 | -// PullRefreshTableViewController.h |
1675 | -// Plancast |
1676 | -// |
1677 | -// Created by Leah Culver on 7/2/10. |
1678 | -// Copyright (c) 2010 Leah Culver |
1679 | -// |
1680 | -// Permission is hereby granted, free of charge, to any person |
1681 | -// obtaining a copy of this software and associated documentation |
1682 | -// files (the "Software"), to deal in the Software without |
1683 | -// restriction, including without limitation the rights to use, |
1684 | -// copy, modify, merge, publish, distribute, sublicense, and/or sell |
1685 | -// copies of the Software, and to permit persons to whom the |
1686 | -// Software is furnished to do so, subject to the following |
1687 | -// conditions: |
1688 | -// |
1689 | -// The above copyright notice and this permission notice shall be |
1690 | -// included in all copies or substantial portions of the Software. |
1691 | -// |
1692 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
1693 | -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
1694 | -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
1695 | -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
1696 | -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
1697 | -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
1698 | -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
1699 | -// OTHER DEALINGS IN THE SOFTWARE. |
1700 | -// |
1701 | - |
1702 | -#import <UIKit/UIKit.h> |
1703 | - |
1704 | - |
1705 | -@interface PullRefreshTableViewController : UITableViewController { |
1706 | - UIView *refreshHeaderView; |
1707 | - UILabel *refreshLabel; |
1708 | - UIImageView *refreshArrow; |
1709 | - UIActivityIndicatorView *refreshSpinner; |
1710 | - BOOL isDragging; |
1711 | - BOOL isLoading; |
1712 | - NSString *textPull; |
1713 | - NSString *textRelease; |
1714 | - NSString *textLoading; |
1715 | -} |
1716 | - |
1717 | -@property (nonatomic, retain) UIView *refreshHeaderView; |
1718 | -@property (nonatomic, retain) UILabel *refreshLabel; |
1719 | -@property (nonatomic, retain) UIImageView *refreshArrow; |
1720 | -@property (nonatomic, retain) UIActivityIndicatorView *refreshSpinner; |
1721 | -@property (nonatomic, copy) NSString *textPull; |
1722 | -@property (nonatomic, copy) NSString *textRelease; |
1723 | -@property (nonatomic, copy) NSString *textLoading; |
1724 | - |
1725 | -- (void)setupStrings; |
1726 | -- (void)addPullToRefreshHeader; |
1727 | -- (void)startLoading; |
1728 | -- (void)stopLoading; |
1729 | -- (void)refresh; |
1730 | - |
1731 | -@end |
1732 | |
1733 | === removed file 'Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.m' |
1734 | --- Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.m 2011-08-31 14:56:30 +0000 |
1735 | +++ Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.m 1970-01-01 00:00:00 +0000 |
1736 | @@ -1,188 +0,0 @@ |
1737 | -// |
1738 | -// PullRefreshTableViewController.m |
1739 | -// Plancast |
1740 | -// |
1741 | -// Created by Leah Culver on 7/2/10. |
1742 | -// Copyright (c) 2010 Leah Culver |
1743 | -// |
1744 | -// Permission is hereby granted, free of charge, to any person |
1745 | -// obtaining a copy of this software and associated documentation |
1746 | -// files (the "Software"), to deal in the Software without |
1747 | -// restriction, including without limitation the rights to use, |
1748 | -// copy, modify, merge, publish, distribute, sublicense, and/or sell |
1749 | -// copies of the Software, and to permit persons to whom the |
1750 | -// Software is furnished to do so, subject to the following |
1751 | -// conditions: |
1752 | -// |
1753 | -// The above copyright notice and this permission notice shall be |
1754 | -// included in all copies or substantial portions of the Software. |
1755 | -// |
1756 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
1757 | -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
1758 | -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
1759 | -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
1760 | -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
1761 | -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
1762 | -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
1763 | -// OTHER DEALINGS IN THE SOFTWARE. |
1764 | -// |
1765 | - |
1766 | -#import <QuartzCore/QuartzCore.h> |
1767 | -#import "PullRefreshTableViewController.h" |
1768 | - |
1769 | -#define REFRESH_HEADER_HEIGHT 52.0f |
1770 | - |
1771 | - |
1772 | -@implementation PullRefreshTableViewController |
1773 | - |
1774 | -@synthesize textPull, textRelease, textLoading, refreshHeaderView, refreshLabel, refreshArrow, refreshSpinner; |
1775 | - |
1776 | -- (id)initWithStyle:(UITableViewStyle)style { |
1777 | - self = [super initWithStyle:style]; |
1778 | - if (self != nil) { |
1779 | - [self setupStrings]; |
1780 | - } |
1781 | - return self; |
1782 | -} |
1783 | - |
1784 | -- (id)initWithCoder:(NSCoder *)aDecoder { |
1785 | - self = [super initWithCoder:aDecoder]; |
1786 | - if (self != nil) { |
1787 | - [self setupStrings]; |
1788 | - } |
1789 | - return self; |
1790 | -} |
1791 | - |
1792 | -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { |
1793 | - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; |
1794 | - if (self != nil) { |
1795 | - [self setupStrings]; |
1796 | - } |
1797 | - return self; |
1798 | -} |
1799 | - |
1800 | -- (void)viewDidLoad { |
1801 | - [super viewDidLoad]; |
1802 | - [self addPullToRefreshHeader]; |
1803 | -} |
1804 | - |
1805 | -- (void)setupStrings{ |
1806 | - textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."]; |
1807 | - textRelease = [[NSString alloc] initWithString:@"Release to refresh..."]; |
1808 | - textLoading = [[NSString alloc] initWithString:@"Loading..."]; |
1809 | -} |
1810 | - |
1811 | -- (void)addPullToRefreshHeader { |
1812 | - refreshHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 - REFRESH_HEADER_HEIGHT, 320, REFRESH_HEADER_HEIGHT)]; |
1813 | - refreshHeaderView.backgroundColor = [UIColor clearColor]; |
1814 | - |
1815 | - refreshLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, REFRESH_HEADER_HEIGHT)]; |
1816 | - refreshLabel.backgroundColor = [UIColor clearColor]; |
1817 | - refreshLabel.font = [UIFont boldSystemFontOfSize:12.0]; |
1818 | - refreshLabel.textAlignment = UITextAlignmentCenter; |
1819 | - |
1820 | - refreshArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]]; |
1821 | - refreshArrow.frame = CGRectMake(floorf((REFRESH_HEADER_HEIGHT - 27) / 2), |
1822 | - (floorf(REFRESH_HEADER_HEIGHT - 44) / 2), |
1823 | - 27, 44); |
1824 | - |
1825 | - refreshSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; |
1826 | - refreshSpinner.frame = CGRectMake(floorf(floorf(REFRESH_HEADER_HEIGHT - 20) / 2), floorf((REFRESH_HEADER_HEIGHT - 20) / 2), 20, 20); |
1827 | - refreshSpinner.hidesWhenStopped = YES; |
1828 | - |
1829 | - [refreshHeaderView addSubview:refreshLabel]; |
1830 | - [refreshHeaderView addSubview:refreshArrow]; |
1831 | - [refreshHeaderView addSubview:refreshSpinner]; |
1832 | - [self.tableView addSubview:refreshHeaderView]; |
1833 | -} |
1834 | - |
1835 | -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { |
1836 | - if (isLoading) return; |
1837 | - isDragging = YES; |
1838 | -} |
1839 | - |
1840 | -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { |
1841 | - if (isLoading) { |
1842 | - // Update the content inset, good for section headers |
1843 | - if (scrollView.contentOffset.y > 0) |
1844 | - self.tableView.contentInset = UIEdgeInsetsZero; |
1845 | - else if (scrollView.contentOffset.y >= -REFRESH_HEADER_HEIGHT) |
1846 | - self.tableView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0); |
1847 | - } else if (isDragging && scrollView.contentOffset.y < 0) { |
1848 | - // Update the arrow direction and label |
1849 | - [UIView beginAnimations:nil context:NULL]; |
1850 | - if (scrollView.contentOffset.y < -REFRESH_HEADER_HEIGHT) { |
1851 | - // User is scrolling above the header |
1852 | - refreshLabel.text = self.textRelease; |
1853 | - [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI, 0, 0, 1); |
1854 | - } else { // User is scrolling somewhere within the header |
1855 | - refreshLabel.text = self.textPull; |
1856 | - [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1); |
1857 | - } |
1858 | - [UIView commitAnimations]; |
1859 | - } |
1860 | -} |
1861 | - |
1862 | -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { |
1863 | - if (isLoading) return; |
1864 | - isDragging = NO; |
1865 | - if (scrollView.contentOffset.y <= -REFRESH_HEADER_HEIGHT) { |
1866 | - // Released above the header |
1867 | - [self startLoading]; |
1868 | - } |
1869 | -} |
1870 | - |
1871 | -- (void)startLoading { |
1872 | - isLoading = YES; |
1873 | - |
1874 | - // Show the header |
1875 | - [UIView beginAnimations:nil context:NULL]; |
1876 | - [UIView setAnimationDuration:0.3]; |
1877 | - self.tableView.contentInset = UIEdgeInsetsMake(REFRESH_HEADER_HEIGHT, 0, 0, 0); |
1878 | - refreshLabel.text = self.textLoading; |
1879 | - refreshArrow.hidden = YES; |
1880 | - [refreshSpinner startAnimating]; |
1881 | - [UIView commitAnimations]; |
1882 | - |
1883 | - // Refresh action! |
1884 | - [self refresh]; |
1885 | -} |
1886 | - |
1887 | -- (void)stopLoading { |
1888 | - isLoading = NO; |
1889 | - |
1890 | - // Hide the header |
1891 | - [UIView beginAnimations:nil context:NULL]; |
1892 | - [UIView setAnimationDelegate:self]; |
1893 | - [UIView setAnimationDuration:0.3]; |
1894 | - [UIView setAnimationDidStopSelector:@selector(stopLoadingComplete:finished:context:)]; |
1895 | - self.tableView.contentInset = UIEdgeInsetsZero; |
1896 | - [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1); |
1897 | - [UIView commitAnimations]; |
1898 | -} |
1899 | - |
1900 | -- (void)stopLoadingComplete:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { |
1901 | - // Reset the header |
1902 | - refreshLabel.text = self.textPull; |
1903 | - refreshArrow.hidden = NO; |
1904 | - [refreshSpinner stopAnimating]; |
1905 | -} |
1906 | - |
1907 | -- (void)refresh { |
1908 | - // This is just a demo. Override this method with your custom reload action. |
1909 | - // Don't forget to call stopLoading at the end. |
1910 | - [self performSelector:@selector(stopLoading) withObject:nil afterDelay:2.0]; |
1911 | -} |
1912 | - |
1913 | -- (void)dealloc { |
1914 | - [refreshHeaderView release]; |
1915 | - [refreshLabel release]; |
1916 | - [refreshArrow release]; |
1917 | - [refreshSpinner release]; |
1918 | - [textPull release]; |
1919 | - [textRelease release]; |
1920 | - [textLoading release]; |
1921 | - [super dealloc]; |
1922 | -} |
1923 | - |
1924 | -@end |
1925 | |
1926 | === removed file 'Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.h' |
1927 | --- Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.h 2011-08-31 14:56:30 +0000 |
1928 | +++ Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.h 1970-01-01 00:00:00 +0000 |
1929 | @@ -1,20 +0,0 @@ |
1930 | -// |
1931 | -// PullToRefreshAppDelegate.h |
1932 | -// PullToRefresh |
1933 | -// |
1934 | -// Created by Leah Culver on 7/25/10. |
1935 | -// Copyright Plancast 2010. All rights reserved. |
1936 | -// |
1937 | - |
1938 | -#import <UIKit/UIKit.h> |
1939 | - |
1940 | -@interface PullToRefreshAppDelegate : NSObject <UIApplicationDelegate> { |
1941 | - UIWindow *window; |
1942 | - UINavigationController *navigationController; |
1943 | -} |
1944 | - |
1945 | -@property (nonatomic, retain) UIWindow *window; |
1946 | -@property (nonatomic, retain) UINavigationController *navigationController; |
1947 | - |
1948 | -@end |
1949 | - |
1950 | |
1951 | === removed file 'Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.m' |
1952 | --- Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.m 2011-08-31 14:56:30 +0000 |
1953 | +++ Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.m 1970-01-01 00:00:00 +0000 |
1954 | @@ -1,41 +0,0 @@ |
1955 | -// |
1956 | -// PullToRefreshAppDelegate.m |
1957 | -// PullToRefresh |
1958 | -// |
1959 | -// Created by Leah Culver on 7/25/10. |
1960 | -// Copyright Plancast 2010. All rights reserved. |
1961 | -// |
1962 | - |
1963 | -#import "PullToRefreshAppDelegate.h" |
1964 | -#import "DemoTableViewController.h" |
1965 | - |
1966 | - |
1967 | -@implementation PullToRefreshAppDelegate |
1968 | - |
1969 | -@synthesize window; |
1970 | -@synthesize navigationController; |
1971 | - |
1972 | - |
1973 | -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { |
1974 | - |
1975 | - CGRect screenBounds = [[UIScreen mainScreen] bounds]; |
1976 | - self.window = [[[UIWindow alloc] initWithFrame: screenBounds] autorelease]; |
1977 | - |
1978 | - DemoTableViewController *demoTableViewController = [[[DemoTableViewController alloc] init] autorelease]; |
1979 | - navigationController = [[UINavigationController alloc] initWithRootViewController:demoTableViewController]; |
1980 | - |
1981 | - [window addSubview:navigationController.view]; |
1982 | - [window makeKeyAndVisible]; |
1983 | - |
1984 | - return YES; |
1985 | -} |
1986 | - |
1987 | -- (void)dealloc { |
1988 | - [navigationController release]; |
1989 | - [window release]; |
1990 | - [super dealloc]; |
1991 | -} |
1992 | - |
1993 | - |
1994 | -@end |
1995 | - |
1996 | |
1997 | === removed file 'Dependencies/PullToRefresh/LICENSE' |
1998 | --- Dependencies/PullToRefresh/LICENSE 2011-08-31 14:56:30 +0000 |
1999 | +++ Dependencies/PullToRefresh/LICENSE 1970-01-01 00:00:00 +0000 |
2000 | @@ -1,20 +0,0 @@ |
2001 | -Copyright (c) 2010 Leah Culver |
2002 | - |
2003 | -Permission is hereby granted, free of charge, to any person obtaining |
2004 | -a copy of this software and associated documentation files (the |
2005 | -"Software"), to deal in the Software without restriction, including |
2006 | -without limitation the rights to use, copy, modify, merge, publish, |
2007 | -distribute, sublicense, and/or sell copies of the Software, and to |
2008 | -permit persons to whom the Software is furnished to do so, subject to |
2009 | -the following conditions: |
2010 | - |
2011 | -The above copyright notice and this permission notice shall be |
2012 | -included in all copies or substantial portions of the Software. |
2013 | - |
2014 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
2015 | -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
2016 | -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
2017 | -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
2018 | -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
2019 | -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
2020 | -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
2021 | |
2022 | === removed file 'Dependencies/PullToRefresh/PullToRefresh-Info.plist' |
2023 | --- Dependencies/PullToRefresh/PullToRefresh-Info.plist 2011-08-31 14:56:30 +0000 |
2024 | +++ Dependencies/PullToRefresh/PullToRefresh-Info.plist 1970-01-01 00:00:00 +0000 |
2025 | @@ -1,28 +0,0 @@ |
2026 | -<?xml version="1.0" encoding="UTF-8"?> |
2027 | -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
2028 | -<plist version="1.0"> |
2029 | -<dict> |
2030 | - <key>CFBundleDevelopmentRegion</key> |
2031 | - <string>English</string> |
2032 | - <key>CFBundleDisplayName</key> |
2033 | - <string>${PRODUCT_NAME}</string> |
2034 | - <key>CFBundleExecutable</key> |
2035 | - <string>${EXECUTABLE_NAME}</string> |
2036 | - <key>CFBundleIconFile</key> |
2037 | - <string></string> |
2038 | - <key>CFBundleIdentifier</key> |
2039 | - <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string> |
2040 | - <key>CFBundleInfoDictionaryVersion</key> |
2041 | - <string>6.0</string> |
2042 | - <key>CFBundleName</key> |
2043 | - <string>${PRODUCT_NAME}</string> |
2044 | - <key>CFBundlePackageType</key> |
2045 | - <string>APPL</string> |
2046 | - <key>CFBundleSignature</key> |
2047 | - <string>????</string> |
2048 | - <key>CFBundleVersion</key> |
2049 | - <string>1.0</string> |
2050 | - <key>LSRequiresIPhoneOS</key> |
2051 | - <true/> |
2052 | -</dict> |
2053 | -</plist> |
2054 | |
2055 | === removed directory 'Dependencies/PullToRefresh/PullToRefresh.xcodeproj' |
2056 | === removed file 'Dependencies/PullToRefresh/PullToRefresh.xcodeproj/project.pbxproj' |
2057 | --- Dependencies/PullToRefresh/PullToRefresh.xcodeproj/project.pbxproj 2011-08-31 14:56:30 +0000 |
2058 | +++ Dependencies/PullToRefresh/PullToRefresh.xcodeproj/project.pbxproj 1970-01-01 00:00:00 +0000 |
2059 | @@ -1,268 +0,0 @@ |
2060 | -// !$*UTF8*$! |
2061 | -{ |
2062 | - archiveVersion = 1; |
2063 | - classes = { |
2064 | - }; |
2065 | - objectVersion = 45; |
2066 | - objects = { |
2067 | - |
2068 | -/* Begin PBXBuildFile section */ |
2069 | - 1D3623260D0F684500981E51 /* PullToRefreshAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* PullToRefreshAppDelegate.m */; }; |
2070 | - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; |
2071 | - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; |
2072 | - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; |
2073 | - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; |
2074 | - 28C286E10D94DF7D0034E888 /* DemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */; }; |
2075 | - 4CAFBC8011FC96FC00651784 /* PullRefreshTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */; }; |
2076 | - 4CAFBCEF11FC994F00651784 /* README.markdown in Resources */ = {isa = PBXBuildFile; fileRef = 4CAFBCEE11FC994F00651784 /* README.markdown */; }; |
2077 | - 4CAFBD0111FC9B2100651784 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */; }; |
2078 | - 4CBE3BEE11FE21CB007696B3 /* arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CBE3BED11FE21CB007696B3 /* arrow.png */; }; |
2079 | -/* End PBXBuildFile section */ |
2080 | - |
2081 | -/* Begin PBXFileReference section */ |
2082 | - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; |
2083 | - 1D3623240D0F684500981E51 /* PullToRefreshAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullToRefreshAppDelegate.h; sourceTree = "<group>"; }; |
2084 | - 1D3623250D0F684500981E51 /* PullToRefreshAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PullToRefreshAppDelegate.m; sourceTree = "<group>"; }; |
2085 | - 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PullToRefresh.app; sourceTree = BUILT_PRODUCTS_DIR; }; |
2086 | - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; |
2087 | - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; |
2088 | - 28A0AAE50D9B0CCF005BE974 /* PullToRefresh_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullToRefresh_Prefix.pch; sourceTree = "<group>"; }; |
2089 | - 28C286DF0D94DF7D0034E888 /* DemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoTableViewController.h; sourceTree = "<group>"; }; |
2090 | - 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoTableViewController.m; sourceTree = "<group>"; }; |
2091 | - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; |
2092 | - 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullRefreshTableViewController.h; sourceTree = "<group>"; }; |
2093 | - 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PullRefreshTableViewController.m; sourceTree = "<group>"; }; |
2094 | - 4CAFBCEE11FC994F00651784 /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.markdown; sourceTree = "<group>"; }; |
2095 | - 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; |
2096 | - 4CBE3BED11FE21CB007696B3 /* arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow.png; sourceTree = "<group>"; }; |
2097 | - 8D1107310486CEB800E47090 /* PullToRefresh-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "PullToRefresh-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; }; |
2098 | -/* End PBXFileReference section */ |
2099 | - |
2100 | -/* Begin PBXFrameworksBuildPhase section */ |
2101 | - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { |
2102 | - isa = PBXFrameworksBuildPhase; |
2103 | - buildActionMask = 2147483647; |
2104 | - files = ( |
2105 | - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, |
2106 | - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, |
2107 | - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, |
2108 | - 4CAFBD0111FC9B2100651784 /* QuartzCore.framework in Frameworks */, |
2109 | - ); |
2110 | - runOnlyForDeploymentPostprocessing = 0; |
2111 | - }; |
2112 | -/* End PBXFrameworksBuildPhase section */ |
2113 | - |
2114 | -/* Begin PBXGroup section */ |
2115 | - 080E96DDFE201D6D7F000001 /* Classes */ = { |
2116 | - isa = PBXGroup; |
2117 | - children = ( |
2118 | - 1D3623240D0F684500981E51 /* PullToRefreshAppDelegate.h */, |
2119 | - 1D3623250D0F684500981E51 /* PullToRefreshAppDelegate.m */, |
2120 | - 28C286DF0D94DF7D0034E888 /* DemoTableViewController.h */, |
2121 | - 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */, |
2122 | - 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */, |
2123 | - 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */, |
2124 | - ); |
2125 | - path = Classes; |
2126 | - sourceTree = "<group>"; |
2127 | - }; |
2128 | - 19C28FACFE9D520D11CA2CBB /* Products */ = { |
2129 | - isa = PBXGroup; |
2130 | - children = ( |
2131 | - 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */, |
2132 | - ); |
2133 | - name = Products; |
2134 | - sourceTree = "<group>"; |
2135 | - }; |
2136 | - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { |
2137 | - isa = PBXGroup; |
2138 | - children = ( |
2139 | - 080E96DDFE201D6D7F000001 /* Classes */, |
2140 | - 29B97315FDCFA39411CA2CEA /* Other Sources */, |
2141 | - 29B97317FDCFA39411CA2CEA /* Resources */, |
2142 | - 29B97323FDCFA39411CA2CEA /* Frameworks */, |
2143 | - 19C28FACFE9D520D11CA2CBB /* Products */, |
2144 | - ); |
2145 | - name = CustomTemplate; |
2146 | - sourceTree = "<group>"; |
2147 | - }; |
2148 | - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { |
2149 | - isa = PBXGroup; |
2150 | - children = ( |
2151 | - 28A0AAE50D9B0CCF005BE974 /* PullToRefresh_Prefix.pch */, |
2152 | - 29B97316FDCFA39411CA2CEA /* main.m */, |
2153 | - ); |
2154 | - name = "Other Sources"; |
2155 | - sourceTree = "<group>"; |
2156 | - }; |
2157 | - 29B97317FDCFA39411CA2CEA /* Resources */ = { |
2158 | - isa = PBXGroup; |
2159 | - children = ( |
2160 | - 4CBE3BED11FE21CB007696B3 /* arrow.png */, |
2161 | - 4CAFBCEE11FC994F00651784 /* README.markdown */, |
2162 | - 8D1107310486CEB800E47090 /* PullToRefresh-Info.plist */, |
2163 | - ); |
2164 | - name = Resources; |
2165 | - sourceTree = "<group>"; |
2166 | - }; |
2167 | - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { |
2168 | - isa = PBXGroup; |
2169 | - children = ( |
2170 | - 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */, |
2171 | - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, |
2172 | - 1D30AB110D05D00D00671497 /* Foundation.framework */, |
2173 | - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, |
2174 | - ); |
2175 | - name = Frameworks; |
2176 | - sourceTree = "<group>"; |
2177 | - }; |
2178 | -/* End PBXGroup section */ |
2179 | - |
2180 | -/* Begin PBXNativeTarget section */ |
2181 | - 1D6058900D05DD3D006BFB54 /* PullToRefresh */ = { |
2182 | - isa = PBXNativeTarget; |
2183 | - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh" */; |
2184 | - buildPhases = ( |
2185 | - 1D60588D0D05DD3D006BFB54 /* Resources */, |
2186 | - 1D60588E0D05DD3D006BFB54 /* Sources */, |
2187 | - 1D60588F0D05DD3D006BFB54 /* Frameworks */, |
2188 | - ); |
2189 | - buildRules = ( |
2190 | - ); |
2191 | - dependencies = ( |
2192 | - ); |
2193 | - name = PullToRefresh; |
2194 | - productName = PullToRefresh; |
2195 | - productReference = 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */; |
2196 | - productType = "com.apple.product-type.application"; |
2197 | - }; |
2198 | -/* End PBXNativeTarget section */ |
2199 | - |
2200 | -/* Begin PBXProject section */ |
2201 | - 29B97313FDCFA39411CA2CEA /* Project object */ = { |
2202 | - isa = PBXProject; |
2203 | - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PullToRefresh" */; |
2204 | - compatibilityVersion = "Xcode 3.1"; |
2205 | - hasScannedForEncodings = 1; |
2206 | - knownRegions = ( |
2207 | - English, |
2208 | - Japanese, |
2209 | - French, |
2210 | - German, |
2211 | - en, |
2212 | - ); |
2213 | - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; |
2214 | - projectDirPath = ""; |
2215 | - projectRoot = ""; |
2216 | - targets = ( |
2217 | - 1D6058900D05DD3D006BFB54 /* PullToRefresh */, |
2218 | - ); |
2219 | - }; |
2220 | -/* End PBXProject section */ |
2221 | - |
2222 | -/* Begin PBXResourcesBuildPhase section */ |
2223 | - 1D60588D0D05DD3D006BFB54 /* Resources */ = { |
2224 | - isa = PBXResourcesBuildPhase; |
2225 | - buildActionMask = 2147483647; |
2226 | - files = ( |
2227 | - 4CAFBCEF11FC994F00651784 /* README.markdown in Resources */, |
2228 | - 4CBE3BEE11FE21CB007696B3 /* arrow.png in Resources */, |
2229 | - ); |
2230 | - runOnlyForDeploymentPostprocessing = 0; |
2231 | - }; |
2232 | -/* End PBXResourcesBuildPhase section */ |
2233 | - |
2234 | -/* Begin PBXSourcesBuildPhase section */ |
2235 | - 1D60588E0D05DD3D006BFB54 /* Sources */ = { |
2236 | - isa = PBXSourcesBuildPhase; |
2237 | - buildActionMask = 2147483647; |
2238 | - files = ( |
2239 | - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, |
2240 | - 1D3623260D0F684500981E51 /* PullToRefreshAppDelegate.m in Sources */, |
2241 | - 28C286E10D94DF7D0034E888 /* DemoTableViewController.m in Sources */, |
2242 | - 4CAFBC8011FC96FC00651784 /* PullRefreshTableViewController.m in Sources */, |
2243 | - ); |
2244 | - runOnlyForDeploymentPostprocessing = 0; |
2245 | - }; |
2246 | -/* End PBXSourcesBuildPhase section */ |
2247 | - |
2248 | -/* Begin XCBuildConfiguration section */ |
2249 | - 1D6058940D05DD3E006BFB54 /* Debug */ = { |
2250 | - isa = XCBuildConfiguration; |
2251 | - buildSettings = { |
2252 | - ALWAYS_SEARCH_USER_PATHS = NO; |
2253 | - COPY_PHASE_STRIP = NO; |
2254 | - GCC_DYNAMIC_NO_PIC = NO; |
2255 | - GCC_OPTIMIZATION_LEVEL = 0; |
2256 | - GCC_PRECOMPILE_PREFIX_HEADER = YES; |
2257 | - GCC_PREFIX_HEADER = PullToRefresh_Prefix.pch; |
2258 | - INFOPLIST_FILE = "PullToRefresh-Info.plist"; |
2259 | - PRODUCT_NAME = PullToRefresh; |
2260 | - }; |
2261 | - name = Debug; |
2262 | - }; |
2263 | - 1D6058950D05DD3E006BFB54 /* Release */ = { |
2264 | - isa = XCBuildConfiguration; |
2265 | - buildSettings = { |
2266 | - ALWAYS_SEARCH_USER_PATHS = NO; |
2267 | - COPY_PHASE_STRIP = YES; |
2268 | - GCC_PRECOMPILE_PREFIX_HEADER = YES; |
2269 | - GCC_PREFIX_HEADER = PullToRefresh_Prefix.pch; |
2270 | - INFOPLIST_FILE = "PullToRefresh-Info.plist"; |
2271 | - PRODUCT_NAME = PullToRefresh; |
2272 | - VALIDATE_PRODUCT = YES; |
2273 | - }; |
2274 | - name = Release; |
2275 | - }; |
2276 | - C01FCF4F08A954540054247B /* Debug */ = { |
2277 | - isa = XCBuildConfiguration; |
2278 | - buildSettings = { |
2279 | - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; |
2280 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
2281 | - GCC_C_LANGUAGE_STANDARD = c99; |
2282 | - GCC_WARN_ABOUT_RETURN_TYPE = YES; |
2283 | - GCC_WARN_UNUSED_VARIABLE = YES; |
2284 | - PREBINDING = NO; |
2285 | - SDKROOT = iphoneos4.0; |
2286 | - }; |
2287 | - name = Debug; |
2288 | - }; |
2289 | - C01FCF5008A954540054247B /* Release */ = { |
2290 | - isa = XCBuildConfiguration; |
2291 | - buildSettings = { |
2292 | - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; |
2293 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
2294 | - GCC_C_LANGUAGE_STANDARD = c99; |
2295 | - GCC_WARN_ABOUT_RETURN_TYPE = YES; |
2296 | - GCC_WARN_UNUSED_VARIABLE = YES; |
2297 | - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; |
2298 | - PREBINDING = NO; |
2299 | - SDKROOT = iphoneos4.0; |
2300 | - }; |
2301 | - name = Release; |
2302 | - }; |
2303 | -/* End XCBuildConfiguration section */ |
2304 | - |
2305 | -/* Begin XCConfigurationList section */ |
2306 | - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh" */ = { |
2307 | - isa = XCConfigurationList; |
2308 | - buildConfigurations = ( |
2309 | - 1D6058940D05DD3E006BFB54 /* Debug */, |
2310 | - 1D6058950D05DD3E006BFB54 /* Release */, |
2311 | - ); |
2312 | - defaultConfigurationIsVisible = 0; |
2313 | - defaultConfigurationName = Release; |
2314 | - }; |
2315 | - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PullToRefresh" */ = { |
2316 | - isa = XCConfigurationList; |
2317 | - buildConfigurations = ( |
2318 | - C01FCF4F08A954540054247B /* Debug */, |
2319 | - C01FCF5008A954540054247B /* Release */, |
2320 | - ); |
2321 | - defaultConfigurationIsVisible = 0; |
2322 | - defaultConfigurationName = Release; |
2323 | - }; |
2324 | -/* End XCConfigurationList section */ |
2325 | - }; |
2326 | - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; |
2327 | -} |
2328 | |
2329 | === removed file 'Dependencies/PullToRefresh/PullToRefresh_Prefix.pch' |
2330 | --- Dependencies/PullToRefresh/PullToRefresh_Prefix.pch 2011-08-31 14:56:30 +0000 |
2331 | +++ Dependencies/PullToRefresh/PullToRefresh_Prefix.pch 1970-01-01 00:00:00 +0000 |
2332 | @@ -1,14 +0,0 @@ |
2333 | -// |
2334 | -// Prefix header for all source files of the 'PullToRefresh' target in the 'PullToRefresh' project |
2335 | -// |
2336 | -#import <Availability.h> |
2337 | - |
2338 | -#ifndef __IPHONE_3_0 |
2339 | -#warning "This project uses features only available in iPhone SDK 3.0 and later." |
2340 | -#endif |
2341 | - |
2342 | - |
2343 | -#ifdef __OBJC__ |
2344 | - #import <Foundation/Foundation.h> |
2345 | - #import <UIKit/UIKit.h> |
2346 | -#endif |
2347 | |
2348 | === removed file 'Dependencies/PullToRefresh/README.markdown' |
2349 | --- Dependencies/PullToRefresh/README.markdown 2011-08-31 14:56:30 +0000 |
2350 | +++ Dependencies/PullToRefresh/README.markdown 1970-01-01 00:00:00 +0000 |
2351 | @@ -1,27 +0,0 @@ |
2352 | -PullToRefresh |
2353 | - |
2354 | -A simple iPhone TableViewController for adding pull-to-refresh functionality. |
2355 | - |
2356 | -![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-1.png) |
2357 | -![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-2.png) |
2358 | -![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-3.png) |
2359 | -![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-4.png) |
2360 | - |
2361 | -Inspired by [Tweetie 2](http://www.atebits.com/tweetie-iphone/), [Oliver Drobnik's blog post](http://www.drobnik.com/touch/2009/12/how-to-make-a-pull-to-reload-tableview-just-like-tweetie-2/) |
2362 | -and [EGOTableViewPullRefresh](http://github.com/enormego/EGOTableViewPullRefresh). |
2363 | - |
2364 | - |
2365 | -How to intall |
2366 | - |
2367 | -1. Copy the files, [PullRefreshTableViewController.h](http://github.com/leah/PullToRefresh/raw/master/Classes/PullRefreshTableViewController.h), |
2368 | -[PullRefreshTableViewController.m](http://github.com/leah/PullToRefresh/blob/master/Classes/PullRefreshTableViewController.m), |
2369 | -and [arrow.png](http://github.com/leah/PullToRefresh/raw/master/arrow.png) into your project. |
2370 | - |
2371 | -2. Link against the QuartzCore framework (used for rotating the arrow image). |
2372 | - |
2373 | -3. Create a TableViewController that is a subclass of PullRefreshTableViewController. |
2374 | - |
2375 | -4. Customize by adding your own refresh() method. |
2376 | - |
2377 | - |
2378 | -Enjoy! |
2379 | |
2380 | === removed file 'Dependencies/PullToRefresh/arrow.png' |
2381 | Binary files Dependencies/PullToRefresh/arrow.png 2011-08-31 14:56:30 +0000 and Dependencies/PullToRefresh/arrow.png 1970-01-01 00:00:00 +0000 differ |
2382 | === removed file 'Dependencies/PullToRefresh/main.m' |
2383 | --- Dependencies/PullToRefresh/main.m 2011-08-31 14:56:30 +0000 |
2384 | +++ Dependencies/PullToRefresh/main.m 1970-01-01 00:00:00 +0000 |
2385 | @@ -1,17 +0,0 @@ |
2386 | -// |
2387 | -// main.m |
2388 | -// PullToRefresh |
2389 | -// |
2390 | -// Created by Leah Culver on 7/25/10. |
2391 | -// Copyright __MyCompanyName__ 2010. All rights reserved. |
2392 | -// |
2393 | - |
2394 | -#import <UIKit/UIKit.h> |
2395 | - |
2396 | -int main(int argc, char *argv[]) { |
2397 | - |
2398 | - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; |
2399 | - int retVal = UIApplicationMain(argc, argv, nil, @"PullToRefreshAppDelegate"); |
2400 | - [pool release]; |
2401 | - return retVal; |
2402 | -} |
2403 | |
2404 | === removed file 'Dependencies/RIButtonItem.h' |
2405 | --- Dependencies/RIButtonItem.h 2011-10-31 17:16:15 +0000 |
2406 | +++ Dependencies/RIButtonItem.h 1970-01-01 00:00:00 +0000 |
2407 | @@ -1,23 +0,0 @@ |
2408 | -// |
2409 | -// RIButtonItem.h |
2410 | -// Shibui |
2411 | -// |
2412 | -// Created by Jiva DeVoe on 1/12/11. |
2413 | -// Copyright 2011 Random Ideas, LLC. All rights reserved. |
2414 | -// |
2415 | - |
2416 | -#import <Foundation/Foundation.h> |
2417 | - |
2418 | -typedef void (^RISimpleAction)(); |
2419 | - |
2420 | -@interface RIButtonItem : NSObject |
2421 | -{ |
2422 | - NSString *label; |
2423 | - RISimpleAction action; |
2424 | -} |
2425 | -@property (retain, nonatomic) NSString *label; |
2426 | -@property (copy, nonatomic) RISimpleAction action; |
2427 | -+(id)item; |
2428 | -+(id)itemWithLabel:(NSString *)inLabel; |
2429 | -@end |
2430 | - |
2431 | |
2432 | === removed file 'Dependencies/RIButtonItem.m' |
2433 | --- Dependencies/RIButtonItem.m 2011-12-12 17:32:18 +0000 |
2434 | +++ Dependencies/RIButtonItem.m 1970-01-01 00:00:00 +0000 |
2435 | @@ -1,35 +0,0 @@ |
2436 | -// |
2437 | -// RIButtonItem.m |
2438 | -// Shibui |
2439 | -// |
2440 | -// Created by Jiva DeVoe on 1/12/11. |
2441 | -// Copyright 2011 Random Ideas, LLC. All rights reserved. |
2442 | -// |
2443 | - |
2444 | -#import "RIButtonItem.h" |
2445 | - |
2446 | -@implementation RIButtonItem |
2447 | -@synthesize label; |
2448 | -@synthesize action; |
2449 | - |
2450 | -+(id)item |
2451 | -{ |
2452 | - return [[self new] autorelease]; |
2453 | -} |
2454 | - |
2455 | -+(id)itemWithLabel:(NSString *)inLabel |
2456 | -{ |
2457 | - id newItem = [self item]; |
2458 | - [newItem setLabel:inLabel]; |
2459 | - return newItem; |
2460 | -} |
2461 | - |
2462 | -- (void)dealloc; |
2463 | -{ |
2464 | - [label release]; |
2465 | - [action release]; |
2466 | - [super dealloc]; |
2467 | -} |
2468 | - |
2469 | -@end |
2470 | - |
2471 | |
2472 | === modified file 'Dependencies/Reachability/Reachability.h' (properties changed: -x to +x) |
2473 | --- Dependencies/Reachability/Reachability.h 2011-11-01 01:43:45 +0000 |
2474 | +++ Dependencies/Reachability/Reachability.h 2013-04-26 15:39:24 +0000 |
2475 | @@ -1,88 +1,118 @@ |
2476 | /* |
2477 | - |
2478 | - File: Reachability.h |
2479 | - Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. |
2480 | - |
2481 | - Version: 2.0 |
2482 | - |
2483 | - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. |
2484 | - ("Apple") in consideration of your agreement to the following terms, and your |
2485 | - use, installation, modification or redistribution of this Apple software |
2486 | - constitutes acceptance of these terms. If you do not agree with these terms, |
2487 | - please do not use, install, modify or redistribute this Apple software. |
2488 | - |
2489 | - In consideration of your agreement to abide by the following terms, and subject |
2490 | - to these terms, Apple grants you a personal, non-exclusive license, under |
2491 | - Apple's copyrights in this original Apple software (the "Apple Software"), to |
2492 | - use, reproduce, modify and redistribute the Apple Software, with or without |
2493 | - modifications, in source and/or binary forms; provided that if you redistribute |
2494 | - the Apple Software in its entirety and without modifications, you must retain |
2495 | - this notice and the following text and disclaimers in all such redistributions |
2496 | - of the Apple Software. |
2497 | - Neither the name, trademarks, service marks or logos of Apple Inc. may be used |
2498 | - to endorse or promote products derived from the Apple Software without specific |
2499 | - prior written permission from Apple. Except as expressly stated in this notice, |
2500 | - no other rights or licenses, express or implied, are granted by Apple herein, |
2501 | - including but not limited to any patent rights that may be infringed by your |
2502 | - derivative works or by other works in which the Apple Software may be |
2503 | - incorporated. |
2504 | - |
2505 | - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO |
2506 | - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED |
2507 | - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
2508 | - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN |
2509 | - COMBINATION WITH YOUR PRODUCTS. |
2510 | - |
2511 | - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR |
2512 | - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
2513 | - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
2514 | - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR |
2515 | - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF |
2516 | - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF |
2517 | - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2518 | - |
2519 | - Copyright (C) 2009 Apple Inc. All Rights Reserved. |
2520 | - |
2521 | -*/ |
2522 | - |
2523 | + Copyright (c) 2011, Tony Million. |
2524 | + All rights reserved. |
2525 | + |
2526 | + Redistribution and use in source and binary forms, with or without |
2527 | + modification, are permitted provided that the following conditions are met: |
2528 | + |
2529 | + 1. Redistributions of source code must retain the above copyright notice, this |
2530 | + list of conditions and the following disclaimer. |
2531 | + |
2532 | + 2. Redistributions in binary form must reproduce the above copyright notice, |
2533 | + this list of conditions and the following disclaimer in the documentation |
2534 | + and/or other materials provided with the distribution. |
2535 | + |
2536 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
2537 | + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
2538 | + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
2539 | + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
2540 | + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
2541 | + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
2542 | + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
2543 | + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
2544 | + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
2545 | + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
2546 | + POSSIBILITY OF SUCH DAMAGE. |
2547 | + |
2548 | + https://github.com/tonymillion/Reachability |
2549 | + */ |
2550 | |
2551 | #import <Foundation/Foundation.h> |
2552 | #import <SystemConfiguration/SystemConfiguration.h> |
2553 | |
2554 | -typedef enum { |
2555 | - NotReachable = 0, |
2556 | - ReachableViaWiFi, |
2557 | - ReachableViaWWAN |
2558 | +#import <sys/socket.h> |
2559 | +#import <netinet/in.h> |
2560 | +#import <netinet6/in6.h> |
2561 | +#import <arpa/inet.h> |
2562 | +#import <ifaddrs.h> |
2563 | +#import <netdb.h> |
2564 | + |
2565 | +/** |
2566 | + * Does ARC support support GCD objects? |
2567 | + * It does if the minimum deployment target is iOS 6+ or Mac OS X 8+ |
2568 | + **/ |
2569 | +#if TARGET_OS_IPHONE |
2570 | + |
2571 | +// Compiling for iOS |
2572 | + |
2573 | +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later |
2574 | +#define NEEDS_DISPATCH_RETAIN_RELEASE 0 |
2575 | +#else // iOS 5.X or earlier |
2576 | +#define NEEDS_DISPATCH_RETAIN_RELEASE 1 |
2577 | +#endif |
2578 | + |
2579 | +#else |
2580 | + |
2581 | +// Compiling for Mac OS X |
2582 | + |
2583 | +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later |
2584 | +#define NEEDS_DISPATCH_RETAIN_RELEASE 0 |
2585 | +#else |
2586 | +#define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier |
2587 | +#endif |
2588 | + |
2589 | +#endif |
2590 | + |
2591 | + |
2592 | +extern NSString *const kReachabilityChangedNotification; |
2593 | + |
2594 | +typedef enum |
2595 | +{ |
2596 | + // Apple NetworkStatus Compatible Names. |
2597 | + NotReachable = 0, |
2598 | + ReachableViaWiFi = 2, |
2599 | + ReachableViaWWAN = 1 |
2600 | } NetworkStatus; |
2601 | -#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" |
2602 | - |
2603 | -@interface Reachability: NSObject |
2604 | -{ |
2605 | - BOOL localWiFiRef; |
2606 | - SCNetworkReachabilityRef reachabilityRef; |
2607 | -} |
2608 | - |
2609 | -//reachabilityWithHostName- Use to check the reachability of a particular host name. |
2610 | -+ (Reachability*) reachabilityWithHostName: (NSString*) hostName; |
2611 | - |
2612 | -//reachabilityWithAddress- Use to check the reachability of a particular IP address. |
2613 | -//+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; |
2614 | - |
2615 | -//reachabilityForInternetConnection- checks whether the default route is available. |
2616 | -// Should be used by applications that do not connect to a particular host |
2617 | -+ (Reachability*) reachabilityForInternetConnection; |
2618 | - |
2619 | -//reachabilityForLocalWiFi- checks whether a local wifi connection is available. |
2620 | -+ (Reachability*) reachabilityForLocalWiFi; |
2621 | - |
2622 | -//Start listening for reachability notifications on the current run loop |
2623 | -- (BOOL) startNotifer; |
2624 | -- (void) stopNotifer; |
2625 | - |
2626 | -- (NetworkStatus) currentReachabilityStatus; |
2627 | -//WWAN may be available, but not active until a connection has been established. |
2628 | -//WiFi may require a connection for VPN on Demand. |
2629 | -- (BOOL) connectionRequired; |
2630 | + |
2631 | +@class Reachability; |
2632 | + |
2633 | +typedef void (^NetworkReachable)(Reachability * reachability); |
2634 | +typedef void (^NetworkUnreachable)(Reachability * reachability); |
2635 | + |
2636 | +@interface Reachability : NSObject |
2637 | + |
2638 | +@property (nonatomic, copy) NetworkReachable reachableBlock; |
2639 | +@property (nonatomic, copy) NetworkUnreachable unreachableBlock; |
2640 | + |
2641 | + |
2642 | +@property (nonatomic, assign) BOOL reachableOnWWAN; |
2643 | + |
2644 | ++(Reachability*)reachabilityWithHostname:(NSString*)hostname; |
2645 | ++(Reachability*)reachabilityForInternetConnection; |
2646 | ++(Reachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress; |
2647 | ++(Reachability*)reachabilityForLocalWiFi; |
2648 | + |
2649 | +-(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; |
2650 | + |
2651 | +-(BOOL)startNotifier; |
2652 | +-(void)stopNotifier; |
2653 | + |
2654 | +-(BOOL)isReachable; |
2655 | +-(BOOL)isReachableViaWWAN; |
2656 | +-(BOOL)isReachableViaWiFi; |
2657 | + |
2658 | +// WWAN may be available, but not active until a connection has been established. |
2659 | +// WiFi may require a connection for VPN on Demand. |
2660 | +-(BOOL)isConnectionRequired; // Identical DDG variant. |
2661 | +-(BOOL)connectionRequired; // Apple's routine. |
2662 | +// Dynamic, on demand connection? |
2663 | +-(BOOL)isConnectionOnDemand; |
2664 | +// Is user intervention required? |
2665 | +-(BOOL)isInterventionRequired; |
2666 | + |
2667 | +-(NetworkStatus)currentReachabilityStatus; |
2668 | +-(SCNetworkReachabilityFlags)reachabilityFlags; |
2669 | +-(NSString*)currentReachabilityString; |
2670 | +-(NSString*)currentReachabilityFlags; |
2671 | + |
2672 | @end |
2673 | - |
2674 | - |
2675 | |
2676 | === modified file 'Dependencies/Reachability/Reachability.m' (properties changed: -x to +x) |
2677 | --- Dependencies/Reachability/Reachability.m 2011-11-01 01:43:45 +0000 |
2678 | +++ Dependencies/Reachability/Reachability.m 2013-04-26 15:39:24 +0000 |
2679 | @@ -1,274 +1,505 @@ |
2680 | /* |
2681 | - |
2682 | - File: Reachability.m |
2683 | - Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. |
2684 | - |
2685 | - Version: 2.0 |
2686 | - |
2687 | - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. |
2688 | - ("Apple") in consideration of your agreement to the following terms, and your |
2689 | - use, installation, modification or redistribution of this Apple software |
2690 | - constitutes acceptance of these terms. If you do not agree with these terms, |
2691 | - please do not use, install, modify or redistribute this Apple software. |
2692 | - |
2693 | - In consideration of your agreement to abide by the following terms, and subject |
2694 | - to these terms, Apple grants you a personal, non-exclusive license, under |
2695 | - Apple's copyrights in this original Apple software (the "Apple Software"), to |
2696 | - use, reproduce, modify and redistribute the Apple Software, with or without |
2697 | - modifications, in source and/or binary forms; provided that if you redistribute |
2698 | - the Apple Software in its entirety and without modifications, you must retain |
2699 | - this notice and the following text and disclaimers in all such redistributions |
2700 | - of the Apple Software. |
2701 | - Neither the name, trademarks, service marks or logos of Apple Inc. may be used |
2702 | - to endorse or promote products derived from the Apple Software without specific |
2703 | - prior written permission from Apple. Except as expressly stated in this notice, |
2704 | - no other rights or licenses, express or implied, are granted by Apple herein, |
2705 | - including but not limited to any patent rights that may be infringed by your |
2706 | - derivative works or by other works in which the Apple Software may be |
2707 | - incorporated. |
2708 | - |
2709 | - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO |
2710 | - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED |
2711 | - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
2712 | - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN |
2713 | - COMBINATION WITH YOUR PRODUCTS. |
2714 | - |
2715 | - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR |
2716 | - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
2717 | - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
2718 | - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR |
2719 | - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF |
2720 | - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF |
2721 | - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2722 | - |
2723 | - Copyright (C) 2009 Apple Inc. All Rights Reserved. |
2724 | - |
2725 | -*/ |
2726 | - |
2727 | -#import <sys/socket.h> |
2728 | -#import <netinet/in.h> |
2729 | -#import <netinet6/in6.h> |
2730 | -#import <arpa/inet.h> |
2731 | -#import <ifaddrs.h> |
2732 | -#import <netdb.h> |
2733 | - |
2734 | -#import <CoreFoundation/CoreFoundation.h> |
2735 | + Copyright (c) 2011, Tony Million. |
2736 | + All rights reserved. |
2737 | + |
2738 | + Redistribution and use in source and binary forms, with or without |
2739 | + modification, are permitted provided that the following conditions are met: |
2740 | + |
2741 | + 1. Redistributions of source code must retain the above copyright notice, this |
2742 | + list of conditions and the following disclaimer. |
2743 | + |
2744 | + 2. Redistributions in binary form must reproduce the above copyright notice, |
2745 | + this list of conditions and the following disclaimer in the documentation |
2746 | + and/or other materials provided with the distribution. |
2747 | + |
2748 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
2749 | + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
2750 | + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
2751 | + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
2752 | + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
2753 | + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
2754 | + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
2755 | + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
2756 | + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
2757 | + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
2758 | + POSSIBILITY OF SUCH DAMAGE. |
2759 | + |
2760 | + https://github.com/tonymillion/Reachability |
2761 | + */ |
2762 | |
2763 | #import "Reachability.h" |
2764 | |
2765 | -#define kShouldPrintReachabilityFlags 0 |
2766 | - |
2767 | -static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) |
2768 | -{ |
2769 | -#if kShouldPrintReachabilityFlags |
2770 | - |
2771 | - NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", |
2772 | - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', |
2773 | - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', |
2774 | - |
2775 | - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', |
2776 | - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', |
2777 | - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', |
2778 | - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', |
2779 | - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', |
2780 | - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', |
2781 | - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', |
2782 | - comment |
2783 | - ); |
2784 | -#endif |
2785 | + |
2786 | +NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification"; |
2787 | + |
2788 | +@interface Reachability () |
2789 | + |
2790 | +@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; |
2791 | + |
2792 | + |
2793 | +#if NEEDS_DISPATCH_RETAIN_RELEASE |
2794 | +@property (nonatomic, assign) dispatch_queue_t reachabilitySerialQueue; |
2795 | +#else |
2796 | +@property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; |
2797 | +#endif |
2798 | + |
2799 | + |
2800 | +@property (nonatomic, strong) id reachabilityObject; |
2801 | + |
2802 | +-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags; |
2803 | +-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags; |
2804 | + |
2805 | +@end |
2806 | + |
2807 | +static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags) |
2808 | +{ |
2809 | + return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c", |
2810 | +#if TARGET_OS_IPHONE |
2811 | + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', |
2812 | +#else |
2813 | + 'X', |
2814 | +#endif |
2815 | + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', |
2816 | + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', |
2817 | + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', |
2818 | + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', |
2819 | + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', |
2820 | + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', |
2821 | + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', |
2822 | + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-']; |
2823 | +} |
2824 | + |
2825 | +//Start listening for reachability notifications on the current run loop |
2826 | +static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) |
2827 | +{ |
2828 | +#pragma unused (target) |
2829 | + Reachability *reachability = ((__bridge Reachability*)info); |
2830 | + |
2831 | + // we probably dont need an autoreleasepool here as GCD docs state each queue has its own autorelease pool |
2832 | + // but what the heck eh? |
2833 | + @autoreleasepool |
2834 | + { |
2835 | + [reachability reachabilityChanged:flags]; |
2836 | + } |
2837 | } |
2838 | |
2839 | |
2840 | @implementation Reachability |
2841 | -static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) |
2842 | -{ |
2843 | - #pragma unused (target, flags) |
2844 | - NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); |
2845 | - NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); |
2846 | - |
2847 | - //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively |
2848 | - // in case someon uses the Reachablity object in a different thread. |
2849 | - NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init]; |
2850 | - |
2851 | - Reachability* noteObject = (Reachability*) info; |
2852 | - // Post a notification to notify the client that the network reachability changed. |
2853 | - [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; |
2854 | - |
2855 | - [myPool release]; |
2856 | -} |
2857 | - |
2858 | -- (BOOL) startNotifer |
2859 | -{ |
2860 | - BOOL retVal = NO; |
2861 | - SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; |
2862 | - if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) |
2863 | - { |
2864 | - if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) |
2865 | - { |
2866 | - retVal = YES; |
2867 | - } |
2868 | - } |
2869 | - return retVal; |
2870 | -} |
2871 | - |
2872 | -- (void) stopNotifer |
2873 | -{ |
2874 | - if(reachabilityRef!= NULL) |
2875 | - { |
2876 | - SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); |
2877 | - } |
2878 | -} |
2879 | - |
2880 | -- (void) dealloc |
2881 | -{ |
2882 | - [self stopNotifer]; |
2883 | - if(reachabilityRef!= NULL) |
2884 | - { |
2885 | - CFRelease(reachabilityRef); |
2886 | - } |
2887 | - [super dealloc]; |
2888 | -} |
2889 | - |
2890 | -+ (Reachability*) reachabilityWithHostName: (NSString*) hostName; |
2891 | -{ |
2892 | - Reachability* retVal = NULL; |
2893 | - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); |
2894 | - if(reachability!= NULL) |
2895 | - { |
2896 | - retVal= [[[self alloc] init] autorelease]; |
2897 | - if(retVal!= NULL) |
2898 | - { |
2899 | - retVal->reachabilityRef = reachability; |
2900 | - retVal->localWiFiRef = NO; |
2901 | - } |
2902 | - } |
2903 | - return retVal; |
2904 | -} |
2905 | - |
2906 | -+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; |
2907 | -{ |
2908 | - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); |
2909 | - Reachability* retVal = NULL; |
2910 | - if(reachability!= NULL) |
2911 | - { |
2912 | - retVal= [[[self alloc] init] autorelease]; |
2913 | - if(retVal!= NULL) |
2914 | - { |
2915 | - retVal->reachabilityRef = reachability; |
2916 | - retVal->localWiFiRef = NO; |
2917 | - } |
2918 | - } |
2919 | - return retVal; |
2920 | -} |
2921 | - |
2922 | -+ (Reachability*) reachabilityForInternetConnection; |
2923 | -{ |
2924 | - struct sockaddr_in zeroAddress; |
2925 | - bzero(&zeroAddress, sizeof(zeroAddress)); |
2926 | - zeroAddress.sin_len = sizeof(zeroAddress); |
2927 | - zeroAddress.sin_family = AF_INET; |
2928 | - return [self reachabilityWithAddress: &zeroAddress]; |
2929 | -} |
2930 | - |
2931 | -+ (Reachability*) reachabilityForLocalWiFi; |
2932 | -{ |
2933 | - //[super init]; |
2934 | - struct sockaddr_in localWifiAddress; |
2935 | - bzero(&localWifiAddress, sizeof(localWifiAddress)); |
2936 | - localWifiAddress.sin_len = sizeof(localWifiAddress); |
2937 | - localWifiAddress.sin_family = AF_INET; |
2938 | - // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0 |
2939 | - localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); |
2940 | - Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress]; |
2941 | - if(retVal!= NULL) |
2942 | - { |
2943 | - retVal->localWiFiRef = YES; |
2944 | - } |
2945 | - return retVal; |
2946 | -} |
2947 | - |
2948 | -#pragma mark Network Flag Handling |
2949 | - |
2950 | -- (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags |
2951 | -{ |
2952 | - PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); |
2953 | - |
2954 | - BOOL retVal = NotReachable; |
2955 | - if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) |
2956 | - { |
2957 | - retVal = ReachableViaWiFi; |
2958 | - } |
2959 | - return retVal; |
2960 | -} |
2961 | - |
2962 | -- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags |
2963 | -{ |
2964 | - PrintReachabilityFlags(flags, "networkStatusForFlags"); |
2965 | - if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) |
2966 | - { |
2967 | - // if target host is not reachable |
2968 | - return NotReachable; |
2969 | - } |
2970 | - |
2971 | - BOOL retVal = NotReachable; |
2972 | - |
2973 | - if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) |
2974 | - { |
2975 | - // if target host is reachable and no connection is required |
2976 | - // then we'll assume (for now) that your on Wi-Fi |
2977 | - retVal = ReachableViaWiFi; |
2978 | - } |
2979 | - |
2980 | - |
2981 | - if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || |
2982 | - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) |
2983 | - { |
2984 | - // ... and the connection is on-demand (or on-traffic) if the |
2985 | - // calling application is using the CFSocketStream or higher APIs |
2986 | - |
2987 | - if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) |
2988 | - { |
2989 | - // ... and no [user] intervention is needed |
2990 | - retVal = ReachableViaWiFi; |
2991 | - } |
2992 | - } |
2993 | - |
2994 | - if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) |
2995 | - { |
2996 | - // ... but WWAN connections are OK if the calling application |
2997 | - // is using the CFNetwork (CFSocketStream?) APIs. |
2998 | - retVal = ReachableViaWWAN; |
2999 | - } |
3000 | - return retVal; |
3001 | -} |
3002 | - |
3003 | -- (BOOL) connectionRequired; |
3004 | -{ |
3005 | - NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); |
3006 | - SCNetworkReachabilityFlags flags; |
3007 | - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3008 | - { |
3009 | + |
3010 | +@synthesize reachabilityRef; |
3011 | +@synthesize reachabilitySerialQueue; |
3012 | + |
3013 | +@synthesize reachableOnWWAN; |
3014 | + |
3015 | +@synthesize reachableBlock; |
3016 | +@synthesize unreachableBlock; |
3017 | + |
3018 | +@synthesize reachabilityObject; |
3019 | + |
3020 | +#pragma mark - class constructor methods |
3021 | ++(Reachability*)reachabilityWithHostname:(NSString*)hostname |
3022 | +{ |
3023 | + SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]); |
3024 | + if (ref) |
3025 | + { |
3026 | + id reachability = [[self alloc] initWithReachabilityRef:ref]; |
3027 | + |
3028 | +#if __has_feature(objc_arc) |
3029 | + return reachability; |
3030 | +#else |
3031 | + return [reachability autorelease]; |
3032 | +#endif |
3033 | + |
3034 | + } |
3035 | + |
3036 | + return nil; |
3037 | +} |
3038 | + |
3039 | ++(Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress |
3040 | +{ |
3041 | + SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); |
3042 | + if (ref) |
3043 | + { |
3044 | + id reachability = [[self alloc] initWithReachabilityRef:ref]; |
3045 | + |
3046 | +#if __has_feature(objc_arc) |
3047 | + return reachability; |
3048 | +#else |
3049 | + return [reachability autorelease]; |
3050 | +#endif |
3051 | + } |
3052 | + |
3053 | + return nil; |
3054 | +} |
3055 | + |
3056 | ++(Reachability *)reachabilityForInternetConnection |
3057 | +{ |
3058 | + struct sockaddr_in zeroAddress; |
3059 | + bzero(&zeroAddress, sizeof(zeroAddress)); |
3060 | + zeroAddress.sin_len = sizeof(zeroAddress); |
3061 | + zeroAddress.sin_family = AF_INET; |
3062 | + |
3063 | + return [self reachabilityWithAddress:&zeroAddress]; |
3064 | +} |
3065 | + |
3066 | ++(Reachability*)reachabilityForLocalWiFi |
3067 | +{ |
3068 | + struct sockaddr_in localWifiAddress; |
3069 | + bzero(&localWifiAddress, sizeof(localWifiAddress)); |
3070 | + localWifiAddress.sin_len = sizeof(localWifiAddress); |
3071 | + localWifiAddress.sin_family = AF_INET; |
3072 | + // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0 |
3073 | + localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); |
3074 | + |
3075 | + return [self reachabilityWithAddress:&localWifiAddress]; |
3076 | +} |
3077 | + |
3078 | + |
3079 | +// initialization methods |
3080 | + |
3081 | +-(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref |
3082 | +{ |
3083 | + self = [super init]; |
3084 | + if (self != nil) |
3085 | + { |
3086 | + self.reachableOnWWAN = YES; |
3087 | + self.reachabilityRef = ref; |
3088 | + } |
3089 | + |
3090 | + return self; |
3091 | +} |
3092 | + |
3093 | +-(void)dealloc |
3094 | +{ |
3095 | + [self stopNotifier]; |
3096 | + |
3097 | + if(self.reachabilityRef) |
3098 | + { |
3099 | + CFRelease(self.reachabilityRef); |
3100 | + self.reachabilityRef = nil; |
3101 | + } |
3102 | + |
3103 | + |
3104 | +#if !(__has_feature(objc_arc)) |
3105 | + [super dealloc]; |
3106 | +#endif |
3107 | + |
3108 | + |
3109 | +} |
3110 | + |
3111 | +#pragma mark - notifier methods |
3112 | + |
3113 | +// Notifier |
3114 | +// NOTE: this uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD |
3115 | +// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS. |
3116 | +// INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want) |
3117 | + |
3118 | +-(BOOL)startNotifier |
3119 | +{ |
3120 | + SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL }; |
3121 | + |
3122 | + // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves |
3123 | + // woah |
3124 | + self.reachabilityObject = self; |
3125 | + |
3126 | + |
3127 | + |
3128 | + // first we need to create a serial queue |
3129 | + // we allocate this once for the lifetime of the notifier |
3130 | + self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL); |
3131 | + if(!self.reachabilitySerialQueue) |
3132 | + { |
3133 | + return NO; |
3134 | + } |
3135 | + |
3136 | + |
3137 | + context.info = (__bridge void *)self; |
3138 | + |
3139 | + if (!SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context)) |
3140 | + { |
3141 | +#ifdef DEBUG |
3142 | + NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError())); |
3143 | +#endif |
3144 | + |
3145 | + //clear out the dispatch queue |
3146 | + if(self.reachabilitySerialQueue) |
3147 | + { |
3148 | +#if NEEDS_DISPATCH_RETAIN_RELEASE |
3149 | + dispatch_release(self.reachabilitySerialQueue); |
3150 | +#endif |
3151 | + self.reachabilitySerialQueue = nil; |
3152 | + } |
3153 | + |
3154 | + self.reachabilityObject = nil; |
3155 | + |
3156 | + return NO; |
3157 | + } |
3158 | + |
3159 | + // set it as our reachability queue which will retain the queue |
3160 | + if(!SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue)) |
3161 | + { |
3162 | +#ifdef DEBUG |
3163 | + NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError())); |
3164 | +#endif |
3165 | + |
3166 | + //UH OH - FAILURE! |
3167 | + |
3168 | + // first stop any callbacks! |
3169 | + SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); |
3170 | + |
3171 | + // then clear out the dispatch queue |
3172 | + if(self.reachabilitySerialQueue) |
3173 | + { |
3174 | +#if NEEDS_DISPATCH_RETAIN_RELEASE |
3175 | + dispatch_release(self.reachabilitySerialQueue); |
3176 | +#endif |
3177 | + self.reachabilitySerialQueue = nil; |
3178 | + } |
3179 | + |
3180 | + self.reachabilityObject = nil; |
3181 | + |
3182 | + return NO; |
3183 | + } |
3184 | + |
3185 | + return YES; |
3186 | +} |
3187 | + |
3188 | +-(void)stopNotifier |
3189 | +{ |
3190 | + // first stop any callbacks! |
3191 | + SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); |
3192 | + |
3193 | + // unregister target from the GCD serial dispatch queue |
3194 | + SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL); |
3195 | + |
3196 | + if(self.reachabilitySerialQueue) |
3197 | + { |
3198 | +#if NEEDS_DISPATCH_RETAIN_RELEASE |
3199 | + dispatch_release(self.reachabilitySerialQueue); |
3200 | +#endif |
3201 | + self.reachabilitySerialQueue = nil; |
3202 | + } |
3203 | + |
3204 | + self.reachabilityObject = nil; |
3205 | +} |
3206 | + |
3207 | +#pragma mark - reachability tests |
3208 | + |
3209 | +// this is for the case where you flick the airplane mode |
3210 | +// you end up getting something like this: |
3211 | +//Reachability: WR ct----- |
3212 | +//Reachability: -- ------- |
3213 | +//Reachability: WR ct----- |
3214 | +//Reachability: -- ------- |
3215 | +// we treat this as 4 UNREACHABLE triggers - really apple should do better than this |
3216 | + |
3217 | +#define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection) |
3218 | + |
3219 | +-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags |
3220 | +{ |
3221 | + BOOL connectionUP = YES; |
3222 | + |
3223 | + if(!(flags & kSCNetworkReachabilityFlagsReachable)) |
3224 | + connectionUP = NO; |
3225 | + |
3226 | + if( (flags & testcase) == testcase ) |
3227 | + connectionUP = NO; |
3228 | + |
3229 | +#if TARGET_OS_IPHONE |
3230 | + if(flags & kSCNetworkReachabilityFlagsIsWWAN) |
3231 | + { |
3232 | + // we're on 3G |
3233 | + if(!self.reachableOnWWAN) |
3234 | + { |
3235 | + // we dont want to connect when on 3G |
3236 | + connectionUP = NO; |
3237 | + } |
3238 | + } |
3239 | +#endif |
3240 | + |
3241 | + return connectionUP; |
3242 | +} |
3243 | + |
3244 | +-(BOOL)isReachable |
3245 | +{ |
3246 | + SCNetworkReachabilityFlags flags; |
3247 | + |
3248 | + if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) |
3249 | + return NO; |
3250 | + |
3251 | + return [self isReachableWithFlags:flags]; |
3252 | +} |
3253 | + |
3254 | +-(BOOL)isReachableViaWWAN |
3255 | +{ |
3256 | +#if TARGET_OS_IPHONE |
3257 | + |
3258 | + SCNetworkReachabilityFlags flags = 0; |
3259 | + |
3260 | + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3261 | + { |
3262 | + // check we're REACHABLE |
3263 | + if(flags & kSCNetworkReachabilityFlagsReachable) |
3264 | + { |
3265 | + // now, check we're on WWAN |
3266 | + if(flags & kSCNetworkReachabilityFlagsIsWWAN) |
3267 | + { |
3268 | + return YES; |
3269 | + } |
3270 | + } |
3271 | + } |
3272 | +#endif |
3273 | + |
3274 | + return NO; |
3275 | +} |
3276 | + |
3277 | +-(BOOL)isReachableViaWiFi |
3278 | +{ |
3279 | + SCNetworkReachabilityFlags flags = 0; |
3280 | + |
3281 | + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3282 | + { |
3283 | + // check we're reachable |
3284 | + if((flags & kSCNetworkReachabilityFlagsReachable)) |
3285 | + { |
3286 | +#if TARGET_OS_IPHONE |
3287 | + // check we're NOT on WWAN |
3288 | + if((flags & kSCNetworkReachabilityFlagsIsWWAN)) |
3289 | + { |
3290 | + return NO; |
3291 | + } |
3292 | +#endif |
3293 | + return YES; |
3294 | + } |
3295 | + } |
3296 | + |
3297 | + return NO; |
3298 | +} |
3299 | + |
3300 | + |
3301 | +// WWAN may be available, but not active until a connection has been established. |
3302 | +// WiFi may require a connection for VPN on Demand. |
3303 | +-(BOOL)isConnectionRequired |
3304 | +{ |
3305 | + return [self connectionRequired]; |
3306 | +} |
3307 | + |
3308 | +-(BOOL)connectionRequired |
3309 | +{ |
3310 | + SCNetworkReachabilityFlags flags; |
3311 | + |
3312 | + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3313 | + { |
3314 | return (flags & kSCNetworkReachabilityFlagsConnectionRequired); |
3315 | } |
3316 | - return NO; |
3317 | + |
3318 | + return NO; |
3319 | } |
3320 | |
3321 | -- (NetworkStatus) currentReachabilityStatus |
3322 | +// Dynamic, on demand connection? |
3323 | +-(BOOL)isConnectionOnDemand |
3324 | { |
3325 | - NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); |
3326 | - NetworkStatus retVal = NotReachable; |
3327 | SCNetworkReachabilityFlags flags; |
3328 | - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3329 | - { |
3330 | - if(localWiFiRef) |
3331 | - { |
3332 | - retVal = [self localWiFiStatusForFlags: flags]; |
3333 | - } |
3334 | - else |
3335 | - { |
3336 | - retVal = [self networkStatusForFlags: flags]; |
3337 | - } |
3338 | - } |
3339 | - return retVal; |
3340 | -} |
3341 | + |
3342 | + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3343 | + { |
3344 | + return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && |
3345 | + (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand))); |
3346 | + } |
3347 | + |
3348 | + return NO; |
3349 | +} |
3350 | + |
3351 | +// Is user intervention required? |
3352 | +-(BOOL)isInterventionRequired |
3353 | +{ |
3354 | + SCNetworkReachabilityFlags flags; |
3355 | + |
3356 | + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3357 | + { |
3358 | + return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && |
3359 | + (flags & kSCNetworkReachabilityFlagsInterventionRequired)); |
3360 | + } |
3361 | + |
3362 | + return NO; |
3363 | +} |
3364 | + |
3365 | + |
3366 | +#pragma mark - reachability status stuff |
3367 | + |
3368 | +-(NetworkStatus)currentReachabilityStatus |
3369 | +{ |
3370 | + if([self isReachable]) |
3371 | + { |
3372 | + if([self isReachableViaWiFi]) |
3373 | + return ReachableViaWiFi; |
3374 | + |
3375 | +#if TARGET_OS_IPHONE |
3376 | + return ReachableViaWWAN; |
3377 | +#endif |
3378 | + } |
3379 | + |
3380 | + return NotReachable; |
3381 | +} |
3382 | + |
3383 | +-(SCNetworkReachabilityFlags)reachabilityFlags |
3384 | +{ |
3385 | + SCNetworkReachabilityFlags flags = 0; |
3386 | + |
3387 | + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) |
3388 | + { |
3389 | + return flags; |
3390 | + } |
3391 | + |
3392 | + return 0; |
3393 | +} |
3394 | + |
3395 | +-(NSString*)currentReachabilityString |
3396 | +{ |
3397 | + NetworkStatus temp = [self currentReachabilityStatus]; |
3398 | + |
3399 | + if(temp == reachableOnWWAN) |
3400 | + { |
3401 | + // updated for the fact we have CDMA phones now! |
3402 | + return NSLocalizedString(@"Cellular", @""); |
3403 | + } |
3404 | + if (temp == ReachableViaWiFi) |
3405 | + { |
3406 | + return NSLocalizedString(@"WiFi", @""); |
3407 | + } |
3408 | + |
3409 | + return NSLocalizedString(@"No Connection", @""); |
3410 | +} |
3411 | + |
3412 | +-(NSString*)currentReachabilityFlags |
3413 | +{ |
3414 | + return reachabilityFlags([self reachabilityFlags]); |
3415 | +} |
3416 | + |
3417 | +#pragma mark - callback function calls this method |
3418 | + |
3419 | +-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags |
3420 | +{ |
3421 | + if([self isReachableWithFlags:flags]) |
3422 | + { |
3423 | + if(self.reachableBlock) |
3424 | + { |
3425 | + self.reachableBlock(self); |
3426 | + } |
3427 | + } |
3428 | + else |
3429 | + { |
3430 | + if(self.unreachableBlock) |
3431 | + { |
3432 | + self.unreachableBlock(self); |
3433 | + } |
3434 | + } |
3435 | + |
3436 | + // this makes sure the change notification happens on the MAIN THREAD |
3437 | + dispatch_async(dispatch_get_main_queue(), ^{ |
3438 | + [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification |
3439 | + object:self]; |
3440 | + }); |
3441 | +} |
3442 | + |
3443 | @end |
3444 | |
3445 | === modified file 'Dependencies/SVProgressHUD/SVProgressHUD/SVProgressHUD.m' |
3446 | --- Dependencies/SVProgressHUD/SVProgressHUD/SVProgressHUD.m 2012-01-31 04:40:37 +0000 |
3447 | +++ Dependencies/SVProgressHUD/SVProgressHUD/SVProgressHUD.m 2013-04-26 15:39:24 +0000 |
3448 | @@ -20,7 +20,7 @@ |
3449 | |
3450 | @property (nonatomic, readwrite) SVProgressHUDMaskType maskType; |
3451 | @property (nonatomic, readwrite) BOOL showNetworkIndicator; |
3452 | -@property (nonatomic, retain) NSTimer *fadeOutTimer; |
3453 | +@property (nonatomic, strong) NSTimer *fadeOutTimer; |
3454 | |
3455 | @property (nonatomic, readonly) UIWindow *overlayWindow; |
3456 | @property (nonatomic, readonly) UIView *hudView; |
3457 | @@ -54,12 +54,7 @@ |
3458 | self.fadeOutTimer = nil; |
3459 | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
3460 | |
3461 | - [hudView release]; |
3462 | - [stringLabel release]; |
3463 | - [imageView release]; |
3464 | - [spinnerView release]; |
3465 | |
3466 | - [super dealloc]; |
3467 | } |
3468 | |
3469 | |
3470 | @@ -246,10 +241,10 @@ |
3471 | - (void)setFadeOutTimer:(NSTimer *)newTimer { |
3472 | |
3473 | if(fadeOutTimer) |
3474 | - [fadeOutTimer invalidate], [fadeOutTimer release], fadeOutTimer = nil; |
3475 | + [fadeOutTimer invalidate], fadeOutTimer, fadeOutTimer = nil; |
3476 | |
3477 | if(newTimer) |
3478 | - fadeOutTimer = [newTimer retain]; |
3479 | + fadeOutTimer = newTimer; |
3480 | } |
3481 | |
3482 | |
3483 | @@ -461,8 +456,8 @@ |
3484 | completion:^(BOOL finished){ |
3485 | if(sharedView.alpha == 0) { |
3486 | [[NSNotificationCenter defaultCenter] removeObserver:sharedView]; |
3487 | - [overlayWindow release], overlayWindow = nil; |
3488 | - [sharedView release], sharedView = nil; |
3489 | + overlayWindow, overlayWindow = nil; |
3490 | + sharedView, sharedView = nil; |
3491 | |
3492 | // find the frontmost window that is an actual UIWindow and make it keyVisible |
3493 | [[UIApplication sharedApplication].windows enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(id window, NSUInteger idx, BOOL *stop) { |
3494 | @@ -539,10 +534,7 @@ |
3495 | return spinnerView; |
3496 | } |
3497 | |
3498 | -- (CGFloat)visibleKeyboardHeight { |
3499 | - |
3500 | - NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init]; |
3501 | - |
3502 | +- (CGFloat)visibleKeyboardHeight { |
3503 | UIWindow *keyboardWindow = nil; |
3504 | for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) { |
3505 | if(![[testWindow class] isEqual:[UIWindow class]]) { |
3506 | @@ -553,7 +545,7 @@ |
3507 | |
3508 | // Locate UIKeyboard. |
3509 | UIView *foundKeyboard = nil; |
3510 | - for (UIView *possibleKeyboard in [keyboardWindow subviews]) { |
3511 | + for (__strong UIView *possibleKeyboard in [keyboardWindow subviews]) { |
3512 | |
3513 | // iOS 4 sticks the UIKeyboard inside a UIPeripheralHostView. |
3514 | if ([[possibleKeyboard description] hasPrefix:@"<UIPeripheralHostView"]) { |
3515 | @@ -565,9 +557,7 @@ |
3516 | break; |
3517 | } |
3518 | } |
3519 | - |
3520 | - [autoreleasePool release]; |
3521 | - |
3522 | + |
3523 | if(foundKeyboard && foundKeyboard.bounds.size.height > 100) |
3524 | return foundKeyboard.bounds.size.height; |
3525 | |
3526 | |
3527 | === removed file 'Dependencies/UIActionSheet+Blocks.h' |
3528 | --- Dependencies/UIActionSheet+Blocks.h 2011-10-31 17:16:15 +0000 |
3529 | +++ Dependencies/UIActionSheet+Blocks.h 1970-01-01 00:00:00 +0000 |
3530 | @@ -1,16 +0,0 @@ |
3531 | -// |
3532 | -// UIActionSheet+Blocks.h |
3533 | -// Shibui |
3534 | -// |
3535 | -// Created by Jiva DeVoe on 1/5/11. |
3536 | -// Copyright 2011 Random Ideas, LLC. All rights reserved. |
3537 | -// |
3538 | - |
3539 | -#import <Foundation/Foundation.h> |
3540 | -#import "RIButtonItem.h" |
3541 | - |
3542 | -@interface UIActionSheet (Blocks) <UIActionSheetDelegate> |
3543 | - |
3544 | --(id)initWithTitle:(NSString *)inTitle cancelButtonItem:(RIButtonItem *)inCancelButtonItem destructiveButtonItem:(RIButtonItem *)inDestructiveItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... NS_REQUIRES_NIL_TERMINATION; |
3545 | - |
3546 | -@end |
3547 | |
3548 | === removed file 'Dependencies/UIActionSheet+Blocks.m' |
3549 | --- Dependencies/UIActionSheet+Blocks.m 2011-10-31 17:16:15 +0000 |
3550 | +++ Dependencies/UIActionSheet+Blocks.m 1970-01-01 00:00:00 +0000 |
3551 | @@ -1,71 +0,0 @@ |
3552 | -// |
3553 | -// UIActionSheet+Blocks.m |
3554 | -// Shibui |
3555 | -// |
3556 | -// Created by Jiva DeVoe on 1/5/11. |
3557 | -// Copyright 2011 Random Ideas, LLC. All rights reserved. |
3558 | -// |
3559 | - |
3560 | -#import "UIActionSheet+Blocks.h" |
3561 | -#import <objc/runtime.h> |
3562 | - |
3563 | -static NSString *RI_BUTTON_ASS_KEY = @"com.random-ideas.BUTTONS"; |
3564 | - |
3565 | -@implementation UIActionSheet (Blocks) |
3566 | - |
3567 | --(id)initWithTitle:(NSString *)inTitle cancelButtonItem:(RIButtonItem *)inCancelButtonItem destructiveButtonItem:(RIButtonItem *)inDestructiveItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... |
3568 | -{ |
3569 | - if((self = [self initWithTitle:inTitle delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil])) |
3570 | - { |
3571 | - NSMutableArray *buttonsArray = [NSMutableArray array]; |
3572 | - |
3573 | - RIButtonItem *eachItem; |
3574 | - va_list argumentList; |
3575 | - if (inOtherButtonItems) |
3576 | - { |
3577 | - [buttonsArray addObject: inOtherButtonItems]; |
3578 | - va_start(argumentList, inOtherButtonItems); |
3579 | - while((eachItem = va_arg(argumentList, RIButtonItem *))) |
3580 | - { |
3581 | - [buttonsArray addObject: eachItem]; |
3582 | - } |
3583 | - va_end(argumentList); |
3584 | - } |
3585 | - |
3586 | - for(RIButtonItem *item in buttonsArray) |
3587 | - { |
3588 | - [self addButtonWithTitle:item.label]; |
3589 | - } |
3590 | - |
3591 | - if(inDestructiveItem) |
3592 | - { |
3593 | - [buttonsArray addObject:inDestructiveItem]; |
3594 | - NSInteger destIndex = [self addButtonWithTitle:inDestructiveItem.label]; |
3595 | - [self setDestructiveButtonIndex:destIndex]; |
3596 | - } |
3597 | - if(inCancelButtonItem) |
3598 | - { |
3599 | - [buttonsArray addObject:inCancelButtonItem]; |
3600 | - NSInteger cancelIndex = [self addButtonWithTitle:inCancelButtonItem.label]; |
3601 | - [self setCancelButtonIndex:cancelIndex]; |
3602 | - } |
3603 | - |
3604 | - objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, buttonsArray, OBJC_ASSOCIATION_RETAIN_NONATOMIC); |
3605 | - |
3606 | - [self retain]; // keep yourself around! |
3607 | - } |
3608 | - return self; |
3609 | -} |
3610 | - |
3611 | -- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex |
3612 | -{ |
3613 | - NSArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY); |
3614 | - RIButtonItem *item = [buttonsArray objectAtIndex:buttonIndex]; |
3615 | - if(item.action) |
3616 | - item.action(); |
3617 | - objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); |
3618 | - [self release]; // and release yourself! |
3619 | -} |
3620 | - |
3621 | - |
3622 | -@end |
3623 | |
3624 | === removed file 'Dependencies/UIAlertView+Blocks.h' |
3625 | --- Dependencies/UIAlertView+Blocks.h 2011-10-31 17:16:15 +0000 |
3626 | +++ Dependencies/UIAlertView+Blocks.h 1970-01-01 00:00:00 +0000 |
3627 | @@ -1,16 +0,0 @@ |
3628 | -// |
3629 | -// UIAlertView+Blocks.h |
3630 | -// Shibui |
3631 | -// |
3632 | -// Created by Jiva DeVoe on 12/28/10. |
3633 | -// Copyright 2010 Random Ideas, LLC. All rights reserved. |
3634 | -// |
3635 | - |
3636 | -#import <Foundation/Foundation.h> |
3637 | -#import "RIButtonItem.h" |
3638 | - |
3639 | -@interface UIAlertView (Blocks) |
3640 | - |
3641 | --(id)initWithTitle:(NSString *)inTitle message:(NSString *)inMessage cancelButtonItem:(RIButtonItem *)inCancelButtonItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... NS_REQUIRES_NIL_TERMINATION; |
3642 | - |
3643 | -@end |
3644 | |
3645 | === removed file 'Dependencies/UIAlertView+Blocks.m' |
3646 | --- Dependencies/UIAlertView+Blocks.m 2011-10-31 17:16:15 +0000 |
3647 | +++ Dependencies/UIAlertView+Blocks.m 1970-01-01 00:00:00 +0000 |
3648 | @@ -1,61 +0,0 @@ |
3649 | -// |
3650 | -// UIAlertView+Blocks.m |
3651 | -// Shibui |
3652 | -// |
3653 | -// Created by Jiva DeVoe on 12/28/10. |
3654 | -// Copyright 2010 Random Ideas, LLC. All rights reserved. |
3655 | -// |
3656 | - |
3657 | -#import "UIAlertView+Blocks.h" |
3658 | -#import <objc/runtime.h> |
3659 | - |
3660 | -static NSString *RI_BUTTON_ASS_KEY = @"com.random-ideas.BUTTONS"; |
3661 | - |
3662 | -@implementation UIAlertView (Blocks) |
3663 | - |
3664 | --(id)initWithTitle:(NSString *)inTitle message:(NSString *)inMessage cancelButtonItem:(RIButtonItem *)inCancelButtonItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... |
3665 | -{ |
3666 | - if((self = [self initWithTitle:inTitle message:inMessage delegate:self cancelButtonTitle:inCancelButtonItem.label otherButtonTitles:nil])) |
3667 | - { |
3668 | - NSMutableArray *buttonsArray = [NSMutableArray array]; |
3669 | - |
3670 | - RIButtonItem *eachItem; |
3671 | - va_list argumentList; |
3672 | - if (inOtherButtonItems) |
3673 | - { |
3674 | - [buttonsArray addObject: inOtherButtonItems]; |
3675 | - va_start(argumentList, inOtherButtonItems); |
3676 | - while((eachItem = va_arg(argumentList, RIButtonItem *))) |
3677 | - { |
3678 | - [buttonsArray addObject: eachItem]; |
3679 | - } |
3680 | - va_end(argumentList); |
3681 | - } |
3682 | - |
3683 | - for(RIButtonItem *item in buttonsArray) |
3684 | - { |
3685 | - [self addButtonWithTitle:item.label]; |
3686 | - } |
3687 | - |
3688 | - if(inCancelButtonItem) |
3689 | - [buttonsArray insertObject:inCancelButtonItem atIndex:0]; |
3690 | - |
3691 | - objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, buttonsArray, OBJC_ASSOCIATION_RETAIN_NONATOMIC); |
3692 | - |
3693 | - [self setDelegate:self]; |
3694 | - [self retain]; // keep yourself around! |
3695 | - } |
3696 | - return self; |
3697 | -} |
3698 | - |
3699 | -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex |
3700 | -{ |
3701 | - NSArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY); |
3702 | - RIButtonItem *item = [buttonsArray objectAtIndex:buttonIndex]; |
3703 | - if(item.action) |
3704 | - item.action(); |
3705 | - objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); |
3706 | - [self release]; // and release yourself! |
3707 | -} |
3708 | - |
3709 | -@end |
3710 | |
3711 | === removed directory 'Dependencies/oauthconsumer' |
3712 | === removed directory 'Dependencies/oauthconsumer/Categories' |
3713 | === removed file 'Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.h' |
3714 | --- Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.h 2011-08-31 14:56:30 +0000 |
3715 | +++ Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.h 1970-01-01 00:00:00 +0000 |
3716 | @@ -1,37 +0,0 @@ |
3717 | -// |
3718 | -// NSMutableURLRequest+Parameters.h |
3719 | -// |
3720 | -// Created by Jon Crosby on 10/19/07. |
3721 | -// Copyright 2007 Kaboomerang LLC. All rights reserved. |
3722 | -// |
3723 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
3724 | -// of this software and associated documentation files (the "Software"), to deal |
3725 | -// in the Software without restriction, including without limitation the rights |
3726 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
3727 | -// copies of the Software, and to permit persons to whom the Software is |
3728 | -// furnished to do so, subject to the following conditions: |
3729 | -// |
3730 | -// The above copyright notice and this permission notice shall be included in |
3731 | -// all copies or substantial portions of the Software. |
3732 | -// |
3733 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
3734 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
3735 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
3736 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
3737 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
3738 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
3739 | -// THE SOFTWARE. |
3740 | - |
3741 | -#import <Foundation/Foundation.h> |
3742 | -#import "OARequestParameter.h" |
3743 | -#import "NSURL+Base.h" |
3744 | - |
3745 | - |
3746 | -@interface NSMutableURLRequest (OAParameterAdditions) |
3747 | - |
3748 | -@property(nonatomic, retain) NSArray *parameters; |
3749 | - |
3750 | -- (void)setHTTPBodyWithString:(NSString *)body; |
3751 | -- (void)attachFileWithName:(NSString *)name filename:(NSString*)filename contentType:(NSString *)contentType data:(NSData*)data; |
3752 | - |
3753 | -@end |
3754 | |
3755 | === removed file 'Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.m' |
3756 | --- Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.m 2011-08-31 14:56:30 +0000 |
3757 | +++ Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.m 1970-01-01 00:00:00 +0000 |
3758 | @@ -1,116 +0,0 @@ |
3759 | -// |
3760 | -// NSMutableURLRequest+Parameters.m |
3761 | -// |
3762 | -// Created by Jon Crosby on 10/19/07. |
3763 | -// Copyright 2007 Kaboomerang LLC. All rights reserved. |
3764 | -// |
3765 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
3766 | -// of this software and associated documentation files (the "Software"), to deal |
3767 | -// in the Software without restriction, including without limitation the rights |
3768 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
3769 | -// copies of the Software, and to permit persons to whom the Software is |
3770 | -// furnished to do so, subject to the following conditions: |
3771 | -// |
3772 | -// The above copyright notice and this permission notice shall be included in |
3773 | -// all copies or substantial portions of the Software. |
3774 | -// |
3775 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
3776 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
3777 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
3778 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
3779 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
3780 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
3781 | -// THE SOFTWARE. |
3782 | - |
3783 | - |
3784 | -#import "NSMutableURLRequest+Parameters.h" |
3785 | - |
3786 | -static NSString *Boundary = @"-----------------------------------0xCoCoaouTHeBouNDaRy"; |
3787 | - |
3788 | -@implementation NSMutableURLRequest (OAParameterAdditions) |
3789 | - |
3790 | -- (BOOL)isMultipart { |
3791 | - return [[self valueForHTTPHeaderField:@"Content-Type"] hasPrefix:@"multipart/form-data"]; |
3792 | -} |
3793 | - |
3794 | -- (NSArray *)parameters { |
3795 | - NSString *encodedParameters = nil; |
3796 | - |
3797 | -// if (![self isMultipart]) { |
3798 | - // TODO: review what this is supposed to do, but for now this solves the immediate problem |
3799 | - if ([[self valueForHTTPHeaderField:@"Content-Type"] hasPrefix:@"application/x-www-form-urlencoded"]) |
3800 | - { |
3801 | - if ([[self HTTPMethod] isEqualToString:@"GET"] || [[self HTTPMethod] isEqualToString:@"DELETE"]) { |
3802 | - encodedParameters = [[self URL] query]; |
3803 | - } else { |
3804 | - encodedParameters = [[[NSString alloc] initWithData:[self HTTPBody] encoding:NSASCIIStringEncoding] autorelease]; |
3805 | - } |
3806 | - } |
3807 | - |
3808 | - if (encodedParameters == nil || [encodedParameters isEqualToString:@""]) { |
3809 | - return nil; |
3810 | - } |
3811 | -// NSLog(@"raw parameters %@", encodedParameters); |
3812 | - NSArray *encodedParameterPairs = [encodedParameters componentsSeparatedByString:@"&"]; |
3813 | - NSMutableArray *requestParameters = [NSMutableArray arrayWithCapacity:[encodedParameterPairs count]]; |
3814 | - |
3815 | - for (NSString *encodedPair in encodedParameterPairs) { |
3816 | - NSArray *encodedPairElements = [encodedPair componentsSeparatedByString:@"="]; |
3817 | - OARequestParameter *parameter = [[OARequestParameter alloc] initWithName:[[encodedPairElements objectAtIndex:0] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] |
3818 | - value:[[encodedPairElements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; |
3819 | - [requestParameters addObject:parameter]; |
3820 | - [parameter release]; |
3821 | - } |
3822 | - |
3823 | - return requestParameters; |
3824 | -} |
3825 | - |
3826 | -- (void)setParameters:(NSArray *)parameters |
3827 | -{ |
3828 | - NSMutableArray *pairs = [[[NSMutableArray alloc] initWithCapacity:[parameters count]] autorelease]; |
3829 | - for (OARequestParameter *requestParameter in parameters) { |
3830 | - [pairs addObject:[requestParameter URLEncodedNameValuePair]]; |
3831 | - } |
3832 | - |
3833 | - NSString *encodedParameterPairs = [pairs componentsJoinedByString:@"&"]; |
3834 | - |
3835 | - if ([[self HTTPMethod] isEqualToString:@"GET"] || [[self HTTPMethod] isEqualToString:@"DELETE"]) { |
3836 | - [self setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", [[self URL] URLStringWithoutQuery], encodedParameterPairs]]]; |
3837 | - } else { |
3838 | - // POST, PUT |
3839 | - [self setHTTPBodyWithString:encodedParameterPairs]; |
3840 | - [self setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; |
3841 | - } |
3842 | -} |
3843 | - |
3844 | -- (void)setHTTPBodyWithString:(NSString *)body { |
3845 | - NSData *bodyData = [body dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; |
3846 | - [self setValue:[NSString stringWithFormat:@"%d", [bodyData length]] forHTTPHeaderField:@"Content-Length"]; |
3847 | - [self setHTTPBody:bodyData]; |
3848 | -} |
3849 | - |
3850 | -- (void)attachFileWithName:(NSString *)name filename:(NSString*)filename contentType:(NSString *)contentType data:(NSData*)data { |
3851 | - |
3852 | - NSArray *parameters = [self parameters]; |
3853 | - [self setValue:[@"multipart/form-data; boundary=" stringByAppendingString:Boundary] forHTTPHeaderField:@"Content-type"]; |
3854 | - |
3855 | - NSMutableData *bodyData = [NSMutableData new]; |
3856 | - for (OARequestParameter *parameter in parameters) { |
3857 | - NSString *param = [NSString stringWithFormat:@"--%@\r\nContent-Disposition: form-data; name=\"%@\"\r\n\r\n%@\r\n", |
3858 | - Boundary, [parameter URLEncodedName], [parameter value]]; |
3859 | - |
3860 | - [bodyData appendData:[param dataUsingEncoding:NSUTF8StringEncoding]]; |
3861 | - } |
3862 | - |
3863 | - NSString *filePrefix = [NSString stringWithFormat:@"--%@\r\nContent-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\nContent-Type: %@\r\n\r\n", |
3864 | - Boundary, name, filename, contentType]; |
3865 | - [bodyData appendData:[filePrefix dataUsingEncoding:NSUTF8StringEncoding]]; |
3866 | - [bodyData appendData:data]; |
3867 | - |
3868 | - [bodyData appendData:[[[@"\r\n--" stringByAppendingString:Boundary] stringByAppendingString:@"--"] dataUsingEncoding:NSUTF8StringEncoding]]; |
3869 | - [self setValue:[NSString stringWithFormat:@"%d", [bodyData length]] forHTTPHeaderField:@"Content-Length"]; |
3870 | - [self setHTTPBody:bodyData]; |
3871 | - [bodyData release]; |
3872 | -} |
3873 | - |
3874 | -@end |
3875 | |
3876 | === removed file 'Dependencies/oauthconsumer/Categories/NSString+URLEncoding.h' |
3877 | --- Dependencies/oauthconsumer/Categories/NSString+URLEncoding.h 2011-08-31 14:56:30 +0000 |
3878 | +++ Dependencies/oauthconsumer/Categories/NSString+URLEncoding.h 1970-01-01 00:00:00 +0000 |
3879 | @@ -1,35 +0,0 @@ |
3880 | -// |
3881 | -// NSString+URLEncoding.h |
3882 | -// |
3883 | -// Created by Jon Crosby on 10/19/07. |
3884 | -// Copyright 2007 Kaboomerang LLC. All rights reserved. |
3885 | -// |
3886 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
3887 | -// of this software and associated documentation files (the "Software"), to deal |
3888 | -// in the Software without restriction, including without limitation the rights |
3889 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
3890 | -// copies of the Software, and to permit persons to whom the Software is |
3891 | -// furnished to do so, subject to the following conditions: |
3892 | -// |
3893 | -// The above copyright notice and this permission notice shall be included in |
3894 | -// all copies or substantial portions of the Software. |
3895 | -// |
3896 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
3897 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
3898 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
3899 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
3900 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
3901 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
3902 | -// THE SOFTWARE. |
3903 | - |
3904 | - |
3905 | -#import <Foundation/Foundation.h> |
3906 | - |
3907 | - |
3908 | -@interface NSString (OAURLEncodingAdditions) |
3909 | - |
3910 | -- (NSString *)encodedURLString; |
3911 | -- (NSString *)encodedURLParameterString; |
3912 | -- (NSString *)decodedURLString; |
3913 | -- (NSString *)removeQuotes; |
3914 | -@end |
3915 | |
3916 | === removed file 'Dependencies/oauthconsumer/Categories/NSString+URLEncoding.m' |
3917 | --- Dependencies/oauthconsumer/Categories/NSString+URLEncoding.m 2011-08-31 14:56:30 +0000 |
3918 | +++ Dependencies/oauthconsumer/Categories/NSString+URLEncoding.m 1970-01-01 00:00:00 +0000 |
3919 | @@ -1,73 +0,0 @@ |
3920 | -// |
3921 | -// NSString+URLEncoding.m |
3922 | -// |
3923 | -// Created by Jon Crosby on 10/19/07. |
3924 | -// Copyright 2007 Kaboomerang LLC. All rights reserved. |
3925 | -// |
3926 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
3927 | -// of this software and associated documentation files (the "Software"), to deal |
3928 | -// in the Software without restriction, including without limitation the rights |
3929 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
3930 | -// copies of the Software, and to permit persons to whom the Software is |
3931 | -// furnished to do so, subject to the following conditions: |
3932 | -// |
3933 | -// The above copyright notice and this permission notice shall be included in |
3934 | -// all copies or substantial portions of the Software. |
3935 | -// |
3936 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
3937 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
3938 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
3939 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
3940 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
3941 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
3942 | -// THE SOFTWARE. |
3943 | - |
3944 | - |
3945 | -#import "NSString+URLEncoding.h" |
3946 | - |
3947 | - |
3948 | -@implementation NSString (OAURLEncodingAdditions) |
3949 | - |
3950 | -- (NSString *)encodedURLString { |
3951 | - NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, |
3952 | - (CFStringRef)self, |
3953 | - NULL, // characters to leave unescaped (NULL = all escaped sequences are replaced) |
3954 | - CFSTR("?=&+"), // legal URL characters to be escaped (NULL = all legal characters are replaced) |
3955 | - kCFStringEncodingUTF8); // encoding |
3956 | - return [result autorelease]; |
3957 | -} |
3958 | - |
3959 | -- (NSString *)encodedURLParameterString { |
3960 | - NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, |
3961 | - (CFStringRef)self, |
3962 | - NULL, |
3963 | - CFSTR(":/=,!$&'()*+;[]@#?"), |
3964 | - kCFStringEncodingUTF8); |
3965 | - return [result autorelease]; |
3966 | -} |
3967 | - |
3968 | -- (NSString *)decodedURLString { |
3969 | - NSString *result = (NSString*)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, |
3970 | - (CFStringRef)self, |
3971 | - CFSTR(""), |
3972 | - kCFStringEncodingUTF8); |
3973 | - |
3974 | - return [result autorelease]; |
3975 | - |
3976 | -} |
3977 | - |
3978 | --(NSString *)removeQuotes |
3979 | -{ |
3980 | - NSUInteger length = [self length]; |
3981 | - NSString *ret = self; |
3982 | - if ([self characterAtIndex:0] == '"') { |
3983 | - ret = [ret substringFromIndex:1]; |
3984 | - } |
3985 | - if ([self characterAtIndex:length - 1] == '"') { |
3986 | - ret = [ret substringToIndex:length - 2]; |
3987 | - } |
3988 | - |
3989 | - return ret; |
3990 | -} |
3991 | - |
3992 | -@end |
3993 | |
3994 | === removed file 'Dependencies/oauthconsumer/Categories/NSURL+Base.h' |
3995 | --- Dependencies/oauthconsumer/Categories/NSURL+Base.h 2011-08-31 14:56:30 +0000 |
3996 | +++ Dependencies/oauthconsumer/Categories/NSURL+Base.h 1970-01-01 00:00:00 +0000 |
3997 | @@ -1,34 +0,0 @@ |
3998 | -// |
3999 | -// NSURL+Base.h |
4000 | -// OAuthConsumer |
4001 | -// |
4002 | -// Created by Jon Crosby on 10/19/07. |
4003 | -// Copyright 2007 Kaboomerang LLC. All rights reserved. |
4004 | -// |
4005 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
4006 | -// of this software and associated documentation files (the "Software"), to deal |
4007 | -// in the Software without restriction, including without limitation the rights |
4008 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
4009 | -// copies of the Software, and to permit persons to whom the Software is |
4010 | -// furnished to do so, subject to the following conditions: |
4011 | -// |
4012 | -// The above copyright notice and this permission notice shall be included in |
4013 | -// all copies or substantial portions of the Software. |
4014 | -// |
4015 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
4016 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
4017 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
4018 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
4019 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
4020 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
4021 | -// THE SOFTWARE. |
4022 | - |
4023 | - |
4024 | -#import <Foundation/Foundation.h> |
4025 | - |
4026 | - |
4027 | -@interface NSURL (OABaseAdditions) |
4028 | - |
4029 | -- (NSString *)URLStringWithoutQuery; |
4030 | - |
4031 | -@end |
4032 | |
4033 | === removed file 'Dependencies/oauthconsumer/Categories/NSURL+Base.m' |
4034 | --- Dependencies/oauthconsumer/Categories/NSURL+Base.m 2011-08-31 14:56:30 +0000 |
4035 | +++ Dependencies/oauthconsumer/Categories/NSURL+Base.m 1970-01-01 00:00:00 +0000 |
4036 | @@ -1,37 +0,0 @@ |
4037 | -// |
4038 | -// NSURL+Base.m |
4039 | -// OAuthConsumer |
4040 | -// |
4041 | -// Created by Jon Crosby on 10/19/07. |
4042 | -// Copyright 2007 Kaboomerang LLC. All rights reserved. |
4043 | -// |
4044 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
4045 | -// of this software and associated documentation files (the "Software"), to deal |
4046 | -// in the Software without restriction, including without limitation the rights |
4047 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
4048 | -// copies of the Software, and to permit persons to whom the Software is |
4049 | -// furnished to do so, subject to the following conditions: |
4050 | -// |
4051 | -// The above copyright notice and this permission notice shall be included in |
4052 | -// all copies or substantial portions of the Software. |
4053 | -// |
4054 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
4055 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
4056 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
4057 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
4058 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
4059 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
4060 | -// THE SOFTWARE. |
4061 | - |
4062 | - |
4063 | -#import "NSURL+Base.h" |
4064 | - |
4065 | - |
4066 | -@implementation NSURL (OABaseAdditions) |
4067 | - |
4068 | -- (NSString *)URLStringWithoutQuery { |
4069 | - NSArray *parts = [[self absoluteString] componentsSeparatedByString:@"?"]; |
4070 | - return [parts objectAtIndex:0]; |
4071 | -} |
4072 | - |
4073 | -@end |
4074 | |
4075 | === removed directory 'Dependencies/oauthconsumer/Crypto' |
4076 | === removed file 'Dependencies/oauthconsumer/Crypto/Base64Transcoder.c' |
4077 | --- Dependencies/oauthconsumer/Crypto/Base64Transcoder.c 2011-08-31 14:56:30 +0000 |
4078 | +++ Dependencies/oauthconsumer/Crypto/Base64Transcoder.c 1970-01-01 00:00:00 +0000 |
4079 | @@ -1,230 +0,0 @@ |
4080 | -/* |
4081 | - * Base64Transcoder.c |
4082 | - * Base64Test |
4083 | - * |
4084 | - * Created by Jonathan Wight on Tue Mar 18 2003. |
4085 | - * Copyright (c) 2003 Toxic Software. All rights reserved. |
4086 | - * |
4087 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
4088 | - * of this software and associated documentation files (the "Software"), to deal |
4089 | - * in the Software without restriction, including without limitation the rights |
4090 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
4091 | - * copies of the Software, and to permit persons to whom the Software is |
4092 | - * furnished to do so, subject to the following conditions: |
4093 | - * |
4094 | - * The above copyright notice and this permission notice shall be included in |
4095 | - * all copies or substantial portions of the Software. |
4096 | - * |
4097 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
4098 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
4099 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
4100 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
4101 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
4102 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
4103 | - * THE SOFTWARE. |
4104 | - * |
4105 | - */ |
4106 | - |
4107 | -#include "Base64Transcoder.h" |
4108 | - |
4109 | -#include <math.h> |
4110 | -#include <string.h> |
4111 | - |
4112 | -const u_int8_t kBase64EncodeTable[64] = { |
4113 | - /* 0 */ 'A', /* 1 */ 'B', /* 2 */ 'C', /* 3 */ 'D', |
4114 | - /* 4 */ 'E', /* 5 */ 'F', /* 6 */ 'G', /* 7 */ 'H', |
4115 | - /* 8 */ 'I', /* 9 */ 'J', /* 10 */ 'K', /* 11 */ 'L', |
4116 | - /* 12 */ 'M', /* 13 */ 'N', /* 14 */ 'O', /* 15 */ 'P', |
4117 | - /* 16 */ 'Q', /* 17 */ 'R', /* 18 */ 'S', /* 19 */ 'T', |
4118 | - /* 20 */ 'U', /* 21 */ 'V', /* 22 */ 'W', /* 23 */ 'X', |
4119 | - /* 24 */ 'Y', /* 25 */ 'Z', /* 26 */ 'a', /* 27 */ 'b', |
4120 | - /* 28 */ 'c', /* 29 */ 'd', /* 30 */ 'e', /* 31 */ 'f', |
4121 | - /* 32 */ 'g', /* 33 */ 'h', /* 34 */ 'i', /* 35 */ 'j', |
4122 | - /* 36 */ 'k', /* 37 */ 'l', /* 38 */ 'm', /* 39 */ 'n', |
4123 | - /* 40 */ 'o', /* 41 */ 'p', /* 42 */ 'q', /* 43 */ 'r', |
4124 | - /* 44 */ 's', /* 45 */ 't', /* 46 */ 'u', /* 47 */ 'v', |
4125 | - /* 48 */ 'w', /* 49 */ 'x', /* 50 */ 'y', /* 51 */ 'z', |
4126 | - /* 52 */ '0', /* 53 */ '1', /* 54 */ '2', /* 55 */ '3', |
4127 | - /* 56 */ '4', /* 57 */ '5', /* 58 */ '6', /* 59 */ '7', |
4128 | - /* 60 */ '8', /* 61 */ '9', /* 62 */ '+', /* 63 */ '/' |
4129 | -}; |
4130 | - |
4131 | -/* |
4132 | --1 = Base64 end of data marker. |
4133 | --2 = White space (tabs, cr, lf, space) |
4134 | --3 = Noise (all non whitespace, non-base64 characters) |
4135 | --4 = Dangerous noise |
4136 | --5 = Illegal noise (null byte) |
4137 | -*/ |
4138 | - |
4139 | -const int8_t kBase64DecodeTable[128] = { |
4140 | - /* 0x00 */ -5, /* 0x01 */ -3, /* 0x02 */ -3, /* 0x03 */ -3, |
4141 | - /* 0x04 */ -3, /* 0x05 */ -3, /* 0x06 */ -3, /* 0x07 */ -3, |
4142 | - /* 0x08 */ -3, /* 0x09 */ -2, /* 0x0a */ -2, /* 0x0b */ -2, |
4143 | - /* 0x0c */ -2, /* 0x0d */ -2, /* 0x0e */ -3, /* 0x0f */ -3, |
4144 | - /* 0x10 */ -3, /* 0x11 */ -3, /* 0x12 */ -3, /* 0x13 */ -3, |
4145 | - /* 0x14 */ -3, /* 0x15 */ -3, /* 0x16 */ -3, /* 0x17 */ -3, |
4146 | - /* 0x18 */ -3, /* 0x19 */ -3, /* 0x1a */ -3, /* 0x1b */ -3, |
4147 | - /* 0x1c */ -3, /* 0x1d */ -3, /* 0x1e */ -3, /* 0x1f */ -3, |
4148 | - /* ' ' */ -2, /* '!' */ -3, /* '"' */ -3, /* '#' */ -3, |
4149 | - /* '$' */ -3, /* '%' */ -3, /* '&' */ -3, /* ''' */ -3, |
4150 | - /* '(' */ -3, /* ')' */ -3, /* '*' */ -3, /* '+' */ 62, |
4151 | - /* ',' */ -3, /* '-' */ -3, /* '.' */ -3, /* '/' */ 63, |
4152 | - /* '0' */ 52, /* '1' */ 53, /* '2' */ 54, /* '3' */ 55, |
4153 | - /* '4' */ 56, /* '5' */ 57, /* '6' */ 58, /* '7' */ 59, |
4154 | - /* '8' */ 60, /* '9' */ 61, /* ':' */ -3, /* ';' */ -3, |
4155 | - /* '<' */ -3, /* '=' */ -1, /* '>' */ -3, /* '?' */ -3, |
4156 | - /* '@' */ -3, /* 'A' */ 0, /* 'B' */ 1, /* 'C' */ 2, |
4157 | - /* 'D' */ 3, /* 'E' */ 4, /* 'F' */ 5, /* 'G' */ 6, |
4158 | - /* 'H' */ 7, /* 'I' */ 8, /* 'J' */ 9, /* 'K' */ 10, |
4159 | - /* 'L' */ 11, /* 'M' */ 12, /* 'N' */ 13, /* 'O' */ 14, |
4160 | - /* 'P' */ 15, /* 'Q' */ 16, /* 'R' */ 17, /* 'S' */ 18, |
4161 | - /* 'T' */ 19, /* 'U' */ 20, /* 'V' */ 21, /* 'W' */ 22, |
4162 | - /* 'X' */ 23, /* 'Y' */ 24, /* 'Z' */ 25, /* '[' */ -3, |
4163 | - /* '\' */ -3, /* ']' */ -3, /* '^' */ -3, /* '_' */ -3, |
4164 | - /* '`' */ -3, /* 'a' */ 26, /* 'b' */ 27, /* 'c' */ 28, |
4165 | - /* 'd' */ 29, /* 'e' */ 30, /* 'f' */ 31, /* 'g' */ 32, |
4166 | - /* 'h' */ 33, /* 'i' */ 34, /* 'j' */ 35, /* 'k' */ 36, |
4167 | - /* 'l' */ 37, /* 'm' */ 38, /* 'n' */ 39, /* 'o' */ 40, |
4168 | - /* 'p' */ 41, /* 'q' */ 42, /* 'r' */ 43, /* 's' */ 44, |
4169 | - /* 't' */ 45, /* 'u' */ 46, /* 'v' */ 47, /* 'w' */ 48, |
4170 | - /* 'x' */ 49, /* 'y' */ 50, /* 'z' */ 51, /* '{' */ -3, |
4171 | - /* '|' */ -3, /* '}' */ -3, /* '~' */ -3, /* 0x7f */ -3 |
4172 | -}; |
4173 | - |
4174 | -const u_int8_t kBits_00000011 = 0x03; |
4175 | -const u_int8_t kBits_00001111 = 0x0F; |
4176 | -const u_int8_t kBits_00110000 = 0x30; |
4177 | -const u_int8_t kBits_00111100 = 0x3C; |
4178 | -const u_int8_t kBits_00111111 = 0x3F; |
4179 | -const u_int8_t kBits_11000000 = 0xC0; |
4180 | -const u_int8_t kBits_11110000 = 0xF0; |
4181 | -const u_int8_t kBits_11111100 = 0xFC; |
4182 | - |
4183 | -size_t EstimateBas64EncodedDataSize(size_t inDataSize) |
4184 | -{ |
4185 | -size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4; |
4186 | -theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72; |
4187 | -return(theEncodedDataSize); |
4188 | -} |
4189 | - |
4190 | -size_t EstimateBas64DecodedDataSize(size_t inDataSize) |
4191 | -{ |
4192 | -size_t theDecodedDataSize = (int)ceil(inDataSize / 4.0) * 3; |
4193 | -//theDecodedDataSize = theDecodedDataSize / 72 * 74 + theDecodedDataSize % 72; |
4194 | -return(theDecodedDataSize); |
4195 | -} |
4196 | - |
4197 | -bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize) |
4198 | -{ |
4199 | -size_t theEncodedDataSize = EstimateBas64EncodedDataSize(inInputDataSize); |
4200 | -if (*ioOutputDataSize < theEncodedDataSize) |
4201 | - return(false); |
4202 | -*ioOutputDataSize = theEncodedDataSize; |
4203 | -const u_int8_t *theInPtr = (const u_int8_t *)inInputData; |
4204 | -u_int32_t theInIndex = 0, theOutIndex = 0; |
4205 | -for (; theInIndex < (inInputDataSize / 3) * 3; theInIndex += 3) |
4206 | - { |
4207 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2]; |
4208 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000) >> 4]; |
4209 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 1] & kBits_00001111) << 2 | (theInPtr[theInIndex + 2] & kBits_11000000) >> 6]; |
4210 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 2] & kBits_00111111) >> 0]; |
4211 | - if (theOutIndex % 74 == 72) |
4212 | - { |
4213 | - outOutputData[theOutIndex++] = '\r'; |
4214 | - outOutputData[theOutIndex++] = '\n'; |
4215 | - } |
4216 | - } |
4217 | -const size_t theRemainingBytes = inInputDataSize - theInIndex; |
4218 | -if (theRemainingBytes == 1) |
4219 | - { |
4220 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2]; |
4221 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (0 & kBits_11110000) >> 4]; |
4222 | - outOutputData[theOutIndex++] = '='; |
4223 | - outOutputData[theOutIndex++] = '='; |
4224 | - if (theOutIndex % 74 == 72) |
4225 | - { |
4226 | - outOutputData[theOutIndex++] = '\r'; |
4227 | - outOutputData[theOutIndex++] = '\n'; |
4228 | - } |
4229 | - } |
4230 | -else if (theRemainingBytes == 2) |
4231 | - { |
4232 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2]; |
4233 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000) >> 4]; |
4234 | - outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 1] & kBits_00001111) << 2 | (0 & kBits_11000000) >> 6]; |
4235 | - outOutputData[theOutIndex++] = '='; |
4236 | - if (theOutIndex % 74 == 72) |
4237 | - { |
4238 | - outOutputData[theOutIndex++] = '\r'; |
4239 | - outOutputData[theOutIndex++] = '\n'; |
4240 | - } |
4241 | - } |
4242 | -return(true); |
4243 | -} |
4244 | - |
4245 | -bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize) |
4246 | -{ |
4247 | -memset(ioOutputData, '.', *ioOutputDataSize); |
4248 | - |
4249 | -size_t theDecodedDataSize = EstimateBas64DecodedDataSize(inInputDataSize); |
4250 | -if (*ioOutputDataSize < theDecodedDataSize) |
4251 | - return(false); |
4252 | -*ioOutputDataSize = 0; |
4253 | -const u_int8_t *theInPtr = (const u_int8_t *)inInputData; |
4254 | -u_int8_t *theOutPtr = (u_int8_t *)ioOutputData; |
4255 | -size_t theInIndex = 0, theOutIndex = 0; |
4256 | -u_int8_t theOutputOctet; |
4257 | -size_t theSequence = 0; |
4258 | -for (; theInIndex < inInputDataSize; ) |
4259 | - { |
4260 | - int8_t theSextet = 0; |
4261 | - |
4262 | - int8_t theCurrentInputOctet = theInPtr[theInIndex]; |
4263 | - theSextet = kBase64DecodeTable[theCurrentInputOctet]; |
4264 | - if (theSextet == -1) |
4265 | - break; |
4266 | - while (theSextet == -2) |
4267 | - { |
4268 | - theCurrentInputOctet = theInPtr[++theInIndex]; |
4269 | - theSextet = kBase64DecodeTable[theCurrentInputOctet]; |
4270 | - } |
4271 | - while (theSextet == -3) |
4272 | - { |
4273 | - theCurrentInputOctet = theInPtr[++theInIndex]; |
4274 | - theSextet = kBase64DecodeTable[theCurrentInputOctet]; |
4275 | - } |
4276 | - if (theSequence == 0) |
4277 | - { |
4278 | - theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 2 & kBits_11111100; |
4279 | - } |
4280 | - else if (theSequence == 1) |
4281 | - { |
4282 | - theOutputOctet |= (theSextet >- 0 ? theSextet : 0) >> 4 & kBits_00000011; |
4283 | - theOutPtr[theOutIndex++] = theOutputOctet; |
4284 | - } |
4285 | - else if (theSequence == 2) |
4286 | - { |
4287 | - theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 4 & kBits_11110000; |
4288 | - } |
4289 | - else if (theSequence == 3) |
4290 | - { |
4291 | - theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 2 & kBits_00001111; |
4292 | - theOutPtr[theOutIndex++] = theOutputOctet; |
4293 | - } |
4294 | - else if (theSequence == 4) |
4295 | - { |
4296 | - theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 6 & kBits_11000000; |
4297 | - } |
4298 | - else if (theSequence == 5) |
4299 | - { |
4300 | - theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 0 & kBits_00111111; |
4301 | - theOutPtr[theOutIndex++] = theOutputOctet; |
4302 | - } |
4303 | - theSequence = (theSequence + 1) % 6; |
4304 | - if (theSequence != 2 && theSequence != 4) |
4305 | - theInIndex++; |
4306 | - } |
4307 | -*ioOutputDataSize = theOutIndex; |
4308 | -return(true); |
4309 | -} |
4310 | |
4311 | === removed file 'Dependencies/oauthconsumer/Crypto/Base64Transcoder.h' |
4312 | --- Dependencies/oauthconsumer/Crypto/Base64Transcoder.h 2011-08-31 14:56:30 +0000 |
4313 | +++ Dependencies/oauthconsumer/Crypto/Base64Transcoder.h 1970-01-01 00:00:00 +0000 |
4314 | @@ -1,36 +0,0 @@ |
4315 | -/* |
4316 | - * Base64Transcoder.h |
4317 | - * Base64Test |
4318 | - * |
4319 | - * Created by Jonathan Wight on Tue Mar 18 2003. |
4320 | - * Copyright (c) 2003 Toxic Software. All rights reserved. |
4321 | - * |
4322 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
4323 | - * of this software and associated documentation files (the "Software"), to deal |
4324 | - * in the Software without restriction, including without limitation the rights |
4325 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
4326 | - * copies of the Software, and to permit persons to whom the Software is |
4327 | - * furnished to do so, subject to the following conditions: |
4328 | - * |
4329 | - * The above copyright notice and this permission notice shall be included in |
4330 | - * all copies or substantial portions of the Software. |
4331 | - * |
4332 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
4333 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
4334 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
4335 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
4336 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
4337 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
4338 | - * THE SOFTWARE. |
4339 | - * |
4340 | - */ |
4341 | - |
4342 | -#include <stdlib.h> |
4343 | -#include <stdbool.h> |
4344 | - |
4345 | -extern size_t EstimateBas64EncodedDataSize(size_t inDataSize); |
4346 | -extern size_t EstimateBas64DecodedDataSize(size_t inDataSize); |
4347 | - |
4348 | -extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize); |
4349 | -extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize); |
4350 | - |
4351 | |
4352 | === removed file 'Dependencies/oauthconsumer/Crypto/hmac.c' |
4353 | --- Dependencies/oauthconsumer/Crypto/hmac.c 2011-08-31 14:56:30 +0000 |
4354 | +++ Dependencies/oauthconsumer/Crypto/hmac.c 1970-01-01 00:00:00 +0000 |
4355 | @@ -1,88 +0,0 @@ |
4356 | -// |
4357 | -// hmac.c |
4358 | -// OAuthConsumer |
4359 | -// |
4360 | -// Created by Jonathan Wight on 4/8/8. |
4361 | -// Copyright 2008 Jonathan Wight. All rights reserved. |
4362 | -// |
4363 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
4364 | -// of this software and associated documentation files (the "Software"), to deal |
4365 | -// in the Software without restriction, including without limitation the rights |
4366 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
4367 | -// copies of the Software, and to permit persons to whom the Software is |
4368 | -// furnished to do so, subject to the following conditions: |
4369 | -// |
4370 | -// The above copyright notice and this permission notice shall be included in |
4371 | -// all copies or substantial portions of the Software. |
4372 | -// |
4373 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
4374 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
4375 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
4376 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
4377 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
4378 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
4379 | -// THE SOFTWARE. |
4380 | - |
4381 | -/* |
4382 | - * Implementation of HMAC-SHA1. Adapted from example at http://tools.ietf.org/html/rfc2104 |
4383 | - |
4384 | - */ |
4385 | - |
4386 | -#include "sha1.h" |
4387 | - |
4388 | -#include <stdlib.h> |
4389 | -#include <string.h> |
4390 | - |
4391 | -void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, size_t inKeyLength, u_int8_t *outDigest); |
4392 | - |
4393 | -void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, size_t inKeyLength, u_int8_t *outDigest) |
4394 | -{ |
4395 | -#define B 64 |
4396 | -#define L 20 |
4397 | - |
4398 | -SHA1_CTX theSHA1Context; |
4399 | -u_int8_t k_ipad[B + 1]; /* inner padding - key XORd with ipad */ |
4400 | -u_int8_t k_opad[B + 1]; /* outer padding - key XORd with opad */ |
4401 | - |
4402 | -/* if key is longer than 64 bytes reset it to key=SHA1 (key) */ |
4403 | -if (inKeyLength > B) |
4404 | - { |
4405 | - SHA1Init(&theSHA1Context); |
4406 | - SHA1Update(&theSHA1Context, inKey, inKeyLength); |
4407 | - SHA1Final(inKey, &theSHA1Context); |
4408 | - inKeyLength = L; |
4409 | - } |
4410 | - |
4411 | -/* start out by storing key in pads */ |
4412 | -memset(k_ipad, 0, sizeof k_ipad); |
4413 | -memset(k_opad, 0, sizeof k_opad); |
4414 | -memcpy(k_ipad, inKey, inKeyLength); |
4415 | -memcpy(k_opad, inKey, inKeyLength); |
4416 | - |
4417 | -/* XOR key with ipad and opad values */ |
4418 | -int i; |
4419 | -for (i = 0; i < B; i++) |
4420 | - { |
4421 | - k_ipad[i] ^= 0x36; |
4422 | - k_opad[i] ^= 0x5c; |
4423 | - } |
4424 | - |
4425 | -/* |
4426 | -* perform inner SHA1 |
4427 | -*/ |
4428 | -SHA1Init(&theSHA1Context); /* init context for 1st pass */ |
4429 | -SHA1Update(&theSHA1Context, k_ipad, B); /* start with inner pad */ |
4430 | -SHA1Update(&theSHA1Context, (u_int8_t *)inText, inTextLength); /* then text of datagram */ |
4431 | -SHA1Final((u_int8_t *)outDigest, &theSHA1Context); /* finish up 1st pass */ |
4432 | - |
4433 | -/* |
4434 | -* perform outer SHA1 |
4435 | -*/ |
4436 | -SHA1Init(&theSHA1Context); /* init context for 2nd |
4437 | -* pass */ |
4438 | -SHA1Update(&theSHA1Context, k_opad, B); /* start with outer pad */ |
4439 | -SHA1Update(&theSHA1Context, (u_int8_t *)outDigest, L); /* then results of 1st |
4440 | -* hash */ |
4441 | -SHA1Final((u_int8_t *)outDigest, &theSHA1Context); /* finish up 2nd pass */ |
4442 | - |
4443 | -} |
4444 | \ No newline at end of file |
4445 | |
4446 | === removed file 'Dependencies/oauthconsumer/Crypto/hmac.h' |
4447 | --- Dependencies/oauthconsumer/Crypto/hmac.h 2011-08-31 14:56:30 +0000 |
4448 | +++ Dependencies/oauthconsumer/Crypto/hmac.h 1970-01-01 00:00:00 +0000 |
4449 | @@ -1,31 +0,0 @@ |
4450 | -// |
4451 | -// hmac.h |
4452 | -// OAuthConsumer |
4453 | -// |
4454 | -// Created by Jonathan Wight on 4/8/8. |
4455 | -// Copyright 2008 Jonathan Wight. All rights reserved. |
4456 | -// |
4457 | -// Permission is hereby granted, free of charge, to any person obtaining a copy |
4458 | -// of this software and associated documentation files (the "Software"), to deal |
4459 | -// in the Software without restriction, including without limitation the rights |
4460 | -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
4461 | -// copies of the Software, and to permit persons to whom the Software is |
4462 | -// furnished to do so, subject to the following conditions: |
4463 | -// |
4464 | -// The above copyright notice and this permission notice shall be included in |
4465 | -// all copies or substantial portions of the Software. |
4466 | -// |
4467 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
4468 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
4469 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
4470 | -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
4471 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
4472 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
4473 | -// THE SOFTWARE. |
4474 | - |
4475 | -#ifndef HMAC_H |
4476 | -#define HMAC_H 1 |
4477 | - |
4478 | -extern void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, const size_t inKeyLength, u_int8_t *outDigest); |
4479 | - |
4480 | -#endif /* HMAC_H */ |
4481 | \ No newline at end of file |
4482 | |
4483 | === removed file 'Dependencies/oauthconsumer/Crypto/sha1.c' |
4484 | --- Dependencies/oauthconsumer/Crypto/sha1.c 2011-10-25 23:45:21 +0000 |
4485 | +++ Dependencies/oauthconsumer/Crypto/sha1.c 1970-01-01 00:00:00 +0000 |
4486 | @@ -1,171 +0,0 @@ |
4487 | -/* |
4488 | -SHA-1 in C |
4489 | -By Steve Reid <steve@edmweb.com> |
4490 | -100% Public Domain |
4491 | - |
4492 | -Test Vectors (from FIPS PUB 180-1) |
4493 | -"abc" |
4494 | - A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D |
4495 | -"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" |
4496 | - 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 |
4497 | -A million repetitions of "a" |
4498 | - 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F |
4499 | -*/ |
4500 | - |
4501 | -/* #define LITTLE_ENDIAN * This should be #define'd if true. */ |
4502 | -#if __LITTLE_ENDIAN__ |
4503 | -#define LITTLE_ENDIAN |
4504 | -#endif |
4505 | -/* #define SHA1HANDSOFF * Copies data before messing with it. */ |
4506 | - |
4507 | -#include <stdio.h> |
4508 | -#include <string.h> |
4509 | - |
4510 | -#include "sha1.h" |
4511 | - |
4512 | -void SHA1Transform(u_int32_t state[5], u_int8_t buffer[64]); |
4513 | - |
4514 | -#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
4515 | - |
4516 | -/* blk0() and blk() perform the initial expand. */ |
4517 | -/* I got the idea of expanding during the round function from SSLeay */ |
4518 | -#ifdef LITTLE_ENDIAN |
4519 | -#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ |
4520 | - |(rol(block->l[i],8)&0x00FF00FF)) |
4521 | -#else |
4522 | -#define blk0(i) block->l[i] |
4523 | -#endif |
4524 | -#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ |
4525 | - ^block->l[(i+2)&15]^block->l[i&15],1)) |
4526 | - |
4527 | -/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ |
4528 | -#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); |
4529 | -#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); |
4530 | -#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); |
4531 | -#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); |
4532 | -#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); |
4533 | - |
4534 | - |
4535 | -/* Hash a single 512-bit block. This is the core of the algorithm. */ |
4536 | - |
4537 | -void SHA1Transform(u_int32_t state[5], u_int8_t buffer[64]) |
4538 | -{ |
4539 | -u_int32_t a, b, c, d, e; |
4540 | -typedef union { |
4541 | - u_int8_t c[64]; |
4542 | - u_int32_t l[16]; |
4543 | -} CHAR64LONG16; |
4544 | -CHAR64LONG16* block; |
4545 | -#ifdef SHA1HANDSOFF |
4546 | -static u_int8_t workspace[64]; |
4547 | - block = (CHAR64LONG16*)workspace; |
4548 | - memcpy(block, buffer, 64); |
4549 | -#else |
4550 | - block = (CHAR64LONG16*)buffer; |
4551 | -#endif |
4552 | - /* Copy context->state[] to working vars */ |
4553 | - a = state[0]; |
4554 | - b = state[1]; |
4555 | - c = state[2]; |
4556 | - d = state[3]; |
4557 | - e = state[4]; |
4558 | - /* 4 rounds of 20 operations each. Loop unrolled. */ |
4559 | - R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); |
4560 | - R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); |
4561 | - R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); |
4562 | - R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); |
4563 | - R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); |
4564 | - R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); |
4565 | - R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); |
4566 | - R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); |
4567 | - R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); |
4568 | - R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); |
4569 | - R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); |
4570 | - R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); |
4571 | - R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); |
4572 | - R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); |
4573 | - R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); |
4574 | - R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); |
4575 | - R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); |
4576 | - R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); |
4577 | - R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); |
4578 | - R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); |
4579 | - /* Add the working vars back into context.state[] */ |
4580 | - state[0] += a; |
4581 | - state[1] += b; |
4582 | - state[2] += c; |
4583 | - state[3] += d; |
4584 | - state[4] += e; |
4585 | - /* Wipe variables */ |
4586 | - a = b = c = d = e = 0; |
4587 | - (void)a; // shut up the static analyzer |
4588 | -} |
4589 | - |
4590 | - |
4591 | -/* SHA1Init - Initialize new context */ |
4592 | - |
4593 | -void SHA1Init(SHA1_CTX* context) |
4594 | -{ |
4595 | - /* SHA1 initialization constants */ |
4596 | - context->state[0] = 0x67452301; |
4597 | - context->state[1] = 0xEFCDAB89; |
4598 | - context->state[2] = 0x98BADCFE; |
4599 | - context->state[3] = 0x10325476; |
4600 | - context->state[4] = 0xC3D2E1F0; |
4601 | - context->count[0] = context->count[1] = 0; |
4602 | -} |
4603 | - |
4604 | - |
4605 | -/* Run your data through this. */ |
4606 | - |
4607 | -void SHA1Update(SHA1_CTX* context, u_int8_t* data, unsigned int len) |
4608 | -{ |
4609 | -unsigned int i, j; |
4610 | - |
4611 | - j = (context->count[0] >> 3) & 63; |
4612 | - if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; |
4613 | - context->count[1] += (len >> 29); |
4614 | - if ((j + len) > 63) { |
4615 | - memcpy(&context->buffer[j], data, (i = 64-j)); |
4616 | - SHA1Transform(context->state, context->buffer); |
4617 | - for ( ; i + 63 < len; i += 64) { |
4618 | - SHA1Transform(context->state, &data[i]); |
4619 | - } |
4620 | - j = 0; |
4621 | - } |
4622 | - else i = 0; |
4623 | - memcpy(&context->buffer[j], &data[i], len - i); |
4624 | -} |
4625 | - |
4626 | - |
4627 | -/* Add padding and return the message digest. */ |
4628 | - |
4629 | -void SHA1Final(u_int8_t digest[20], SHA1_CTX* context) |
4630 | -{ |
4631 | -u_int32_t i, j; |
4632 | -u_int8_t finalcount[8]; |
4633 | - |
4634 | - for (i = 0; i < 8; i++) { |
4635 | - finalcount[i] = (u_int8_t)((context->count[(i >= 4 ? 0 : 1)] |
4636 | - >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ |
4637 | - } |
4638 | - SHA1Update(context, (u_int8_t *)"\200", 1); |
4639 | - while ((context->count[0] & 504) != 448) { |
4640 | - SHA1Update(context, (u_int8_t *)"\0", 1); |
4641 | - } |
4642 | - SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ |
4643 | - for (i = 0; i < 20; i++) { |
4644 | - digest[i] = (u_int8_t) |
4645 | - ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); |
4646 | - } |
4647 | - /* Wipe variables */ |
4648 | - i = j = 0; |
4649 | - (void)i; // shut up the static analyzer |
4650 | - memset(context->buffer, 0, 64); |
4651 | - memset(context->state, 0, 20); |
4652 | - memset(context->count, 0, 8); |
4653 | - memset(&finalcount, 0, 8); |
4654 | -#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ |
4655 | - SHA1Transform(context->state, context->buffer); |
4656 | -#endif |
4657 | -} |
4658 | |
4659 | === removed file 'Dependencies/oauthconsumer/Crypto/sha1.h' |
4660 | --- Dependencies/oauthconsumer/Crypto/sha1.h 2011-08-31 14:56:30 +0000 |
4661 | +++ Dependencies/oauthconsumer/Crypto/sha1.h 1970-01-01 00:00:00 +0000 |
4662 | @@ -1,13 +0,0 @@ |
4663 | -#include <sys/types.h> |
4664 | - |
4665 | -// From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c |
4666 | - |
4667 | -typedef struct { |
4668 | - u_int32_t state[5]; |
4669 | - u_int32_t count[2]; |
4670 | - u_int8_t buffer[64]; |
4671 | -} SHA1_CTX; |
4672 | - |
4673 | -extern void SHA1Init(SHA1_CTX* context); |
4674 | -extern void SHA1Update(SHA1_CTX* context, u_int8_t* data, u_int32_t len); |
4675 | -extern void SHA1Final(u_int8_t digest[20], SHA1_CTX* context); |
4676 | |
4677 | === removed file 'Dependencies/oauthconsumer/OAAttachment.h' |
4678 | --- Dependencies/oauthconsumer/OAAttachment.h 2011-08-31 14:56:30 +0000 |
4679 | +++ Dependencies/oauthconsumer/OAAttachment.h 1970-01-01 00:00:00 +0000 |
4680 | @@ -1,26 +0,0 @@ |
4681 | -// |
4682 | -// OAAttachment.h |
4683 | -// Zeus |
4684 | -// |
4685 | -// Created by Jamie Pinkham on 2/3/11. |
4686 | -// Copyright 2011 Tumblr. All rights reserved. |
4687 | -// |
4688 | - |
4689 | -#import <Foundation/Foundation.h> |
4690 | - |
4691 | - |
4692 | -@interface OAAttachment : NSObject { |
4693 | - NSString *name; |
4694 | - NSString *fileName; |
4695 | - NSString *contentType; |
4696 | - NSData *data; |
4697 | -} |
4698 | - |
4699 | -@property (nonatomic, copy) NSString *name; |
4700 | -@property (nonatomic, copy) NSString *fileName; |
4701 | -@property (nonatomic, copy) NSString *contentType; |
4702 | -@property (nonatomic, copy) NSData *data; |
4703 | - |
4704 | -- (id)initWithName:(NSString *)aName filename:(NSString *)aFilename contentType:(NSString *)aContentType data:(NSData *)aData; |
4705 | - |
4706 | -@end |
4707 | |
4708 | === removed file 'Dependencies/oauthconsumer/OAAttachment.m' |
4709 | --- Dependencies/oauthconsumer/OAAttachment.m 2011-08-31 14:56:30 +0000 |
4710 | +++ Dependencies/oauthconsumer/OAAttachment.m 1970-01-01 00:00:00 +0000 |
4711 | @@ -1,33 +0,0 @@ |
4712 | -// |
4713 | -// OAAttachment.h |
4714 | -// Zeus |
4715 | -// |
4716 | -// Created by Jamie Pinkham on 2/3/11. |
4717 | -// Copyright 2011 Tumblr. All rights reserved. |
4718 | -// |
4719 | - |
4720 | -#import "OAAttachment.h" |
4721 | - |
4722 | -@implementation OAAttachment |
4723 | - |
4724 | -@synthesize name, fileName, contentType, data; |
4725 | - |
4726 | -- (id)initWithName:(NSString *)aName filename:(NSString *)aFilename contentType:(NSString *)aContentType data:(NSData *)aData{ |
4727 | - if((self = [super init])){ |
4728 | - self.name = aName; |
4729 | - self.fileName = aFilename; |
4730 | - self.contentType = aContentType; |
4731 | - self.data = aData; |
4732 | - } |
4733 | - return self; |
4734 | -} |
4735 | - |
4736 | -- (void)dealloc{ |
4737 | - [name release]; |
4738 | - [fileName release]; |
4739 | - [contentType release]; |
4740 | - [data release]; |
4741 | - [super dealloc]; |
4742 | -} |
4743 | - |
4744 | -@end |
4745 | \ No newline at end of file |
4746 | |
4747 | === removed file 'Dependencies/oauthconsumer/OACall.h' |
4748 | --- Dependencies/oauthconsumer/OACall.h 2011-08-31 14:56:30 +0000 |
4749 | +++ Dependencies/oauthconsumer/OACall.h 1970-01-01 00:00:00 +0000 |
4750 | @@ -1,63 +0,0 @@ |
4751 | -// |
4752 | -// OACall.h |
4753 | -// OAuthConsumer |
4754 | -// |
4755 | -// Created by Alberto García Hierro on 04/09/08. |
4756 | -// Copyright 2008 Alberto García Hierro. All rights reserved. |
4757 | -// bynotes.com |
4758 | - |
4759 | -#import <Foundation/Foundation.h> |
4760 | - |
4761 | -@class OAProblem; |
4762 | -@class OACall; |
4763 | - |
4764 | -@protocol OACallDelegate |
4765 | - |
4766 | -- (void)call:(OACall *)call failedWithError:(NSError *)error; |
4767 | -- (void)call:(OACall *)call failedWithProblem:(OAProblem *)problem; |
4768 | - |
4769 | -@end |
4770 | - |
4771 | -@class OAConsumer; |
4772 | -@class OAToken; |
4773 | -@class OADataFetcher; |
4774 | -@class OAMutableURLRequest; |
4775 | -@class OAServiceTicket; |
4776 | - |
4777 | -@interface OACall : NSObject { |
4778 | - NSURL *url; |
4779 | - NSString *method; |
4780 | - NSArray *parameters; |
4781 | - NSDictionary *files; |
4782 | - NSObject <OACallDelegate> *delegate; |
4783 | - SEL finishedSelector; |
4784 | - OADataFetcher *fetcher; |
4785 | - OAMutableURLRequest *request; |
4786 | - OAServiceTicket *ticket; |
4787 | -} |
4788 | - |
4789 | -@property(readonly) NSURL *url; |
4790 | -@property(readonly) NSString *method; |
4791 | -@property(readonly) NSArray *parameters; |
4792 | -@property(readonly) NSDictionary *files; |
4793 | -@property(nonatomic, retain) OAServiceTicket *ticket; |
4794 | - |
4795 | -- (id)init; |
4796 | -- (id)initWithURL:(NSURL *)aURL; |
4797 | -- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod; |
4798 | -- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters; |
4799 | -- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters; |
4800 | -- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters files:(NSDictionary*)theFiles; |
4801 | - |
4802 | -- (id)initWithURL:(NSURL *)aURL |
4803 | - method:(NSString *)aMethod |
4804 | - parameters:(NSArray *)theParameters |
4805 | - files:(NSDictionary*)theFiles; |
4806 | - |
4807 | -- (void)perform:(OAConsumer *)consumer |
4808 | - token:(OAToken *)token |
4809 | - realm:(NSString *)realm |
4810 | - delegate:(NSObject <OACallDelegate> *)aDelegate |
4811 | - didFinish:(SEL)finished; |
4812 | - |
4813 | -@end |
4814 | |
4815 | === removed file 'Dependencies/oauthconsumer/OACall.m' |
4816 | --- Dependencies/oauthconsumer/OACall.m 2011-08-31 14:56:30 +0000 |
4817 | +++ Dependencies/oauthconsumer/OACall.m 1970-01-01 00:00:00 +0000 |
4818 | @@ -1,170 +0,0 @@ |
4819 | -// |
4820 | -// OACall.m |
4821 | -// OAuthConsumer |
4822 | -// |
4823 | -// Created by Alberto García Hierro on 04/09/08. |
4824 | -// Copyright 2008 Alberto García Hierro. All rights reserved. |
4825 | -// bynotes.com |
4826 | - |
4827 | -#import "OAConsumer.h" |
4828 | -#import "OAToken.h" |
4829 | -#import "OAProblem.h" |
4830 | -#import "OADataFetcher.h" |
4831 | -#import "OAServiceTicket.h" |
4832 | -#import "OAMutableURLRequest.h" |
4833 | -#import "OACall.h" |
4834 | - |
4835 | -@interface OACall (Private) |
4836 | - |
4837 | -- (void)callFinished:(OAServiceTicket *)ticket withData:(NSData *)data; |
4838 | -- (void)callFailed:(OAServiceTicket *)ticket withError:(NSError *)error; |
4839 | - |
4840 | -@end |
4841 | - |
4842 | -@implementation OACall |
4843 | - |
4844 | -@synthesize url, method, parameters, files, ticket; |
4845 | - |
4846 | -- (id)init { |
4847 | - return [self initWithURL:nil |
4848 | - method:nil |
4849 | - parameters:nil |
4850 | - files:nil]; |
4851 | -} |
4852 | - |
4853 | -- (id)initWithURL:(NSURL *)aURL { |
4854 | - return [self initWithURL:aURL |
4855 | - method:nil |
4856 | - parameters:nil |
4857 | - files:nil]; |
4858 | -} |
4859 | - |
4860 | -- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod { |
4861 | - return [self initWithURL:aURL |
4862 | - method:aMethod |
4863 | - parameters:nil |
4864 | - files:nil]; |
4865 | -} |
4866 | - |
4867 | -- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters { |
4868 | - return [self initWithURL:aURL |
4869 | - method:nil |
4870 | - parameters:theParameters]; |
4871 | -} |
4872 | - |
4873 | -- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters { |
4874 | - return [self initWithURL:aURL |
4875 | - method:aMethod |
4876 | - parameters:theParameters |
4877 | - files:nil]; |
4878 | -} |
4879 | - |
4880 | -- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters files:(NSDictionary*)theFiles { |
4881 | - return [self initWithURL:aURL |
4882 | - method:@"POST" |
4883 | - parameters:theParameters |
4884 | - files:theFiles]; |
4885 | -} |
4886 | - |
4887 | -- (id)initWithURL:(NSURL *)aURL |
4888 | - method:(NSString *)aMethod |
4889 | - parameters:(NSArray *)theParameters |
4890 | - files:(NSDictionary*)theFiles { |
4891 | - if ((self = [super init])) { |
4892 | - url = [aURL retain]; |
4893 | - method = [aMethod retain]; |
4894 | - parameters = [theParameters retain]; |
4895 | - files = [theFiles retain]; |
4896 | - fetcher = nil; |
4897 | - request = nil; |
4898 | - } |
4899 | - |
4900 | - return self; |
4901 | -} |
4902 | - |
4903 | -- (void)dealloc { |
4904 | - [url release]; |
4905 | - [method release]; |
4906 | - [parameters release]; |
4907 | - [files release]; |
4908 | - [fetcher release]; |
4909 | - [request release]; |
4910 | - [ticket release]; |
4911 | - [super dealloc]; |
4912 | -} |
4913 | - |
4914 | -- (void)callFailed:(OAServiceTicket *)aTicket withError:(NSError *)error { |
4915 | - NSLog(@"error body: %@", aTicket.body); |
4916 | - self.ticket = aTicket; |
4917 | - [aTicket release]; |
4918 | - OAProblem *problem = [OAProblem problemWithResponseBody:ticket.body]; |
4919 | - if (problem) { |
4920 | - [delegate call:self failedWithProblem:problem]; |
4921 | - } else { |
4922 | - [delegate call:self failedWithError:error]; |
4923 | - } |
4924 | -} |
4925 | - |
4926 | -- (void)callFinished:(OAServiceTicket *)aTicket withData:(NSData *)data { |
4927 | - self.ticket = aTicket; |
4928 | - [aTicket release]; |
4929 | - if (ticket.didSucceed) { |
4930 | -// NSLog(@"Call body: %@", ticket.body); |
4931 | - [delegate performSelector:finishedSelector withObject:self withObject:ticket.body]; |
4932 | - } else { |
4933 | -// NSLog(@"Failed call body: %@", ticket.body); |
4934 | - [self callFailed:[ticket retain] withError:nil]; |
4935 | - } |
4936 | -} |
4937 | - |
4938 | -- (void)perform:(OAConsumer *)consumer |
4939 | - token:(OAToken *)token |
4940 | - realm:(NSString *)realm |
4941 | - delegate:(NSObject <OACallDelegate> *)aDelegate |
4942 | - didFinish:(SEL)finished |
4943 | - |
4944 | -{ |
4945 | - delegate = aDelegate; |
4946 | - finishedSelector = finished; |
4947 | - |
4948 | - request = [[OAMutableURLRequest alloc] initWithURL:url |
4949 | - consumer:consumer |
4950 | - token:token |
4951 | - realm:realm |
4952 | - signatureProvider:nil]; |
4953 | - if(method) { |
4954 | - [request setHTTPMethod:method]; |
4955 | - } |
4956 | - |
4957 | - if (self.parameters) { |
4958 | - [request setParameters:self.parameters]; |
4959 | - } |
4960 | -// if (self.files) { |
4961 | -// for (NSString *key in self.files) { |
4962 | -// [request attachFileWithName:@"file" filename:NSLocalizedString(@"Photo.jpg", @"") data:[self.files objectForKey:key]]; |
4963 | -// } |
4964 | -// } |
4965 | - fetcher = [[OADataFetcher alloc] init]; |
4966 | - [fetcher fetchDataWithRequest:request |
4967 | - delegate:self |
4968 | - didFinishSelector:@selector(callFinished:withData:) |
4969 | - didFailSelector:@selector(callFailed:withError:)]; |
4970 | -} |
4971 | - |
4972 | -/*- (BOOL)isEqual:(id)object { |
4973 | - if ([object isKindOfClass:[self class]]) { |
4974 | - return [self isEqualToCall:(OACall *)object]; |
4975 | - } |
4976 | - return NO; |
4977 | -} |
4978 | - |
4979 | -- (BOOL)isEqualToCall:(OACall *)aCall { |
4980 | - return (delegate == aCall->delegate |
4981 | - && finishedSelector == aCall->finishedSelector |
4982 | - && [url isEqualTo:aCall.url] |
4983 | - && [method isEqualToString:aCall.method] |
4984 | - && [parameters isEqualToArray:aCall.parameters] |
4985 | - && [files isEqualToDictionary:aCall.files]); |
4986 | -}*/ |
4987 | - |
4988 | -@end |
4989 | |
4990 | === removed file 'Dependencies/oauthconsumer/OAConsumer.h' |
4991 | --- Dependencies/oauthconsumer/OAConsumer.h 2011-08-31 14:56:30 +0000 |
4992 | +++ Dependencies/oauthconsumer/OAConsumer.h 1970-01-01 00:00:00 +0000 |
4993 | @@ -1,42 +0,0 @@ |
4994 | -// |
4995 | -// OAConsumer.h |
4996 | -// OAuthConsumer |
4997 | -// |
4998 | -// Created by Jon Crosby on 10/19/07. |
4999 | -// Copyright 2007 Kaboomerang LLC. All rights reserved. |
5000 | -// |
The diff has been truncated for viewing.