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