Merge lp:~jose-exposito89/ubuntuone-ios-files/arc into lp:ubuntuone-ios-files

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
Reviewer Review Type Date Requested Status
Ubuntu One iOS Client Team Pending
Review via email: mp+160079@code.launchpad.net

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/JoseExposito/PullToRefresh

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'Dependencies/About dependencies.txt'
--- Dependencies/About dependencies.txt 1970-01-01 00:00:00 +0000
+++ Dependencies/About dependencies.txt 2013-04-26 15:39:24 +0000
@@ -0,0 +1,8 @@
1About dependencies:
2
3 - PullToRefresh https://github.com/leah/PullToRefresh MIT License
4 - OAuthConsumer https://github.com/jdg/oauthconsumer Apache License 2.0
5 - Reachability https://github.com/tonymillion/Reachability BSD License
6 - JSONKit https://github.com/johnezang/JSONKit Dual licensed BSD/Apache
7 - Modal UIAlertView/UIActionSheet http://code.google.com/p/modal-uialertview-uiactionsheet MIT License
8 - SVProgressHUD https://github.com/samvermette/SVProgressHUD MIT License
0\ No newline at end of file9\ No newline at end of file
110
=== removed directory 'Dependencies/JSONKit'
=== added directory 'Dependencies/JSONKit.framework'
=== added symlink 'Dependencies/JSONKit.framework/Headers'
=== target is u'Versions/Current/Headers'
=== added symlink 'Dependencies/JSONKit.framework/JSONKit'
=== target is u'Versions/Current/JSONKit'
=== added directory 'Dependencies/JSONKit.framework/Versions'
=== added directory 'Dependencies/JSONKit.framework/Versions/A'
=== added directory 'Dependencies/JSONKit.framework/Versions/A/Headers'
=== added file 'Dependencies/JSONKit.framework/Versions/A/Headers/JSONKit.h'
--- Dependencies/JSONKit.framework/Versions/A/Headers/JSONKit.h 1970-01-01 00:00:00 +0000
+++ Dependencies/JSONKit.framework/Versions/A/Headers/JSONKit.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,251 @@
1//
2// JSONKit.h
3// http://github.com/johnezang/JSONKit
4// Dual licensed under either the terms of the BSD License, or alternatively
5// under the terms of the Apache License, Version 2.0, as specified below.
6//
7
8/*
9 Copyright (c) 2011, John Engelhart
10
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15
16 * Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
18
19 * Redistributions in binary form must reproduce the above copyright
20 notice, this list of conditions and the following disclaimer in the
21 documentation and/or other materials provided with the distribution.
22
23 * Neither the name of the Zang Industries nor the names of its
24 contributors may be used to endorse or promote products derived from
25 this software without specific prior written permission.
26
27 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
33 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38*/
39
40/*
41 Copyright 2011 John Engelhart
42
43 Licensed under the Apache License, Version 2.0 (the "License");
44 you may not use this file except in compliance with the License.
45 You may obtain a copy of the License at
46
47 http://www.apache.org/licenses/LICENSE-2.0
48
49 Unless required by applicable law or agreed to in writing, software
50 distributed under the License is distributed on an "AS IS" BASIS,
51 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
52 See the License for the specific language governing permissions and
53 limitations under the License.
54*/
55
56#include <stddef.h>
57#include <stdint.h>
58#include <limits.h>
59#include <TargetConditionals.h>
60#include <AvailabilityMacros.h>
61
62#ifdef __OBJC__
63#import <Foundation/NSArray.h>
64#import <Foundation/NSData.h>
65#import <Foundation/NSDictionary.h>
66#import <Foundation/NSError.h>
67#import <Foundation/NSObjCRuntime.h>
68#import <Foundation/NSString.h>
69#endif // __OBJC__
70
71#ifdef __cplusplus
72extern "C" {
73#endif
74
75
76// For Mac OS X < 10.5.
77#ifndef NSINTEGER_DEFINED
78#define NSINTEGER_DEFINED
79#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
80typedef long NSInteger;
81typedef unsigned long NSUInteger;
82#define NSIntegerMin LONG_MIN
83#define NSIntegerMax LONG_MAX
84#define NSUIntegerMax ULONG_MAX
85#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
86typedef int NSInteger;
87typedef unsigned int NSUInteger;
88#define NSIntegerMin INT_MIN
89#define NSIntegerMax INT_MAX
90#define NSUIntegerMax UINT_MAX
91#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
92#endif // NSINTEGER_DEFINED
93
94
95#ifndef _JSONKIT_H_
96#define _JSONKIT_H_
97
98#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
99#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
100#else
101#define JK_DEPRECATED_ATTRIBUTE
102#endif
103
104#define JSONKIT_VERSION_MAJOR 1
105#define JSONKIT_VERSION_MINOR 4
106
107typedef NSUInteger JKFlags;
108
109/*
110 JKParseOptionComments : Allow C style // and /_* ... *_/ (without a _, obviously) comments in JSON.
111 JKParseOptionUnicodeNewlines : Allow Unicode recommended (?:\r\n|[\n\v\f\r\x85\p{Zl}\p{Zp}]) newlines.
112 JKParseOptionLooseUnicode : Normally the decoder will stop with an error at any malformed Unicode.
113 This option allows JSON with malformed Unicode to be parsed without reporting an error.
114 Any malformed Unicode is replaced with \uFFFD, or "REPLACEMENT CHARACTER".
115 */
116
117enum {
118 JKParseOptionNone = 0,
119 JKParseOptionStrict = 0,
120 JKParseOptionComments = (1 << 0),
121 JKParseOptionUnicodeNewlines = (1 << 1),
122 JKParseOptionLooseUnicode = (1 << 2),
123 JKParseOptionPermitTextAfterValidJSON = (1 << 3),
124 JKParseOptionValidFlags = (JKParseOptionComments | JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode | JKParseOptionPermitTextAfterValidJSON),
125};
126typedef JKFlags JKParseOptionFlags;
127
128enum {
129 JKSerializeOptionNone = 0,
130 JKSerializeOptionPretty = (1 << 0),
131 JKSerializeOptionEscapeUnicode = (1 << 1),
132 JKSerializeOptionEscapeForwardSlashes = (1 << 4),
133 JKSerializeOptionValidFlags = (JKSerializeOptionPretty | JKSerializeOptionEscapeUnicode | JKSerializeOptionEscapeForwardSlashes),
134};
135typedef JKFlags JKSerializeOptionFlags;
136
137#ifdef __OBJC__
138
139typedef struct JKParseState JKParseState; // Opaque internal, private type.
140
141// As a general rule of thumb, if you use a method that doesn't accept a JKParseOptionFlags argument, it defaults to JKParseOptionStrict
142
143@interface JSONDecoder : NSObject {
144 JKParseState *parseState;
145}
146+ (id)decoder;
147+ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
148- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
149- (void)clearCache;
150
151// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods.
152- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length: instead.
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.
154// The NSData MUST be UTF8 encoded JSON.
155- (id)parseJSONData:(NSData *)jsonData JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData: instead.
156- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData:error: instead.
157
158// Methods that return immutable collection objects.
159- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
160- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
161// The NSData MUST be UTF8 encoded JSON.
162- (id)objectWithData:(NSData *)jsonData;
163- (id)objectWithData:(NSData *)jsonData error:(NSError **)error;
164
165// Methods that return mutable collection objects.
166- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
167- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
168// The NSData MUST be UTF8 encoded JSON.
169- (id)mutableObjectWithData:(NSData *)jsonData;
170- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error;
171
172@end
173
174////////////
175#pragma mark Deserializing methods
176////////////
177
178@interface NSString (JSONKitDeserializing)
179- (id)objectFromJSONString;
180- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
181- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
182- (id)mutableObjectFromJSONString;
183- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
184- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
185@end
186
187@interface NSData (JSONKitDeserializing)
188// The NSData MUST be UTF8 encoded JSON.
189- (id)objectFromJSONData;
190- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
191- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
192- (id)mutableObjectFromJSONData;
193- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
194- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
195@end
196
197////////////
198#pragma mark Serializing methods
199////////////
200
201@interface NSString (JSONKitSerializing)
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).
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:
204// includeQuotes:YES `a "test"...` -> `"a \"test\"..."`
205// includeQuotes:NO `a "test"...` -> `a \"test\"...`
206- (NSData *)JSONData; // Invokes JSONDataWithOptions:JKSerializeOptionNone includeQuotes:YES
207- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
208- (NSString *)JSONString; // Invokes JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES
209- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
210@end
211
212@interface NSArray (JSONKitSerializing)
213- (NSData *)JSONData;
214- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
215- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
216- (NSString *)JSONString;
217- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
218- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
219@end
220
221@interface NSDictionary (JSONKitSerializing)
222- (NSData *)JSONData;
223- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
224- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
225- (NSString *)JSONString;
226- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
227- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
228@end
229
230#ifdef __BLOCKS__
231
232@interface NSArray (JSONKitSerializingBlockAdditions)
233- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
234- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
235@end
236
237@interface NSDictionary (JSONKitSerializingBlockAdditions)
238- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
239- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
240@end
241
242#endif
243
244
245#endif // __OBJC__
246
247#endif // _JSONKIT_H_
248
249#ifdef __cplusplus
250} // extern "C"
251#endif
0252
=== added file 'Dependencies/JSONKit.framework/Versions/A/JSONKit'
1Binary 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 differ253Binary 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
=== added symlink 'Dependencies/JSONKit.framework/Versions/Current'
=== target is u'A'
=== added directory 'Dependencies/Modal UIAlertView-UIActionSheet'
=== added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.h'
--- Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.h 1970-01-01 00:00:00 +0000
+++ Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,36 @@
1/*
2 Copyright (c) 2012, José Expósito
3
4 Permission is hereby granted, free of charge, to any
5 person obtaining a copy of this software and associated
6 documentation files (the "Software"), to deal in the
7 Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the
10 Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice
14 shall be included in all copies or substantial portions of
15 the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
18 KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
20 PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
21 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26#import <UIKit/UIKit.h>
27
28@interface UIActionSheet (Modal) <UIActionSheetDelegate>
29
30 - (NSInteger)showModalFromTabBar:(UITabBar *)view;
31 - (NSInteger)showModalFromToolbar:(UIToolbar *)view;
32 - (NSInteger)showModalInView:(UIView *)view;
33 - (NSInteger)showModalFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated;
34 - (NSInteger)showModalFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated;
35
36@end
037
=== added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.m'
--- Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.m 1970-01-01 00:00:00 +0000
+++ Dependencies/Modal UIAlertView-UIActionSheet/UIActionSheet+Modal.m 2013-04-26 15:39:24 +0000
@@ -0,0 +1,83 @@
1/*
2 Copyright (c) 2012, José Expósito
3
4 Permission is hereby granted, free of charge, to any
5 person obtaining a copy of this software and associated
6 documentation files (the "Software"), to deal in the
7 Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the
10 Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice
14 shall be included in all copies or substantial portions of
15 the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
18 KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
20 PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
21 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26#import "UIActionSheet+Modal.h"
27
28NSInteger returnButtonIndex;
29
30@implementation UIActionSheet(Modal)
31
32- (NSInteger)showModalFromTabBar:(UITabBar *)view
33{
34 self.delegate = self;
35 [self showFromTabBar:view];
36
37 CFRunLoopRun();
38 return returnButtonIndex;
39}
40
41- (NSInteger)showModalFromToolbar:(UIToolbar *)view
42{
43 self.delegate = self;
44 [self showFromToolbar:view];
45
46 CFRunLoopRun();
47 return returnButtonIndex;
48}
49
50- (NSInteger)showModalInView:(UIView *)view
51{
52 self.delegate = self;
53 [self showInView:view];
54
55 CFRunLoopRun();
56 return returnButtonIndex;
57}
58
59- (NSInteger)showModalFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated
60{
61 self.delegate = self;
62 [self showFromBarButtonItem:item animated:animated];
63
64 CFRunLoopRun();
65 return returnButtonIndex;
66}
67
68- (NSInteger)showModalFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated
69{
70 self.delegate = self;
71 [self showFromRect:rect inView:view animated:animated];
72
73 CFRunLoopRun();
74 return returnButtonIndex;
75}
76
77- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
78{
79 returnButtonIndex = buttonIndex;
80 CFRunLoopStop(CFRunLoopGetCurrent());
81}
82
83@end
084
=== added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.h'
--- Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.h 1970-01-01 00:00:00 +0000
+++ Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,32 @@
1/*
2 Copyright (c) 2012, José Expósito
3
4 Permission is hereby granted, free of charge, to any
5 person obtaining a copy of this software and associated
6 documentation files (the "Software"), to deal in the
7 Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the
10 Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice
14 shall be included in all copies or substantial portions of
15 the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
18 KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
20 PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
21 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26#import <UIKit/UIKit.h>
27
28@interface UIAlertView (Modal) <UIAlertViewDelegate>
29
30 - (NSInteger)showModal;
31
32@end
033
=== added file 'Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.m'
--- Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.m 1970-01-01 00:00:00 +0000
+++ Dependencies/Modal UIAlertView-UIActionSheet/UIAlertView+Modal.m 2013-04-26 15:39:24 +0000
@@ -0,0 +1,47 @@
1/*
2 Copyright (c) 2012, José Expósito
3
4 Permission is hereby granted, free of charge, to any
5 person obtaining a copy of this software and associated
6 documentation files (the "Software"), to deal in the
7 Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the
10 Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice
14 shall be included in all copies or substantial portions of
15 the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
18 KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
20 PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
21 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26#import "UIAlertView+Modal.h"
27
28NSInteger returnButtonIndex;
29
30@implementation UIAlertView (Modal)
31
32- (NSInteger)showModal
33{
34 self.delegate = self;
35 [self show];
36
37 CFRunLoopRun();
38 return returnButtonIndex;
39}
40
41- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
42{
43 returnButtonIndex = buttonIndex;
44 CFRunLoopStop(CFRunLoopGetCurrent());
45}
46
47@end
048
=== added directory 'Dependencies/OAuthConsumer.framework'
=== added symlink 'Dependencies/OAuthConsumer.framework/Headers'
=== target is u'Versions/Current/Headers'
=== added symlink 'Dependencies/OAuthConsumer.framework/OAuthConsumer'
=== target is u'Versions/Current/OAuthConsumer'
=== added directory 'Dependencies/OAuthConsumer.framework/Versions'
=== added directory 'Dependencies/OAuthConsumer.framework/Versions/A'
=== added directory 'Dependencies/OAuthConsumer.framework/Versions/A/Headers'
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/Base64Transcoder.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/Base64Transcoder.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/Base64Transcoder.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,36 @@
1/*
2 * Base64Transcoder.h
3 * Base64Test
4 *
5 * Created by Jonathan Wight on Tue Mar 18 2003.
6 * Copyright (c) 2003 Toxic Software. All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27
28#include <stdlib.h>
29#include <stdbool.h>
30
31extern size_t EstimateBas64EncodedDataSize(size_t inDataSize);
32extern size_t EstimateBas64DecodedDataSize(size_t inDataSize);
33
34extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize);
35extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize);
36
037
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSMutableURLRequest+Parameters.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSMutableURLRequest+Parameters.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSMutableURLRequest+Parameters.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,37 @@
1//
2// NSMutableURLRequest+Parameters.h
3//
4// Created by Jon Crosby on 10/19/07.
5// Copyright 2007 Kaboomerang LLC. All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25#import <Foundation/Foundation.h>
26#import "OARequestParameter.h"
27#import "NSURL+Base.h"
28
29
30@interface NSMutableURLRequest (OAParameterAdditions)
31
32@property(nonatomic, retain) NSArray *parameters;
33
34- (void)setHTTPBodyWithString:(NSString *)body;
35- (void)attachFileWithName:(NSString *)name filename:(NSString*)filename contentType:(NSString *)contentType data:(NSData*)data;
36
37@end
038
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSString+URLEncoding.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSString+URLEncoding.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSString+URLEncoding.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,35 @@
1//
2// NSString+URLEncoding.h
3//
4// Created by Jon Crosby on 10/19/07.
5// Copyright 2007 Kaboomerang LLC. All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25
26#import <Foundation/Foundation.h>
27
28
29@interface NSString (OAURLEncodingAdditions)
30
31- (NSString *)encodedURLString;
32- (NSString *)encodedURLParameterString;
33- (NSString *)decodedURLString;
34- (NSString *)removeQuotes;
35@end
036
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSURL+Base.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSURL+Base.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/NSURL+Base.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,34 @@
1//
2// NSURL+Base.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28
29
30@interface NSURL (OABaseAdditions)
31
32- (NSString *)URLStringWithoutQuery;
33
34@end
035
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAAttachment.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAAttachment.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAAttachment.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,26 @@
1//
2// OAAttachment.h
3// Zeus
4//
5// Created by Jamie Pinkham on 2/3/11.
6// Copyright 2011 Tumblr. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11
12@interface OAAttachment : NSObject {
13 NSString *name;
14 NSString *fileName;
15 NSString *contentType;
16 NSData *data;
17}
18
19@property (nonatomic, copy) NSString *name;
20@property (nonatomic, copy) NSString *fileName;
21@property (nonatomic, copy) NSString *contentType;
22@property (nonatomic, copy) NSData *data;
23
24- (id)initWithName:(NSString *)aName filename:(NSString *)aFilename contentType:(NSString *)aContentType data:(NSData *)aData;
25
26@end
027
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OACall.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OACall.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OACall.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,63 @@
1//
2// OACall.h
3// OAuthConsumer
4//
5// Created by Alberto García Hierro on 04/09/08.
6// Copyright 2008 Alberto García Hierro. All rights reserved.
7// bynotes.com
8
9#import <Foundation/Foundation.h>
10
11@class OAProblem;
12@class OACall;
13
14@protocol OACallDelegate
15
16- (void)call:(OACall *)call failedWithError:(NSError *)error;
17- (void)call:(OACall *)call failedWithProblem:(OAProblem *)problem;
18
19@end
20
21@class OAConsumer;
22@class OAToken;
23@class OADataFetcher;
24@class OAMutableURLRequest;
25@class OAServiceTicket;
26
27@interface OACall : NSObject {
28 NSURL *url;
29 NSString *method;
30 NSArray *parameters;
31 NSDictionary *files;
32 NSObject <OACallDelegate> *delegate;
33 SEL finishedSelector;
34 OADataFetcher *fetcher;
35 OAMutableURLRequest *request;
36 OAServiceTicket *ticket;
37}
38
39@property(readonly) NSURL *url;
40@property(readonly) NSString *method;
41@property(readonly) NSArray *parameters;
42@property(readonly) NSDictionary *files;
43@property(nonatomic, retain) OAServiceTicket *ticket;
44
45- (id)init;
46- (id)initWithURL:(NSURL *)aURL;
47- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod;
48- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters;
49- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters;
50- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters files:(NSDictionary*)theFiles;
51
52- (id)initWithURL:(NSURL *)aURL
53 method:(NSString *)aMethod
54 parameters:(NSArray *)theParameters
55 files:(NSDictionary*)theFiles;
56
57- (void)perform:(OAConsumer *)consumer
58 token:(OAToken *)token
59 realm:(NSString *)realm
60 delegate:(NSObject <OACallDelegate> *)aDelegate
61 didFinish:(SEL)finished;
62
63@end
064
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAConsumer.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAConsumer.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAConsumer.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,42 @@
1//
2// OAConsumer.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28
29
30@interface OAConsumer : NSObject {
31@protected
32 NSString *key;
33 NSString *secret;
34}
35@property(copy, readwrite) NSString *key;
36@property(copy, readwrite) NSString *secret;
37
38- (id)initWithKey:(const NSString *)aKey secret:(const NSString *)aSecret;
39
40- (BOOL)isEqualToConsumer:(OAConsumer *)aConsumer;
41
42@end
043
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OADataFetcher.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OADataFetcher.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OADataFetcher.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,44 @@
1//
2// OADataFetcher.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 11/5/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26#import <Foundation/Foundation.h>
27#import "OAMutableURLRequest.h"
28#import "OAServiceTicket.h"
29
30
31@interface OADataFetcher : NSObject {
32@private
33 OAMutableURLRequest *request;
34 NSURLResponse *response;
35 NSURLConnection *connection;
36 NSMutableData *responseData;
37 id delegate;
38 SEL didFinishSelector;
39 SEL didFailSelector;
40}
41
42- (void)fetchDataWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector;
43
44@end
045
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAHMAC_SHA1SignatureProvider.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAHMAC_SHA1SignatureProvider.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAHMAC_SHA1SignatureProvider.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,32 @@
1//
2// OAHMAC_SHA1SignatureProvider.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28#import "OASignatureProviding.h"
29
30
31@interface OAHMAC_SHA1SignatureProvider : NSObject <OASignatureProviding>
32@end
033
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAMutableURLRequest.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAMutableURLRequest.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAMutableURLRequest.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,65 @@
1//
2// OAMutableURLRequest.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28#import "OAConsumer.h"
29#import "OAToken.h"
30#import "OAHMAC_SHA1SignatureProvider.h"
31#import "OASignatureProviding.h"
32#import "NSMutableURLRequest+Parameters.h"
33#import "NSURL+Base.h"
34
35
36@interface OAMutableURLRequest : NSMutableURLRequest {
37@protected
38 OAConsumer *consumer;
39 OAToken *token;
40 NSString *realm;
41 NSString *signature;
42 id<OASignatureProviding> signatureProvider;
43 NSString *nonce;
44 NSString *timestamp;
45}
46@property(readonly) NSString *signature;
47@property(readonly) NSString *nonce;
48
49- (id)initWithURL:(NSURL *)aUrl
50 consumer:(OAConsumer *)aConsumer
51 token:(OAToken *)aToken
52 realm:(NSString *)aRealm
53signatureProvider:(id<OASignatureProviding>)aProvider;
54
55- (id)initWithURL:(NSURL *)aUrl
56 consumer:(OAConsumer *)aConsumer
57 token:(OAToken *)aToken
58 realm:(NSString *)aRealm
59signatureProvider:(id<OASignatureProviding>)aProvider
60 nonce:(NSString *)aNonce
61 timestamp:(NSString *)aTimestamp;
62
63- (void)prepare;
64
65@end
066
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAPlaintextSignatureProvider.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAPlaintextSignatureProvider.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAPlaintextSignatureProvider.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,31 @@
1//
2// OAPlaintextSignatureProvider.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28#import "OASignatureProviding.h"
29
30@interface OAPlaintextSignatureProvider : NSObject <OASignatureProviding>
31@end
032
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAProblem.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAProblem.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAProblem.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,53 @@
1//
2// OAProblem.h
3// OAuthConsumer
4//
5// Created by Alberto García Hierro on 03/09/08.
6// Copyright 2008 Alberto García Hierro. All rights reserved.
7// bynotes.com
8
9#import <Foundation/Foundation.h>
10
11enum {
12 kOAProblemSignatureMethodRejected = 0,
13 kOAProblemParameterAbsent,
14 kOAProblemVersionRejected,
15 kOAProblemConsumerKeyUnknown,
16 kOAProblemTokenRejected,
17 kOAProblemSignatureInvalid,
18 kOAProblemNonceUsed,
19 kOAProblemTimestampRefused,
20 kOAProblemTokenExpired,
21 kOAProblemTokenNotRenewable
22};
23
24@interface OAProblem : NSObject {
25 NSString *problem;
26}
27
28@property (readonly) NSString *problem;
29
30- (id)initWithProblem:(NSString *)aProblem;
31- (id)initWithResponseBody:(NSString *)response;
32
33- (BOOL)isEqualToProblem:(OAProblem *)aProblem;
34- (BOOL)isEqualToString:(NSString *)aProblem;
35- (BOOL)isEqualTo:(id)aProblem;
36- (int)code;
37
38+ (OAProblem *)problemWithResponseBody:(NSString *)response;
39
40+ (NSArray *)validProblems;
41
42+ (OAProblem *)SignatureMethodRejected;
43+ (OAProblem *)ParameterAbsent;
44+ (OAProblem *)VersionRejected;
45+ (OAProblem *)ConsumerKeyUnknown;
46+ (OAProblem *)TokenRejected;
47+ (OAProblem *)SignatureInvalid;
48+ (OAProblem *)NonceUsed;
49+ (OAProblem *)TimestampRefused;
50+ (OAProblem *)TokenExpired;
51+ (OAProblem *)TokenNotRenewable;
52
53@end
054
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OARequestParameter.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OARequestParameter.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OARequestParameter.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,48 @@
1//
2// OARequestParameter.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28#import "NSString+URLEncoding.h"
29
30
31@interface OARequestParameter : NSObject {
32@protected
33 NSString *name;
34 NSString *value;
35}
36@property(copy, readwrite) NSString *name;
37@property(copy, readwrite) NSString *value;
38
39- (id)initWithName:(NSString *)aName value:(NSString *)aValue;
40- (NSString *)URLEncodedName;
41- (NSString *)URLEncodedValue;
42- (NSString *)URLEncodedNameValuePair;
43
44- (BOOL)isEqualToRequestParameter:(OARequestParameter *)parameter;
45
46+ (id)requestParameter:(NSString *)aName value:(NSString *)aValue;
47
48@end
049
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAServiceTicket.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAServiceTicket.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAServiceTicket.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,46 @@
1//
2// OAServiceTicket.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 11/5/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28#import "OAMutableURLRequest.h"
29
30
31@interface OAServiceTicket : NSObject {
32@private
33 OAMutableURLRequest *request;
34 NSURLResponse *response;
35 NSData *data;
36 BOOL didSucceed;
37}
38@property(readonly) OAMutableURLRequest *request;
39@property(readonly) NSURLResponse *response;
40@property(readonly) NSData *data;
41@property(readonly) BOOL didSucceed;
42@property(readonly) NSString *body;
43
44- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSURLResponse *)aResponse data:(NSData *)aData didSucceed:(BOOL)success;
45
46@end
047
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OASignatureProviding.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OASignatureProviding.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OASignatureProviding.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,34 @@
1//
2// OASignatureProviding.h
3//
4// Created by Jon Crosby on 10/19/07.
5// Copyright 2007 Kaboomerang LLC. All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25
26#import <Foundation/Foundation.h>
27
28
29@protocol OASignatureProviding <NSObject>
30
31- (NSString *)name;
32- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret;
33
34@end
035
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAToken.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAToken.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAToken.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,73 @@
1//
2// OAToken.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26#import <Foundation/Foundation.h>
27
28@interface OAToken : NSObject <NSCoding> {
29@protected
30 NSString *key;
31 NSString *secret;
32 NSString *session;
33 NSNumber *duration;
34 NSMutableDictionary *attributes;
35 NSDate *created;
36 BOOL renewable;
37 BOOL forRenewal;
38}
39@property(retain, readwrite) NSString *key;
40@property(retain, readwrite) NSString *secret;
41@property(retain, readwrite) NSString *session;
42@property(retain, readwrite) NSNumber *duration;
43@property(retain, readwrite) NSString *verifier;
44@property(nonatomic, retain, readwrite) NSDictionary *attributes;
45@property(readwrite, getter=isForRenewal) BOOL forRenewal;
46
47- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret;
48- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret session:(NSString *)aSession
49 duration:(NSNumber *)aDuration attributes:(NSDictionary *)theAttributes created:(NSDate *)creation
50 renewable:(BOOL)renew;
51- (id)initWithHTTPResponseBody:(NSString *)body;
52
53- (id)initWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix;
54- (int)storeInUserDefaultsWithServiceProviderName:(NSString *)provider prefix:(NSString *)prefix;
55
56- (BOOL)isValid;
57
58- (void)setAttribute:(NSString *)aKey value:(NSString *)aValue;
59- (NSString *)attribute:(NSString *)aKey;
60- (void)setAttributesWithString:(NSString *)aAttributes;
61- (NSString *)attributeString;
62
63- (BOOL)hasExpired;
64- (BOOL)isRenewable;
65- (void)setDurationWithString:(NSString *)aDuration;
66- (BOOL)hasAttributes;
67- (NSDictionary *)parameters;
68
69- (BOOL)isEqualToToken:(OAToken *)aToken;
70
71+ (void)removeFromUserDefaultsWithServiceProviderName:(const NSString *)provider prefix:(const NSString *)prefix;
72
73@end
074
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OATokenManager.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OATokenManager.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OATokenManager.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,68 @@
1//
2// OATokenManager.h
3// OAuthConsumer
4//
5// Created by Alberto García Hierro on 01/09/08.
6// Copyright 2008 Alberto García Hierro. All rights reserved.
7// bynotes.com
8
9#import <Foundation/Foundation.h>
10
11#import "OACall.h"
12
13@class OATokenManager;
14
15@protocol OATokenManagerDelegate
16
17- (BOOL)tokenManager:(OATokenManager *)manager failedCall:(OACall *)call withError:(NSError *)error;
18- (BOOL)tokenManager:(OATokenManager *)manager failedCall:(OACall *)call withProblem:(OAProblem *)problem;
19
20@optional
21
22- (BOOL)tokenManagerNeedsToken:(OATokenManager *)manager;
23
24@end
25
26@class OAConsumer;
27@class OAToken;
28
29@interface OATokenManager : NSObject<OACallDelegate> {
30 OAConsumer *consumer;
31 OAToken *acToken;
32 OAToken *reqToken;
33 OAToken *initialToken;
34 NSString *authorizedTokenKey;
35 NSString *oauthBase;
36 NSString *realm;
37 NSString *callback;
38 NSObject <OATokenManagerDelegate> *delegate;
39 NSMutableArray *calls;
40 NSMutableArray *selectors;
41 NSMutableDictionary *delegates;
42 BOOL isDispatching;
43}
44
45
46- (id)init;
47
48- (id)initWithConsumer:(OAConsumer *)aConsumer token:(OAToken *)aToken oauthBase:(const NSString *)base
49 realm:(const NSString *)aRealm callback:(const NSString *)aCallback
50 delegate:(NSObject <OATokenManagerDelegate> *)aDelegate;
51
52- (void)authorizedToken:(const NSString *)key;
53
54- (void)fetchData:(NSString *)aURL finished:(SEL)didFinish;
55
56- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters
57 finished:(SEL)didFinish;
58
59- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters
60 files:(NSDictionary *)theFiles finished:(SEL)didFinish;
61
62- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters
63 files:(NSDictionary *)theFiles finished:(SEL)didFinish delegate:(NSObject*)aDelegate;
64
65- (void)call:(OACall *)call failedWithError:(NSError *)error;
66- (void)call:(OACall *)call failedWithProblem:(OAProblem *)problem;
67
68@end
069
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAuthConsumer.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAuthConsumer.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/OAuthConsumer.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,40 @@
1//
2// OAuthConsumer.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26#import <Foundation/Foundation.h>
27#import "OAProblem.h"
28#import "OAToken.h"
29#import "OAConsumer.h"
30#import "OAMutableURLRequest.h"
31#import "NSString+URLEncoding.h"
32#import "NSMutableURLRequest+Parameters.h"
33#import "NSURL+Base.h"
34#import "OASignatureProviding.h"
35#import "OAHMAC_SHA1SignatureProvider.h"
36#import "OAPlaintextSignatureProvider.h"
37#import "OARequestParameter.h"
38#import "OAServiceTicket.h"
39#import "OADataFetcher.h"
40#import "OATokenManager.h"
0\ No newline at end of file41\ No newline at end of file
142
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/hmac.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/hmac.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/hmac.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,31 @@
1//
2// hmac.h
3// OAuthConsumer
4//
5// Created by Jonathan Wight on 4/8/8.
6// Copyright 2008 Jonathan Wight. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26#ifndef HMAC_H
27#define HMAC_H 1
28
29extern void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, const size_t inKeyLength, u_int8_t *outDigest);
30
31#endif /* HMAC_H */
0\ No newline at end of file32\ No newline at end of file
133
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/Headers/sha1.h'
--- Dependencies/OAuthConsumer.framework/Versions/A/Headers/sha1.h 1970-01-01 00:00:00 +0000
+++ Dependencies/OAuthConsumer.framework/Versions/A/Headers/sha1.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,13 @@
1#include <sys/types.h>
2
3// From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c
4
5typedef struct {
6 u_int32_t state[5];
7 u_int32_t count[2];
8 u_int8_t buffer[64];
9} SHA1_CTX;
10
11extern void SHA1Init(SHA1_CTX* context);
12extern void SHA1Update(SHA1_CTX* context, u_int8_t* data, u_int32_t len);
13extern void SHA1Final(u_int8_t digest[20], SHA1_CTX* context);
014
=== added file 'Dependencies/OAuthConsumer.framework/Versions/A/OAuthConsumer'
1Binary 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 differ15Binary 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
=== added symlink 'Dependencies/OAuthConsumer.framework/Versions/Current'
=== target is u'A'
=== removed directory 'Dependencies/PullToRefresh'
=== added directory 'Dependencies/PullToRefresh.framework'
=== added directory 'Dependencies/PullToRefresh.framework/Headers'
=== added file 'Dependencies/PullToRefresh.framework/Headers/PullRefreshTableViewController.h'
--- Dependencies/PullToRefresh.framework/Headers/PullRefreshTableViewController.h 1970-01-01 00:00:00 +0000
+++ Dependencies/PullToRefresh.framework/Headers/PullRefreshTableViewController.h 2013-04-26 15:39:24 +0000
@@ -0,0 +1,77 @@
1//
2// PullRefreshTableViewController.h
3// Plancast
4//
5// Created by Leah Culver on 7/2/10.
6// Copyright (c) 2010 Leah Culver
7//
8// Permission is hereby granted, free of charge, to any person
9// obtaining a copy of this software and associated documentation
10// files (the "Software"), to deal in the Software without
11// restriction, including without limitation the rights to use,
12// copy, modify, merge, publish, distribute, sublicense, and/or sell
13// copies of the Software, and to permit persons to whom the
14// Software is furnished to do so, subject to the following
15// conditions:
16//
17// The above copyright notice and this permission notice shall be
18// included in all copies or substantial portions of the Software.
19//
20// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27// OTHER DEALINGS IN THE SOFTWARE.
28//
29
30#import <UIKit/UIKit.h>
31
32
33@interface PullRefreshTableViewController : UITableViewController {
34 UIView *refreshHeaderView;
35 UILabel *refreshLabel;
36 UIImageView *refreshArrow;
37 UIActivityIndicatorView *refreshSpinner;
38 BOOL isDragging;
39 BOOL isLoading;
40 NSString *textPull;
41 NSString *textRelease;
42 NSString *textLoading;
43}
44
45#ifndef PTR_STRONG
46#if __has_feature(objc_arc)
47#define PTR_STRONG strong
48#else
49#define PTR_STRONG retain
50#endif
51#endif
52
53#ifndef PTR_WEAK
54#if __has_feature(objc_arc_weak)
55#define PTR_WEAK weak
56#elif __has_feature(objc_arc)
57#define PTR_WEAK unsafe_unretained
58#else
59#define PTR_WEAK assign
60#endif
61#endif
62
63@property (nonatomic, PTR_STRONG) UIView *refreshHeaderView;
64@property (nonatomic, PTR_STRONG) UILabel *refreshLabel;
65@property (nonatomic, PTR_STRONG) UIImageView *refreshArrow;
66@property (nonatomic, PTR_STRONG) UIActivityIndicatorView *refreshSpinner;
67@property (nonatomic, copy) NSString *textPull;
68@property (nonatomic, copy) NSString *textRelease;
69@property (nonatomic, copy) NSString *textLoading;
70
71- (void)setupStrings;
72- (void)addPullToRefreshHeader;
73- (void)startLoading;
74- (void)stopLoading;
75- (void)refresh;
76
77@end
078
=== added file 'Dependencies/PullToRefresh.framework/PullToRefresh'
1Binary files Dependencies/PullToRefresh.framework/PullToRefresh 1970-01-01 00:00:00 +0000 and Dependencies/PullToRefresh.framework/PullToRefresh 2013-04-26 15:39:24 +0000 differ79Binary 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
=== added file 'Dependencies/PullToRefresh.framework/arrow.png'
2Binary 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 differ80Binary 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
=== removed file 'Dependencies/PullToRefresh/.gitignore'
--- Dependencies/PullToRefresh/.gitignore 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/.gitignore 1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
1# Xcode
2build/*
3*.pbxuser
4!default.pbxuser
5*.mode1v3
6!default.mode1v3
7*.mode2v3
8!default.mode2v3
9*.perspectivev3
10!default.perspectivev3
11*.xcworkspace
12!default.xcworkspace
13xcuserdata
14profile
15*.moved-aside
160
=== removed directory 'Dependencies/PullToRefresh/Classes'
=== removed file 'Dependencies/PullToRefresh/Classes/DemoTableViewController.h'
--- Dependencies/PullToRefresh/Classes/DemoTableViewController.h 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/Classes/DemoTableViewController.h 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1//
2// RootViewController.h
3// PullToRefresh
4//
5// Created by Leah Culver on 7/25/10.
6// Copyright Plancast 2010. All rights reserved.
7//
8
9#import <UIKit/UIKit.h>
10#import "PullRefreshTableViewController.h"
11
12@interface DemoTableViewController : PullRefreshTableViewController {
13 NSMutableArray *items;
14}
15
16@end
170
=== removed file 'Dependencies/PullToRefresh/Classes/DemoTableViewController.m'
--- Dependencies/PullToRefresh/Classes/DemoTableViewController.m 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/Classes/DemoTableViewController.m 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
1//
2// RootViewController.m
3// PullToRefresh
4//
5// Created by Leah Culver on 7/25/10.
6// Copyright Plancast 2010. All rights reserved.
7//
8
9#import "DemoTableViewController.h"
10
11
12@implementation DemoTableViewController
13
14- (void)viewDidLoad {
15 [super viewDidLoad];
16
17 self.title = @"Pull to Refresh";
18 items = [[NSMutableArray alloc] initWithObjects:@"What time is it?", nil];
19}
20
21- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
22 return 1;
23}
24
25- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
26 return [items count];
27}
28
29- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
30
31 static NSString *CellIdentifier = @"CellIdentifier";
32 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
33 if (cell == nil) {
34 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
35 }
36
37 cell.textLabel.text = [items objectAtIndex:indexPath.row];
38 cell.selectionStyle = UITableViewCellSelectionStyleNone;
39
40 return cell;
41}
42
43- (void)refresh {
44 [self performSelector:@selector(addItem) withObject:nil afterDelay:2.0];
45}
46
47- (void)addItem {
48 // Add a new time
49 NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
50 [dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
51 NSString *now = [dateFormatter stringFromDate:[NSDate date]];
52 [items insertObject:[NSString stringWithFormat:@"%@", now] atIndex:0];
53
54 [self.tableView reloadData];
55
56 [self stopLoading];
57}
58
59- (void)dealloc {
60 [items release];
61 [super dealloc];
62}
63
64@end
65
660
=== removed file 'Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.h'
--- Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.h 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.h 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1//
2// PullRefreshTableViewController.h
3// Plancast
4//
5// Created by Leah Culver on 7/2/10.
6// Copyright (c) 2010 Leah Culver
7//
8// Permission is hereby granted, free of charge, to any person
9// obtaining a copy of this software and associated documentation
10// files (the "Software"), to deal in the Software without
11// restriction, including without limitation the rights to use,
12// copy, modify, merge, publish, distribute, sublicense, and/or sell
13// copies of the Software, and to permit persons to whom the
14// Software is furnished to do so, subject to the following
15// conditions:
16//
17// The above copyright notice and this permission notice shall be
18// included in all copies or substantial portions of the Software.
19//
20// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27// OTHER DEALINGS IN THE SOFTWARE.
28//
29
30#import <UIKit/UIKit.h>
31
32
33@interface PullRefreshTableViewController : UITableViewController {
34 UIView *refreshHeaderView;
35 UILabel *refreshLabel;
36 UIImageView *refreshArrow;
37 UIActivityIndicatorView *refreshSpinner;
38 BOOL isDragging;
39 BOOL isLoading;
40 NSString *textPull;
41 NSString *textRelease;
42 NSString *textLoading;
43}
44
45@property (nonatomic, retain) UIView *refreshHeaderView;
46@property (nonatomic, retain) UILabel *refreshLabel;
47@property (nonatomic, retain) UIImageView *refreshArrow;
48@property (nonatomic, retain) UIActivityIndicatorView *refreshSpinner;
49@property (nonatomic, copy) NSString *textPull;
50@property (nonatomic, copy) NSString *textRelease;
51@property (nonatomic, copy) NSString *textLoading;
52
53- (void)setupStrings;
54- (void)addPullToRefreshHeader;
55- (void)startLoading;
56- (void)stopLoading;
57- (void)refresh;
58
59@end
600
=== removed file 'Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.m'
--- Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.m 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/Classes/PullRefreshTableViewController.m 1970-01-01 00:00:00 +0000
@@ -1,188 +0,0 @@
1//
2// PullRefreshTableViewController.m
3// Plancast
4//
5// Created by Leah Culver on 7/2/10.
6// Copyright (c) 2010 Leah Culver
7//
8// Permission is hereby granted, free of charge, to any person
9// obtaining a copy of this software and associated documentation
10// files (the "Software"), to deal in the Software without
11// restriction, including without limitation the rights to use,
12// copy, modify, merge, publish, distribute, sublicense, and/or sell
13// copies of the Software, and to permit persons to whom the
14// Software is furnished to do so, subject to the following
15// conditions:
16//
17// The above copyright notice and this permission notice shall be
18// included in all copies or substantial portions of the Software.
19//
20// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27// OTHER DEALINGS IN THE SOFTWARE.
28//
29
30#import <QuartzCore/QuartzCore.h>
31#import "PullRefreshTableViewController.h"
32
33#define REFRESH_HEADER_HEIGHT 52.0f
34
35
36@implementation PullRefreshTableViewController
37
38@synthesize textPull, textRelease, textLoading, refreshHeaderView, refreshLabel, refreshArrow, refreshSpinner;
39
40- (id)initWithStyle:(UITableViewStyle)style {
41 self = [super initWithStyle:style];
42 if (self != nil) {
43 [self setupStrings];
44 }
45 return self;
46}
47
48- (id)initWithCoder:(NSCoder *)aDecoder {
49 self = [super initWithCoder:aDecoder];
50 if (self != nil) {
51 [self setupStrings];
52 }
53 return self;
54}
55
56- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
57 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
58 if (self != nil) {
59 [self setupStrings];
60 }
61 return self;
62}
63
64- (void)viewDidLoad {
65 [super viewDidLoad];
66 [self addPullToRefreshHeader];
67}
68
69- (void)setupStrings{
70 textPull = [[NSString alloc] initWithString:@"Pull down to refresh..."];
71 textRelease = [[NSString alloc] initWithString:@"Release to refresh..."];
72 textLoading = [[NSString alloc] initWithString:@"Loading..."];
73}
74
75- (void)addPullToRefreshHeader {
76 refreshHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0 - REFRESH_HEADER_HEIGHT, 320, REFRESH_HEADER_HEIGHT)];
77 refreshHeaderView.backgroundColor = [UIColor clearColor];
78
79 refreshLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, REFRESH_HEADER_HEIGHT)];
80 refreshLabel.backgroundColor = [UIColor clearColor];
81 refreshLabel.font = [UIFont boldSystemFontOfSize:12.0];
82 refreshLabel.textAlignment = UITextAlignmentCenter;
83
84 refreshArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]];
85 refreshArrow.frame = CGRectMake(floorf((REFRESH_HEADER_HEIGHT - 27) / 2),
86 (floorf(REFRESH_HEADER_HEIGHT - 44) / 2),
87 27, 44);
88
89 refreshSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
90 refreshSpinner.frame = CGRectMake(floorf(floorf(REFRESH_HEADER_HEIGHT - 20) / 2), floorf((REFRESH_HEADER_HEIGHT - 20) / 2), 20, 20);
91 refreshSpinner.hidesWhenStopped = YES;
92
93 [refreshHeaderView addSubview:refreshLabel];
94 [refreshHeaderView addSubview:refreshArrow];
95 [refreshHeaderView addSubview:refreshSpinner];
96 [self.tableView addSubview:refreshHeaderView];
97}
98
99- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
100 if (isLoading) return;
101 isDragging = YES;
102}
103
104- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
105 if (isLoading) {
106 // Update the content inset, good for section headers
107 if (scrollView.contentOffset.y > 0)
108 self.tableView.contentInset = UIEdgeInsetsZero;
109 else if (scrollView.contentOffset.y >= -REFRESH_HEADER_HEIGHT)
110 self.tableView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
111 } else if (isDragging && scrollView.contentOffset.y < 0) {
112 // Update the arrow direction and label
113 [UIView beginAnimations:nil context:NULL];
114 if (scrollView.contentOffset.y < -REFRESH_HEADER_HEIGHT) {
115 // User is scrolling above the header
116 refreshLabel.text = self.textRelease;
117 [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI, 0, 0, 1);
118 } else { // User is scrolling somewhere within the header
119 refreshLabel.text = self.textPull;
120 [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1);
121 }
122 [UIView commitAnimations];
123 }
124}
125
126- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
127 if (isLoading) return;
128 isDragging = NO;
129 if (scrollView.contentOffset.y <= -REFRESH_HEADER_HEIGHT) {
130 // Released above the header
131 [self startLoading];
132 }
133}
134
135- (void)startLoading {
136 isLoading = YES;
137
138 // Show the header
139 [UIView beginAnimations:nil context:NULL];
140 [UIView setAnimationDuration:0.3];
141 self.tableView.contentInset = UIEdgeInsetsMake(REFRESH_HEADER_HEIGHT, 0, 0, 0);
142 refreshLabel.text = self.textLoading;
143 refreshArrow.hidden = YES;
144 [refreshSpinner startAnimating];
145 [UIView commitAnimations];
146
147 // Refresh action!
148 [self refresh];
149}
150
151- (void)stopLoading {
152 isLoading = NO;
153
154 // Hide the header
155 [UIView beginAnimations:nil context:NULL];
156 [UIView setAnimationDelegate:self];
157 [UIView setAnimationDuration:0.3];
158 [UIView setAnimationDidStopSelector:@selector(stopLoadingComplete:finished:context:)];
159 self.tableView.contentInset = UIEdgeInsetsZero;
160 [refreshArrow layer].transform = CATransform3DMakeRotation(M_PI * 2, 0, 0, 1);
161 [UIView commitAnimations];
162}
163
164- (void)stopLoadingComplete:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
165 // Reset the header
166 refreshLabel.text = self.textPull;
167 refreshArrow.hidden = NO;
168 [refreshSpinner stopAnimating];
169}
170
171- (void)refresh {
172 // This is just a demo. Override this method with your custom reload action.
173 // Don't forget to call stopLoading at the end.
174 [self performSelector:@selector(stopLoading) withObject:nil afterDelay:2.0];
175}
176
177- (void)dealloc {
178 [refreshHeaderView release];
179 [refreshLabel release];
180 [refreshArrow release];
181 [refreshSpinner release];
182 [textPull release];
183 [textRelease release];
184 [textLoading release];
185 [super dealloc];
186}
187
188@end
1890
=== removed file 'Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.h'
--- Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.h 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.h 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
1//
2// PullToRefreshAppDelegate.h
3// PullToRefresh
4//
5// Created by Leah Culver on 7/25/10.
6// Copyright Plancast 2010. All rights reserved.
7//
8
9#import <UIKit/UIKit.h>
10
11@interface PullToRefreshAppDelegate : NSObject <UIApplicationDelegate> {
12 UIWindow *window;
13 UINavigationController *navigationController;
14}
15
16@property (nonatomic, retain) UIWindow *window;
17@property (nonatomic, retain) UINavigationController *navigationController;
18
19@end
20
210
=== removed file 'Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.m'
--- Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.m 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/Classes/PullToRefreshAppDelegate.m 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
1//
2// PullToRefreshAppDelegate.m
3// PullToRefresh
4//
5// Created by Leah Culver on 7/25/10.
6// Copyright Plancast 2010. All rights reserved.
7//
8
9#import "PullToRefreshAppDelegate.h"
10#import "DemoTableViewController.h"
11
12
13@implementation PullToRefreshAppDelegate
14
15@synthesize window;
16@synthesize navigationController;
17
18
19- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20
21 CGRect screenBounds = [[UIScreen mainScreen] bounds];
22 self.window = [[[UIWindow alloc] initWithFrame: screenBounds] autorelease];
23
24 DemoTableViewController *demoTableViewController = [[[DemoTableViewController alloc] init] autorelease];
25 navigationController = [[UINavigationController alloc] initWithRootViewController:demoTableViewController];
26
27 [window addSubview:navigationController.view];
28 [window makeKeyAndVisible];
29
30 return YES;
31}
32
33- (void)dealloc {
34 [navigationController release];
35 [window release];
36 [super dealloc];
37}
38
39
40@end
41
420
=== removed file 'Dependencies/PullToRefresh/LICENSE'
--- Dependencies/PullToRefresh/LICENSE 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/LICENSE 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
1Copyright (c) 2010 Leah Culver
2
3Permission is hereby granted, free of charge, to any person obtaining
4a copy of this software and associated documentation files (the
5"Software"), to deal in the Software without restriction, including
6without limitation the rights to use, copy, modify, merge, publish,
7distribute, sublicense, and/or sell copies of the Software, and to
8permit persons to whom the Software is furnished to do so, subject to
9the following conditions:
10
11The above copyright notice and this permission notice shall be
12included in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
210
=== removed file 'Dependencies/PullToRefresh/PullToRefresh-Info.plist'
--- Dependencies/PullToRefresh/PullToRefresh-Info.plist 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/PullToRefresh-Info.plist 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>CFBundleDevelopmentRegion</key>
6 <string>English</string>
7 <key>CFBundleDisplayName</key>
8 <string>${PRODUCT_NAME}</string>
9 <key>CFBundleExecutable</key>
10 <string>${EXECUTABLE_NAME}</string>
11 <key>CFBundleIconFile</key>
12 <string></string>
13 <key>CFBundleIdentifier</key>
14 <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
15 <key>CFBundleInfoDictionaryVersion</key>
16 <string>6.0</string>
17 <key>CFBundleName</key>
18 <string>${PRODUCT_NAME}</string>
19 <key>CFBundlePackageType</key>
20 <string>APPL</string>
21 <key>CFBundleSignature</key>
22 <string>????</string>
23 <key>CFBundleVersion</key>
24 <string>1.0</string>
25 <key>LSRequiresIPhoneOS</key>
26 <true/>
27</dict>
28</plist>
290
=== removed directory 'Dependencies/PullToRefresh/PullToRefresh.xcodeproj'
=== removed file 'Dependencies/PullToRefresh/PullToRefresh.xcodeproj/project.pbxproj'
--- Dependencies/PullToRefresh/PullToRefresh.xcodeproj/project.pbxproj 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/PullToRefresh.xcodeproj/project.pbxproj 1970-01-01 00:00:00 +0000
@@ -1,268 +0,0 @@
1// !$*UTF8*$!
2{
3 archiveVersion = 1;
4 classes = {
5 };
6 objectVersion = 45;
7 objects = {
8
9/* Begin PBXBuildFile section */
10 1D3623260D0F684500981E51 /* PullToRefreshAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* PullToRefreshAppDelegate.m */; };
11 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
12 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
13 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
14 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; };
15 28C286E10D94DF7D0034E888 /* DemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */; };
16 4CAFBC8011FC96FC00651784 /* PullRefreshTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */; };
17 4CAFBCEF11FC994F00651784 /* README.markdown in Resources */ = {isa = PBXBuildFile; fileRef = 4CAFBCEE11FC994F00651784 /* README.markdown */; };
18 4CAFBD0111FC9B2100651784 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */; };
19 4CBE3BEE11FE21CB007696B3 /* arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CBE3BED11FE21CB007696B3 /* arrow.png */; };
20/* End PBXBuildFile section */
21
22/* Begin PBXFileReference section */
23 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
24 1D3623240D0F684500981E51 /* PullToRefreshAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullToRefreshAppDelegate.h; sourceTree = "<group>"; };
25 1D3623250D0F684500981E51 /* PullToRefreshAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PullToRefreshAppDelegate.m; sourceTree = "<group>"; };
26 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PullToRefresh.app; sourceTree = BUILT_PRODUCTS_DIR; };
27 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
28 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
29 28A0AAE50D9B0CCF005BE974 /* PullToRefresh_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullToRefresh_Prefix.pch; sourceTree = "<group>"; };
30 28C286DF0D94DF7D0034E888 /* DemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoTableViewController.h; sourceTree = "<group>"; };
31 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoTableViewController.m; sourceTree = "<group>"; };
32 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
33 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PullRefreshTableViewController.h; sourceTree = "<group>"; };
34 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PullRefreshTableViewController.m; sourceTree = "<group>"; };
35 4CAFBCEE11FC994F00651784 /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.markdown; sourceTree = "<group>"; };
36 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
37 4CBE3BED11FE21CB007696B3 /* arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = arrow.png; sourceTree = "<group>"; };
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>"; };
39/* End PBXFileReference section */
40
41/* Begin PBXFrameworksBuildPhase section */
42 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
43 isa = PBXFrameworksBuildPhase;
44 buildActionMask = 2147483647;
45 files = (
46 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
47 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
48 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */,
49 4CAFBD0111FC9B2100651784 /* QuartzCore.framework in Frameworks */,
50 );
51 runOnlyForDeploymentPostprocessing = 0;
52 };
53/* End PBXFrameworksBuildPhase section */
54
55/* Begin PBXGroup section */
56 080E96DDFE201D6D7F000001 /* Classes */ = {
57 isa = PBXGroup;
58 children = (
59 1D3623240D0F684500981E51 /* PullToRefreshAppDelegate.h */,
60 1D3623250D0F684500981E51 /* PullToRefreshAppDelegate.m */,
61 28C286DF0D94DF7D0034E888 /* DemoTableViewController.h */,
62 28C286E00D94DF7D0034E888 /* DemoTableViewController.m */,
63 4CAFBC7E11FC96FC00651784 /* PullRefreshTableViewController.h */,
64 4CAFBC7F11FC96FC00651784 /* PullRefreshTableViewController.m */,
65 );
66 path = Classes;
67 sourceTree = "<group>";
68 };
69 19C28FACFE9D520D11CA2CBB /* Products */ = {
70 isa = PBXGroup;
71 children = (
72 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */,
73 );
74 name = Products;
75 sourceTree = "<group>";
76 };
77 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
78 isa = PBXGroup;
79 children = (
80 080E96DDFE201D6D7F000001 /* Classes */,
81 29B97315FDCFA39411CA2CEA /* Other Sources */,
82 29B97317FDCFA39411CA2CEA /* Resources */,
83 29B97323FDCFA39411CA2CEA /* Frameworks */,
84 19C28FACFE9D520D11CA2CBB /* Products */,
85 );
86 name = CustomTemplate;
87 sourceTree = "<group>";
88 };
89 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
90 isa = PBXGroup;
91 children = (
92 28A0AAE50D9B0CCF005BE974 /* PullToRefresh_Prefix.pch */,
93 29B97316FDCFA39411CA2CEA /* main.m */,
94 );
95 name = "Other Sources";
96 sourceTree = "<group>";
97 };
98 29B97317FDCFA39411CA2CEA /* Resources */ = {
99 isa = PBXGroup;
100 children = (
101 4CBE3BED11FE21CB007696B3 /* arrow.png */,
102 4CAFBCEE11FC994F00651784 /* README.markdown */,
103 8D1107310486CEB800E47090 /* PullToRefresh-Info.plist */,
104 );
105 name = Resources;
106 sourceTree = "<group>";
107 };
108 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
109 isa = PBXGroup;
110 children = (
111 4CAFBD0011FC9B2100651784 /* QuartzCore.framework */,
112 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
113 1D30AB110D05D00D00671497 /* Foundation.framework */,
114 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */,
115 );
116 name = Frameworks;
117 sourceTree = "<group>";
118 };
119/* End PBXGroup section */
120
121/* Begin PBXNativeTarget section */
122 1D6058900D05DD3D006BFB54 /* PullToRefresh */ = {
123 isa = PBXNativeTarget;
124 buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh" */;
125 buildPhases = (
126 1D60588D0D05DD3D006BFB54 /* Resources */,
127 1D60588E0D05DD3D006BFB54 /* Sources */,
128 1D60588F0D05DD3D006BFB54 /* Frameworks */,
129 );
130 buildRules = (
131 );
132 dependencies = (
133 );
134 name = PullToRefresh;
135 productName = PullToRefresh;
136 productReference = 1D6058910D05DD3D006BFB54 /* PullToRefresh.app */;
137 productType = "com.apple.product-type.application";
138 };
139/* End PBXNativeTarget section */
140
141/* Begin PBXProject section */
142 29B97313FDCFA39411CA2CEA /* Project object */ = {
143 isa = PBXProject;
144 buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PullToRefresh" */;
145 compatibilityVersion = "Xcode 3.1";
146 hasScannedForEncodings = 1;
147 knownRegions = (
148 English,
149 Japanese,
150 French,
151 German,
152 en,
153 );
154 mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
155 projectDirPath = "";
156 projectRoot = "";
157 targets = (
158 1D6058900D05DD3D006BFB54 /* PullToRefresh */,
159 );
160 };
161/* End PBXProject section */
162
163/* Begin PBXResourcesBuildPhase section */
164 1D60588D0D05DD3D006BFB54 /* Resources */ = {
165 isa = PBXResourcesBuildPhase;
166 buildActionMask = 2147483647;
167 files = (
168 4CAFBCEF11FC994F00651784 /* README.markdown in Resources */,
169 4CBE3BEE11FE21CB007696B3 /* arrow.png in Resources */,
170 );
171 runOnlyForDeploymentPostprocessing = 0;
172 };
173/* End PBXResourcesBuildPhase section */
174
175/* Begin PBXSourcesBuildPhase section */
176 1D60588E0D05DD3D006BFB54 /* Sources */ = {
177 isa = PBXSourcesBuildPhase;
178 buildActionMask = 2147483647;
179 files = (
180 1D60589B0D05DD56006BFB54 /* main.m in Sources */,
181 1D3623260D0F684500981E51 /* PullToRefreshAppDelegate.m in Sources */,
182 28C286E10D94DF7D0034E888 /* DemoTableViewController.m in Sources */,
183 4CAFBC8011FC96FC00651784 /* PullRefreshTableViewController.m in Sources */,
184 );
185 runOnlyForDeploymentPostprocessing = 0;
186 };
187/* End PBXSourcesBuildPhase section */
188
189/* Begin XCBuildConfiguration section */
190 1D6058940D05DD3E006BFB54 /* Debug */ = {
191 isa = XCBuildConfiguration;
192 buildSettings = {
193 ALWAYS_SEARCH_USER_PATHS = NO;
194 COPY_PHASE_STRIP = NO;
195 GCC_DYNAMIC_NO_PIC = NO;
196 GCC_OPTIMIZATION_LEVEL = 0;
197 GCC_PRECOMPILE_PREFIX_HEADER = YES;
198 GCC_PREFIX_HEADER = PullToRefresh_Prefix.pch;
199 INFOPLIST_FILE = "PullToRefresh-Info.plist";
200 PRODUCT_NAME = PullToRefresh;
201 };
202 name = Debug;
203 };
204 1D6058950D05DD3E006BFB54 /* Release */ = {
205 isa = XCBuildConfiguration;
206 buildSettings = {
207 ALWAYS_SEARCH_USER_PATHS = NO;
208 COPY_PHASE_STRIP = YES;
209 GCC_PRECOMPILE_PREFIX_HEADER = YES;
210 GCC_PREFIX_HEADER = PullToRefresh_Prefix.pch;
211 INFOPLIST_FILE = "PullToRefresh-Info.plist";
212 PRODUCT_NAME = PullToRefresh;
213 VALIDATE_PRODUCT = YES;
214 };
215 name = Release;
216 };
217 C01FCF4F08A954540054247B /* Debug */ = {
218 isa = XCBuildConfiguration;
219 buildSettings = {
220 ARCHS = "$(ARCHS_STANDARD_32_BIT)";
221 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
222 GCC_C_LANGUAGE_STANDARD = c99;
223 GCC_WARN_ABOUT_RETURN_TYPE = YES;
224 GCC_WARN_UNUSED_VARIABLE = YES;
225 PREBINDING = NO;
226 SDKROOT = iphoneos4.0;
227 };
228 name = Debug;
229 };
230 C01FCF5008A954540054247B /* Release */ = {
231 isa = XCBuildConfiguration;
232 buildSettings = {
233 ARCHS = "$(ARCHS_STANDARD_32_BIT)";
234 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
235 GCC_C_LANGUAGE_STANDARD = c99;
236 GCC_WARN_ABOUT_RETURN_TYPE = YES;
237 GCC_WARN_UNUSED_VARIABLE = YES;
238 OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
239 PREBINDING = NO;
240 SDKROOT = iphoneos4.0;
241 };
242 name = Release;
243 };
244/* End XCBuildConfiguration section */
245
246/* Begin XCConfigurationList section */
247 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PullToRefresh" */ = {
248 isa = XCConfigurationList;
249 buildConfigurations = (
250 1D6058940D05DD3E006BFB54 /* Debug */,
251 1D6058950D05DD3E006BFB54 /* Release */,
252 );
253 defaultConfigurationIsVisible = 0;
254 defaultConfigurationName = Release;
255 };
256 C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PullToRefresh" */ = {
257 isa = XCConfigurationList;
258 buildConfigurations = (
259 C01FCF4F08A954540054247B /* Debug */,
260 C01FCF5008A954540054247B /* Release */,
261 );
262 defaultConfigurationIsVisible = 0;
263 defaultConfigurationName = Release;
264 };
265/* End XCConfigurationList section */
266 };
267 rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
268}
2690
=== removed file 'Dependencies/PullToRefresh/PullToRefresh_Prefix.pch'
--- Dependencies/PullToRefresh/PullToRefresh_Prefix.pch 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/PullToRefresh_Prefix.pch 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1//
2// Prefix header for all source files of the 'PullToRefresh' target in the 'PullToRefresh' project
3//
4#import <Availability.h>
5
6#ifndef __IPHONE_3_0
7#warning "This project uses features only available in iPhone SDK 3.0 and later."
8#endif
9
10
11#ifdef __OBJC__
12 #import <Foundation/Foundation.h>
13 #import <UIKit/UIKit.h>
14#endif
150
=== removed file 'Dependencies/PullToRefresh/README.markdown'
--- Dependencies/PullToRefresh/README.markdown 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/README.markdown 1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
1PullToRefresh
2
3A simple iPhone TableViewController for adding pull-to-refresh functionality.
4
5![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-1.png)
6![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-2.png)
7![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-3.png)
8![](http://s3.amazonaws.com/leah.baconfile.com/blog/refresh-small-4.png)
9
10Inspired 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/)
11and [EGOTableViewPullRefresh](http://github.com/enormego/EGOTableViewPullRefresh).
12
13
14How to intall
15
161. Copy the files, [PullRefreshTableViewController.h](http://github.com/leah/PullToRefresh/raw/master/Classes/PullRefreshTableViewController.h),
17[PullRefreshTableViewController.m](http://github.com/leah/PullToRefresh/blob/master/Classes/PullRefreshTableViewController.m),
18and [arrow.png](http://github.com/leah/PullToRefresh/raw/master/arrow.png) into your project.
19
202. Link against the QuartzCore framework (used for rotating the arrow image).
21
223. Create a TableViewController that is a subclass of PullRefreshTableViewController.
23
244. Customize by adding your own refresh() method.
25
26
27Enjoy!
280
=== removed file 'Dependencies/PullToRefresh/arrow.png'
29Binary files Dependencies/PullToRefresh/arrow.png 2011-08-31 14:56:30 +0000 and Dependencies/PullToRefresh/arrow.png 1970-01-01 00:00:00 +0000 differ1Binary 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
=== removed file 'Dependencies/PullToRefresh/main.m'
--- Dependencies/PullToRefresh/main.m 2011-08-31 14:56:30 +0000
+++ Dependencies/PullToRefresh/main.m 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1//
2// main.m
3// PullToRefresh
4//
5// Created by Leah Culver on 7/25/10.
6// Copyright __MyCompanyName__ 2010. All rights reserved.
7//
8
9#import <UIKit/UIKit.h>
10
11int main(int argc, char *argv[]) {
12
13 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
14 int retVal = UIApplicationMain(argc, argv, nil, @"PullToRefreshAppDelegate");
15 [pool release];
16 return retVal;
17}
180
=== removed file 'Dependencies/RIButtonItem.h'
--- Dependencies/RIButtonItem.h 2011-10-31 17:16:15 +0000
+++ Dependencies/RIButtonItem.h 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
1//
2// RIButtonItem.h
3// Shibui
4//
5// Created by Jiva DeVoe on 1/12/11.
6// Copyright 2011 Random Ideas, LLC. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11typedef void (^RISimpleAction)();
12
13@interface RIButtonItem : NSObject
14{
15 NSString *label;
16 RISimpleAction action;
17}
18@property (retain, nonatomic) NSString *label;
19@property (copy, nonatomic) RISimpleAction action;
20+(id)item;
21+(id)itemWithLabel:(NSString *)inLabel;
22@end
23
240
=== removed file 'Dependencies/RIButtonItem.m'
--- Dependencies/RIButtonItem.m 2011-12-12 17:32:18 +0000
+++ Dependencies/RIButtonItem.m 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
1//
2// RIButtonItem.m
3// Shibui
4//
5// Created by Jiva DeVoe on 1/12/11.
6// Copyright 2011 Random Ideas, LLC. All rights reserved.
7//
8
9#import "RIButtonItem.h"
10
11@implementation RIButtonItem
12@synthesize label;
13@synthesize action;
14
15+(id)item
16{
17 return [[self new] autorelease];
18}
19
20+(id)itemWithLabel:(NSString *)inLabel
21{
22 id newItem = [self item];
23 [newItem setLabel:inLabel];
24 return newItem;
25}
26
27- (void)dealloc;
28{
29 [label release];
30 [action release];
31 [super dealloc];
32}
33
34@end
35
360
=== modified file 'Dependencies/Reachability/Reachability.h' (properties changed: -x to +x)
--- Dependencies/Reachability/Reachability.h 2011-11-01 01:43:45 +0000
+++ Dependencies/Reachability/Reachability.h 2013-04-26 15:39:24 +0000
@@ -1,88 +1,118 @@
1/*1/*
2 2 Copyright (c) 2011, Tony Million.
3 File: Reachability.h3 All rights reserved.
4 Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs.4
5 5 Redistribution and use in source and binary forms, with or without
6 Version: 2.06 modification, are permitted provided that the following conditions are met:
7 7
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
9 ("Apple") in consideration of your agreement to the following terms, and your9 list of conditions and the following disclaimer.
10 use, installation, modification or redistribution of this Apple software10
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,
12 please do not use, install, modify or redistribute this Apple software.12 this list of conditions and the following disclaimer in the documentation
13 13 and/or other materials provided with the distribution.
14 In consideration of your agreement to abide by the following terms, and subject14
15 to these terms, Apple grants you a personal, non-exclusive license, under15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 Apple's copyrights in this original Apple software (the "Apple Software"), to16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 use, reproduce, modify and redistribute the Apple Software, with or without17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 modifications, in source and/or binary forms; provided that if you redistribute18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 the Apple Software in its entirety and without modifications, you must retain19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 this notice and the following text and disclaimers in all such redistributions20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 of the Apple Software.21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 Neither the name, trademarks, service marks or logos of Apple Inc. may be used22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 to endorse or promote products derived from the Apple Software without specific23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
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
25 no other rights or licenses, express or implied, are granted by Apple herein,25 POSSIBILITY OF SUCH DAMAGE.
26 including but not limited to any patent rights that may be infringed by your26
27 derivative works or by other works in which the Apple Software may be27 https://github.com/tonymillion/Reachability
28 incorporated.28 */
29
30 The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
31 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
32 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
34 COMBINATION WITH YOUR PRODUCTS.
35
36 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
37 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
38 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
40 DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
41 CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
42 APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
44 Copyright (C) 2009 Apple Inc. All Rights Reserved.
45
46*/
47
4829
49#import <Foundation/Foundation.h>30#import <Foundation/Foundation.h>
50#import <SystemConfiguration/SystemConfiguration.h>31#import <SystemConfiguration/SystemConfiguration.h>
5132
52typedef enum {33#import <sys/socket.h>
53 NotReachable = 0,34#import <netinet/in.h>
54 ReachableViaWiFi,35#import <netinet6/in6.h>
55 ReachableViaWWAN36#import <arpa/inet.h>
37#import <ifaddrs.h>
38#import <netdb.h>
39
40/**
41 * Does ARC support support GCD objects?
42 * It does if the minimum deployment target is iOS 6+ or Mac OS X 8+
43 **/
44#if TARGET_OS_IPHONE
45
46// Compiling for iOS
47
48#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
49#define NEEDS_DISPATCH_RETAIN_RELEASE 0
50#else // iOS 5.X or earlier
51#define NEEDS_DISPATCH_RETAIN_RELEASE 1
52#endif
53
54#else
55
56// Compiling for Mac OS X
57
58#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
59#define NEEDS_DISPATCH_RETAIN_RELEASE 0
60#else
61#define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
62#endif
63
64#endif
65
66
67extern NSString *const kReachabilityChangedNotification;
68
69typedef enum
70{
71 // Apple NetworkStatus Compatible Names.
72 NotReachable = 0,
73 ReachableViaWiFi = 2,
74 ReachableViaWWAN = 1
56} NetworkStatus;75} NetworkStatus;
57#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification"76
5877@class Reachability;
59@interface Reachability: NSObject78
60{79typedef void (^NetworkReachable)(Reachability * reachability);
61 BOOL localWiFiRef;80typedef void (^NetworkUnreachable)(Reachability * reachability);
62 SCNetworkReachabilityRef reachabilityRef;81
63}82@interface Reachability : NSObject
6483
65//reachabilityWithHostName- Use to check the reachability of a particular host name. 84@property (nonatomic, copy) NetworkReachable reachableBlock;
66+ (Reachability*) reachabilityWithHostName: (NSString*) hostName;85@property (nonatomic, copy) NetworkUnreachable unreachableBlock;
6786
68//reachabilityWithAddress- Use to check the reachability of a particular IP address. 87
69//+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;88@property (nonatomic, assign) BOOL reachableOnWWAN;
7089
71//reachabilityForInternetConnection- checks whether the default route is available. 90+(Reachability*)reachabilityWithHostname:(NSString*)hostname;
72// Should be used by applications that do not connect to a particular host91+(Reachability*)reachabilityForInternetConnection;
73+ (Reachability*) reachabilityForInternetConnection;92+(Reachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress;
7493+(Reachability*)reachabilityForLocalWiFi;
75//reachabilityForLocalWiFi- checks whether a local wifi connection is available.94
76+ (Reachability*) reachabilityForLocalWiFi;95-(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref;
7796
78//Start listening for reachability notifications on the current run loop97-(BOOL)startNotifier;
79- (BOOL) startNotifer;98-(void)stopNotifier;
80- (void) stopNotifer;99
81100-(BOOL)isReachable;
82- (NetworkStatus) currentReachabilityStatus;101-(BOOL)isReachableViaWWAN;
83//WWAN may be available, but not active until a connection has been established.102-(BOOL)isReachableViaWiFi;
84//WiFi may require a connection for VPN on Demand.103
85- (BOOL) connectionRequired;104// WWAN may be available, but not active until a connection has been established.
105// WiFi may require a connection for VPN on Demand.
106-(BOOL)isConnectionRequired; // Identical DDG variant.
107-(BOOL)connectionRequired; // Apple's routine.
108// Dynamic, on demand connection?
109-(BOOL)isConnectionOnDemand;
110// Is user intervention required?
111-(BOOL)isInterventionRequired;
112
113-(NetworkStatus)currentReachabilityStatus;
114-(SCNetworkReachabilityFlags)reachabilityFlags;
115-(NSString*)currentReachabilityString;
116-(NSString*)currentReachabilityFlags;
117
86@end118@end
87
88
89119
=== modified file 'Dependencies/Reachability/Reachability.m' (properties changed: -x to +x)
--- Dependencies/Reachability/Reachability.m 2011-11-01 01:43:45 +0000
+++ Dependencies/Reachability/Reachability.m 2013-04-26 15:39:24 +0000
@@ -1,274 +1,505 @@
1/*1/*
2 2 Copyright (c) 2011, Tony Million.
3 File: Reachability.m3 All rights reserved.
4 Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs.4
5 5 Redistribution and use in source and binary forms, with or without
6 Version: 2.06 modification, are permitted provided that the following conditions are met:
7 7
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
9 ("Apple") in consideration of your agreement to the following terms, and your9 list of conditions and the following disclaimer.
10 use, installation, modification or redistribution of this Apple software10
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,
12 please do not use, install, modify or redistribute this Apple software.12 this list of conditions and the following disclaimer in the documentation
13 13 and/or other materials provided with the distribution.
14 In consideration of your agreement to abide by the following terms, and subject14
15 to these terms, Apple grants you a personal, non-exclusive license, under15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 Apple's copyrights in this original Apple software (the "Apple Software"), to16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 use, reproduce, modify and redistribute the Apple Software, with or without17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 modifications, in source and/or binary forms; provided that if you redistribute18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 the Apple Software in its entirety and without modifications, you must retain19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 this notice and the following text and disclaimers in all such redistributions20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 of the Apple Software.21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 Neither the name, trademarks, service marks or logos of Apple Inc. may be used22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 to endorse or promote products derived from the Apple Software without specific23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
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
25 no other rights or licenses, express or implied, are granted by Apple herein,25 POSSIBILITY OF SUCH DAMAGE.
26 including but not limited to any patent rights that may be infringed by your26
27 derivative works or by other works in which the Apple Software may be27 https://github.com/tonymillion/Reachability
28 incorporated.28 */
29
30 The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
31 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
32 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
34 COMBINATION WITH YOUR PRODUCTS.
35
36 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
37 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
38 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
40 DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
41 CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
42 APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
44 Copyright (C) 2009 Apple Inc. All Rights Reserved.
45
46*/
47
48#import <sys/socket.h>
49#import <netinet/in.h>
50#import <netinet6/in6.h>
51#import <arpa/inet.h>
52#import <ifaddrs.h>
53#import <netdb.h>
54
55#import <CoreFoundation/CoreFoundation.h>
5629
57#import "Reachability.h"30#import "Reachability.h"
5831
59#define kShouldPrintReachabilityFlags 032
6033NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification";
61static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment)34
62{35@interface Reachability ()
63#if kShouldPrintReachabilityFlags36
64 37@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef;
65 NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n",38
66 (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-',39
67 (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-',40#if NEEDS_DISPATCH_RETAIN_RELEASE
68 41@property (nonatomic, assign) dispatch_queue_t reachabilitySerialQueue;
69 (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-',42#else
70 (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-',43@property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue;
71 (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-',44#endif
72 (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',45
73 (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-',46
74 (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-',47@property (nonatomic, strong) id reachabilityObject;
75 (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-',48
76 comment49-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags;
77 );50-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags;
78#endif51
52@end
53
54static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags)
55{
56 return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c",
57#if TARGET_OS_IPHONE
58 (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-',
59#else
60 'X',
61#endif
62 (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-',
63 (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-',
64 (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-',
65 (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',
66 (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-',
67 (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-',
68 (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-',
69 (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-'];
70}
71
72//Start listening for reachability notifications on the current run loop
73static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
74{
75#pragma unused (target)
76 Reachability *reachability = ((__bridge Reachability*)info);
77
78 // we probably dont need an autoreleasepool here as GCD docs state each queue has its own autorelease pool
79 // but what the heck eh?
80 @autoreleasepool
81 {
82 [reachability reachabilityChanged:flags];
83 }
79}84}
8085
8186
82@implementation Reachability87@implementation Reachability
83static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)88
84{89@synthesize reachabilityRef;
85 #pragma unused (target, flags)90@synthesize reachabilitySerialQueue;
86 NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");91
87 NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback");92@synthesize reachableOnWWAN;
8893
89 //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively94@synthesize reachableBlock;
90 // in case someon uses the Reachablity object in a different thread.95@synthesize unreachableBlock;
91 NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init];96
92 97@synthesize reachabilityObject;
93 Reachability* noteObject = (Reachability*) info;98
94 // Post a notification to notify the client that the network reachability changed.99#pragma mark - class constructor methods
95 [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];100+(Reachability*)reachabilityWithHostname:(NSString*)hostname
96 101{
97 [myPool release];102 SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]);
98}103 if (ref)
99104 {
100- (BOOL) startNotifer105 id reachability = [[self alloc] initWithReachabilityRef:ref];
101{106
102 BOOL retVal = NO;107#if __has_feature(objc_arc)
103 SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL};108 return reachability;
104 if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context))109#else
105 {110 return [reachability autorelease];
106 if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode))111#endif
107 {112
108 retVal = YES;113 }
109 }114
110 }115 return nil;
111 return retVal;116}
112}117
113118+(Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress
114- (void) stopNotifer119{
115{120 SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);
116 if(reachabilityRef!= NULL)121 if (ref)
117 {122 {
118 SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);123 id reachability = [[self alloc] initWithReachabilityRef:ref];
119 }124
120}125#if __has_feature(objc_arc)
121126 return reachability;
122- (void) dealloc127#else
123{128 return [reachability autorelease];
124 [self stopNotifer];129#endif
125 if(reachabilityRef!= NULL)130 }
126 {131
127 CFRelease(reachabilityRef);132 return nil;
128 }133}
129 [super dealloc];134
130}135+(Reachability *)reachabilityForInternetConnection
131136{
132+ (Reachability*) reachabilityWithHostName: (NSString*) hostName;137 struct sockaddr_in zeroAddress;
133{138 bzero(&zeroAddress, sizeof(zeroAddress));
134 Reachability* retVal = NULL;139 zeroAddress.sin_len = sizeof(zeroAddress);
135 SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]);140 zeroAddress.sin_family = AF_INET;
136 if(reachability!= NULL)141
137 {142 return [self reachabilityWithAddress:&zeroAddress];
138 retVal= [[[self alloc] init] autorelease];143}
139 if(retVal!= NULL)144
140 {145+(Reachability*)reachabilityForLocalWiFi
141 retVal->reachabilityRef = reachability;146{
142 retVal->localWiFiRef = NO;147 struct sockaddr_in localWifiAddress;
143 }148 bzero(&localWifiAddress, sizeof(localWifiAddress));
144 }149 localWifiAddress.sin_len = sizeof(localWifiAddress);
145 return retVal;150 localWifiAddress.sin_family = AF_INET;
146}151 // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0
147152 localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);
148+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;153
149{154 return [self reachabilityWithAddress:&localWifiAddress];
150 SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);155}
151 Reachability* retVal = NULL;156
152 if(reachability!= NULL)157
153 {158// initialization methods
154 retVal= [[[self alloc] init] autorelease];159
155 if(retVal!= NULL)160-(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref
156 {161{
157 retVal->reachabilityRef = reachability;162 self = [super init];
158 retVal->localWiFiRef = NO;163 if (self != nil)
159 }164 {
160 }165 self.reachableOnWWAN = YES;
161 return retVal;166 self.reachabilityRef = ref;
162}167 }
163168
164+ (Reachability*) reachabilityForInternetConnection;169 return self;
165{170}
166 struct sockaddr_in zeroAddress;171
167 bzero(&zeroAddress, sizeof(zeroAddress));172-(void)dealloc
168 zeroAddress.sin_len = sizeof(zeroAddress);173{
169 zeroAddress.sin_family = AF_INET;174 [self stopNotifier];
170 return [self reachabilityWithAddress: &zeroAddress];175
171}176 if(self.reachabilityRef)
172177 {
173+ (Reachability*) reachabilityForLocalWiFi;178 CFRelease(self.reachabilityRef);
174{179 self.reachabilityRef = nil;
175 //[super init];180 }
176 struct sockaddr_in localWifiAddress;181
177 bzero(&localWifiAddress, sizeof(localWifiAddress));182
178 localWifiAddress.sin_len = sizeof(localWifiAddress);183#if !(__has_feature(objc_arc))
179 localWifiAddress.sin_family = AF_INET;184 [super dealloc];
180 // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0185#endif
181 localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);186
182 Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress];187
183 if(retVal!= NULL)188}
184 {189
185 retVal->localWiFiRef = YES;190#pragma mark - notifier methods
186 }191
187 return retVal;192// Notifier
188}193// NOTE: this uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD
189194// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS.
190#pragma mark Network Flag Handling195// INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want)
191196
192- (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags197-(BOOL)startNotifier
193{198{
194 PrintReachabilityFlags(flags, "localWiFiStatusForFlags");199 SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL };
195200
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
197 if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect))202 // woah
198 {203 self.reachabilityObject = self;
199 retVal = ReachableViaWiFi; 204
200 }205
201 return retVal;206
202}207 // first we need to create a serial queue
203208 // we allocate this once for the lifetime of the notifier
204- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags209 self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL);
205{210 if(!self.reachabilitySerialQueue)
206 PrintReachabilityFlags(flags, "networkStatusForFlags");211 {
207 if ((flags & kSCNetworkReachabilityFlagsReachable) == 0)212 return NO;
208 {213 }
209 // if target host is not reachable214
210 return NotReachable;215
211 }216 context.info = (__bridge void *)self;
212217
213 BOOL retVal = NotReachable;218 if (!SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context))
214 219 {
215 if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0)220#ifdef DEBUG
216 {221 NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError()));
217 // if target host is reachable and no connection is required222#endif
218 // then we'll assume (for now) that your on Wi-Fi223
219 retVal = ReachableViaWiFi;224 //clear out the dispatch queue
220 }225 if(self.reachabilitySerialQueue)
221 226 {
222 227#if NEEDS_DISPATCH_RETAIN_RELEASE
223 if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) ||228 dispatch_release(self.reachabilitySerialQueue);
224 (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0))229#endif
225 {230 self.reachabilitySerialQueue = nil;
226 // ... and the connection is on-demand (or on-traffic) if the231 }
227 // calling application is using the CFSocketStream or higher APIs232
228233 self.reachabilityObject = nil;
229 if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0)234
230 {235 return NO;
231 // ... and no [user] intervention is needed236 }
232 retVal = ReachableViaWiFi;237
233 }238 // set it as our reachability queue which will retain the queue
234 }239 if(!SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue))
235 240 {
236 if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN)241#ifdef DEBUG
237 {242 NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError()));
238 // ... but WWAN connections are OK if the calling application243#endif
239 // is using the CFNetwork (CFSocketStream?) APIs.244
240 retVal = ReachableViaWWAN;245 //UH OH - FAILURE!
241 }246
242 return retVal;247 // first stop any callbacks!
243}248 SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL);
244249
245- (BOOL) connectionRequired;250 // then clear out the dispatch queue
246{251 if(self.reachabilitySerialQueue)
247 NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef");252 {
248 SCNetworkReachabilityFlags flags;253#if NEEDS_DISPATCH_RETAIN_RELEASE
249 if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))254 dispatch_release(self.reachabilitySerialQueue);
250 {255#endif
256 self.reachabilitySerialQueue = nil;
257 }
258
259 self.reachabilityObject = nil;
260
261 return NO;
262 }
263
264 return YES;
265}
266
267-(void)stopNotifier
268{
269 // first stop any callbacks!
270 SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL);
271
272 // unregister target from the GCD serial dispatch queue
273 SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL);
274
275 if(self.reachabilitySerialQueue)
276 {
277#if NEEDS_DISPATCH_RETAIN_RELEASE
278 dispatch_release(self.reachabilitySerialQueue);
279#endif
280 self.reachabilitySerialQueue = nil;
281 }
282
283 self.reachabilityObject = nil;
284}
285
286#pragma mark - reachability tests
287
288// this is for the case where you flick the airplane mode
289// you end up getting something like this:
290//Reachability: WR ct-----
291//Reachability: -- -------
292//Reachability: WR ct-----
293//Reachability: -- -------
294// we treat this as 4 UNREACHABLE triggers - really apple should do better than this
295
296#define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection)
297
298-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags
299{
300 BOOL connectionUP = YES;
301
302 if(!(flags & kSCNetworkReachabilityFlagsReachable))
303 connectionUP = NO;
304
305 if( (flags & testcase) == testcase )
306 connectionUP = NO;
307
308#if TARGET_OS_IPHONE
309 if(flags & kSCNetworkReachabilityFlagsIsWWAN)
310 {
311 // we're on 3G
312 if(!self.reachableOnWWAN)
313 {
314 // we dont want to connect when on 3G
315 connectionUP = NO;
316 }
317 }
318#endif
319
320 return connectionUP;
321}
322
323-(BOOL)isReachable
324{
325 SCNetworkReachabilityFlags flags;
326
327 if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
328 return NO;
329
330 return [self isReachableWithFlags:flags];
331}
332
333-(BOOL)isReachableViaWWAN
334{
335#if TARGET_OS_IPHONE
336
337 SCNetworkReachabilityFlags flags = 0;
338
339 if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
340 {
341 // check we're REACHABLE
342 if(flags & kSCNetworkReachabilityFlagsReachable)
343 {
344 // now, check we're on WWAN
345 if(flags & kSCNetworkReachabilityFlagsIsWWAN)
346 {
347 return YES;
348 }
349 }
350 }
351#endif
352
353 return NO;
354}
355
356-(BOOL)isReachableViaWiFi
357{
358 SCNetworkReachabilityFlags flags = 0;
359
360 if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
361 {
362 // check we're reachable
363 if((flags & kSCNetworkReachabilityFlagsReachable))
364 {
365#if TARGET_OS_IPHONE
366 // check we're NOT on WWAN
367 if((flags & kSCNetworkReachabilityFlagsIsWWAN))
368 {
369 return NO;
370 }
371#endif
372 return YES;
373 }
374 }
375
376 return NO;
377}
378
379
380// WWAN may be available, but not active until a connection has been established.
381// WiFi may require a connection for VPN on Demand.
382-(BOOL)isConnectionRequired
383{
384 return [self connectionRequired];
385}
386
387-(BOOL)connectionRequired
388{
389 SCNetworkReachabilityFlags flags;
390
391 if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
392 {
251 return (flags & kSCNetworkReachabilityFlagsConnectionRequired);393 return (flags & kSCNetworkReachabilityFlagsConnectionRequired);
252 }394 }
253 return NO;395
396 return NO;
254}397}
255398
256- (NetworkStatus) currentReachabilityStatus399// Dynamic, on demand connection?
400-(BOOL)isConnectionOnDemand
257{401{
258 NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef");
259 NetworkStatus retVal = NotReachable;
260 SCNetworkReachabilityFlags flags;402 SCNetworkReachabilityFlags flags;
261 if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))403
262 {404 if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
263 if(localWiFiRef)405 {
264 {406 return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) &&
265 retVal = [self localWiFiStatusForFlags: flags];407 (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand)));
266 }408 }
267 else409
268 {410 return NO;
269 retVal = [self networkStatusForFlags: flags];411}
270 }412
271 }413// Is user intervention required?
272 return retVal;414-(BOOL)isInterventionRequired
273}415{
416 SCNetworkReachabilityFlags flags;
417
418 if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
419 {
420 return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) &&
421 (flags & kSCNetworkReachabilityFlagsInterventionRequired));
422 }
423
424 return NO;
425}
426
427
428#pragma mark - reachability status stuff
429
430-(NetworkStatus)currentReachabilityStatus
431{
432 if([self isReachable])
433 {
434 if([self isReachableViaWiFi])
435 return ReachableViaWiFi;
436
437#if TARGET_OS_IPHONE
438 return ReachableViaWWAN;
439#endif
440 }
441
442 return NotReachable;
443}
444
445-(SCNetworkReachabilityFlags)reachabilityFlags
446{
447 SCNetworkReachabilityFlags flags = 0;
448
449 if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags))
450 {
451 return flags;
452 }
453
454 return 0;
455}
456
457-(NSString*)currentReachabilityString
458{
459 NetworkStatus temp = [self currentReachabilityStatus];
460
461 if(temp == reachableOnWWAN)
462 {
463 // updated for the fact we have CDMA phones now!
464 return NSLocalizedString(@"Cellular", @"");
465 }
466 if (temp == ReachableViaWiFi)
467 {
468 return NSLocalizedString(@"WiFi", @"");
469 }
470
471 return NSLocalizedString(@"No Connection", @"");
472}
473
474-(NSString*)currentReachabilityFlags
475{
476 return reachabilityFlags([self reachabilityFlags]);
477}
478
479#pragma mark - callback function calls this method
480
481-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags
482{
483 if([self isReachableWithFlags:flags])
484 {
485 if(self.reachableBlock)
486 {
487 self.reachableBlock(self);
488 }
489 }
490 else
491 {
492 if(self.unreachableBlock)
493 {
494 self.unreachableBlock(self);
495 }
496 }
497
498 // this makes sure the change notification happens on the MAIN THREAD
499 dispatch_async(dispatch_get_main_queue(), ^{
500 [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification
501 object:self];
502 });
503}
504
274@end505@end
275506
=== modified file 'Dependencies/SVProgressHUD/SVProgressHUD/SVProgressHUD.m'
--- Dependencies/SVProgressHUD/SVProgressHUD/SVProgressHUD.m 2012-01-31 04:40:37 +0000
+++ Dependencies/SVProgressHUD/SVProgressHUD/SVProgressHUD.m 2013-04-26 15:39:24 +0000
@@ -20,7 +20,7 @@
2020
21@property (nonatomic, readwrite) SVProgressHUDMaskType maskType;21@property (nonatomic, readwrite) SVProgressHUDMaskType maskType;
22@property (nonatomic, readwrite) BOOL showNetworkIndicator;22@property (nonatomic, readwrite) BOOL showNetworkIndicator;
23@property (nonatomic, retain) NSTimer *fadeOutTimer;23@property (nonatomic, strong) NSTimer *fadeOutTimer;
2424
25@property (nonatomic, readonly) UIWindow *overlayWindow;25@property (nonatomic, readonly) UIWindow *overlayWindow;
26@property (nonatomic, readonly) UIView *hudView;26@property (nonatomic, readonly) UIView *hudView;
@@ -54,12 +54,7 @@
54 self.fadeOutTimer = nil;54 self.fadeOutTimer = nil;
55 [[NSNotificationCenter defaultCenter] removeObserver:self];55 [[NSNotificationCenter defaultCenter] removeObserver:self];
56 56
57 [hudView release];
58 [stringLabel release];
59 [imageView release];
60 [spinnerView release];
61 57
62 [super dealloc];
63}58}
6459
6560
@@ -246,10 +241,10 @@
246- (void)setFadeOutTimer:(NSTimer *)newTimer {241- (void)setFadeOutTimer:(NSTimer *)newTimer {
247 242
248 if(fadeOutTimer)243 if(fadeOutTimer)
249 [fadeOutTimer invalidate], [fadeOutTimer release], fadeOutTimer = nil;244 [fadeOutTimer invalidate], fadeOutTimer, fadeOutTimer = nil;
250 245
251 if(newTimer)246 if(newTimer)
252 fadeOutTimer = [newTimer retain];247 fadeOutTimer = newTimer;
253}248}
254249
255250
@@ -461,8 +456,8 @@
461 completion:^(BOOL finished){ 456 completion:^(BOOL finished){
462 if(sharedView.alpha == 0) {457 if(sharedView.alpha == 0) {
463 [[NSNotificationCenter defaultCenter] removeObserver:sharedView];458 [[NSNotificationCenter defaultCenter] removeObserver:sharedView];
464 [overlayWindow release], overlayWindow = nil;459 overlayWindow, overlayWindow = nil;
465 [sharedView release], sharedView = nil;460 sharedView, sharedView = nil;
466 461
467 // find the frontmost window that is an actual UIWindow and make it keyVisible462 // find the frontmost window that is an actual UIWindow and make it keyVisible
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) {
@@ -539,10 +534,7 @@
539 return spinnerView;534 return spinnerView;
540}535}
541536
542- (CGFloat)visibleKeyboardHeight {537- (CGFloat)visibleKeyboardHeight {
543
544 NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init];
545
546 UIWindow *keyboardWindow = nil;538 UIWindow *keyboardWindow = nil;
547 for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {539 for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {
548 if(![[testWindow class] isEqual:[UIWindow class]]) {540 if(![[testWindow class] isEqual:[UIWindow class]]) {
@@ -553,7 +545,7 @@
553545
554 // Locate UIKeyboard. 546 // Locate UIKeyboard.
555 UIView *foundKeyboard = nil;547 UIView *foundKeyboard = nil;
556 for (UIView *possibleKeyboard in [keyboardWindow subviews]) {548 for (__strong UIView *possibleKeyboard in [keyboardWindow subviews]) {
557 549
558 // iOS 4 sticks the UIKeyboard inside a UIPeripheralHostView.550 // iOS 4 sticks the UIKeyboard inside a UIPeripheralHostView.
559 if ([[possibleKeyboard description] hasPrefix:@"<UIPeripheralHostView"]) {551 if ([[possibleKeyboard description] hasPrefix:@"<UIPeripheralHostView"]) {
@@ -565,9 +557,7 @@
565 break;557 break;
566 }558 }
567 }559 }
568 560
569 [autoreleasePool release];
570
571 if(foundKeyboard && foundKeyboard.bounds.size.height > 100)561 if(foundKeyboard && foundKeyboard.bounds.size.height > 100)
572 return foundKeyboard.bounds.size.height;562 return foundKeyboard.bounds.size.height;
573 563
574564
=== removed file 'Dependencies/UIActionSheet+Blocks.h'
--- Dependencies/UIActionSheet+Blocks.h 2011-10-31 17:16:15 +0000
+++ Dependencies/UIActionSheet+Blocks.h 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1//
2// UIActionSheet+Blocks.h
3// Shibui
4//
5// Created by Jiva DeVoe on 1/5/11.
6// Copyright 2011 Random Ideas, LLC. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "RIButtonItem.h"
11
12@interface UIActionSheet (Blocks) <UIActionSheetDelegate>
13
14-(id)initWithTitle:(NSString *)inTitle cancelButtonItem:(RIButtonItem *)inCancelButtonItem destructiveButtonItem:(RIButtonItem *)inDestructiveItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... NS_REQUIRES_NIL_TERMINATION;
15
16@end
170
=== removed file 'Dependencies/UIActionSheet+Blocks.m'
--- Dependencies/UIActionSheet+Blocks.m 2011-10-31 17:16:15 +0000
+++ Dependencies/UIActionSheet+Blocks.m 1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
1//
2// UIActionSheet+Blocks.m
3// Shibui
4//
5// Created by Jiva DeVoe on 1/5/11.
6// Copyright 2011 Random Ideas, LLC. All rights reserved.
7//
8
9#import "UIActionSheet+Blocks.h"
10#import <objc/runtime.h>
11
12static NSString *RI_BUTTON_ASS_KEY = @"com.random-ideas.BUTTONS";
13
14@implementation UIActionSheet (Blocks)
15
16-(id)initWithTitle:(NSString *)inTitle cancelButtonItem:(RIButtonItem *)inCancelButtonItem destructiveButtonItem:(RIButtonItem *)inDestructiveItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ...
17{
18 if((self = [self initWithTitle:inTitle delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]))
19 {
20 NSMutableArray *buttonsArray = [NSMutableArray array];
21
22 RIButtonItem *eachItem;
23 va_list argumentList;
24 if (inOtherButtonItems)
25 {
26 [buttonsArray addObject: inOtherButtonItems];
27 va_start(argumentList, inOtherButtonItems);
28 while((eachItem = va_arg(argumentList, RIButtonItem *)))
29 {
30 [buttonsArray addObject: eachItem];
31 }
32 va_end(argumentList);
33 }
34
35 for(RIButtonItem *item in buttonsArray)
36 {
37 [self addButtonWithTitle:item.label];
38 }
39
40 if(inDestructiveItem)
41 {
42 [buttonsArray addObject:inDestructiveItem];
43 NSInteger destIndex = [self addButtonWithTitle:inDestructiveItem.label];
44 [self setDestructiveButtonIndex:destIndex];
45 }
46 if(inCancelButtonItem)
47 {
48 [buttonsArray addObject:inCancelButtonItem];
49 NSInteger cancelIndex = [self addButtonWithTitle:inCancelButtonItem.label];
50 [self setCancelButtonIndex:cancelIndex];
51 }
52
53 objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, buttonsArray, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
54
55 [self retain]; // keep yourself around!
56 }
57 return self;
58}
59
60- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
61{
62 NSArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY);
63 RIButtonItem *item = [buttonsArray objectAtIndex:buttonIndex];
64 if(item.action)
65 item.action();
66 objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
67 [self release]; // and release yourself!
68}
69
70
71@end
720
=== removed file 'Dependencies/UIAlertView+Blocks.h'
--- Dependencies/UIAlertView+Blocks.h 2011-10-31 17:16:15 +0000
+++ Dependencies/UIAlertView+Blocks.h 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1//
2// UIAlertView+Blocks.h
3// Shibui
4//
5// Created by Jiva DeVoe on 12/28/10.
6// Copyright 2010 Random Ideas, LLC. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "RIButtonItem.h"
11
12@interface UIAlertView (Blocks)
13
14-(id)initWithTitle:(NSString *)inTitle message:(NSString *)inMessage cancelButtonItem:(RIButtonItem *)inCancelButtonItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... NS_REQUIRES_NIL_TERMINATION;
15
16@end
170
=== removed file 'Dependencies/UIAlertView+Blocks.m'
--- Dependencies/UIAlertView+Blocks.m 2011-10-31 17:16:15 +0000
+++ Dependencies/UIAlertView+Blocks.m 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1//
2// UIAlertView+Blocks.m
3// Shibui
4//
5// Created by Jiva DeVoe on 12/28/10.
6// Copyright 2010 Random Ideas, LLC. All rights reserved.
7//
8
9#import "UIAlertView+Blocks.h"
10#import <objc/runtime.h>
11
12static NSString *RI_BUTTON_ASS_KEY = @"com.random-ideas.BUTTONS";
13
14@implementation UIAlertView (Blocks)
15
16-(id)initWithTitle:(NSString *)inTitle message:(NSString *)inMessage cancelButtonItem:(RIButtonItem *)inCancelButtonItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ...
17{
18 if((self = [self initWithTitle:inTitle message:inMessage delegate:self cancelButtonTitle:inCancelButtonItem.label otherButtonTitles:nil]))
19 {
20 NSMutableArray *buttonsArray = [NSMutableArray array];
21
22 RIButtonItem *eachItem;
23 va_list argumentList;
24 if (inOtherButtonItems)
25 {
26 [buttonsArray addObject: inOtherButtonItems];
27 va_start(argumentList, inOtherButtonItems);
28 while((eachItem = va_arg(argumentList, RIButtonItem *)))
29 {
30 [buttonsArray addObject: eachItem];
31 }
32 va_end(argumentList);
33 }
34
35 for(RIButtonItem *item in buttonsArray)
36 {
37 [self addButtonWithTitle:item.label];
38 }
39
40 if(inCancelButtonItem)
41 [buttonsArray insertObject:inCancelButtonItem atIndex:0];
42
43 objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, buttonsArray, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
44
45 [self setDelegate:self];
46 [self retain]; // keep yourself around!
47 }
48 return self;
49}
50
51- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
52{
53 NSArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY);
54 RIButtonItem *item = [buttonsArray objectAtIndex:buttonIndex];
55 if(item.action)
56 item.action();
57 objc_setAssociatedObject(self, RI_BUTTON_ASS_KEY, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
58 [self release]; // and release yourself!
59}
60
61@end
620
=== removed directory 'Dependencies/oauthconsumer'
=== removed directory 'Dependencies/oauthconsumer/Categories'
=== removed file 'Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.h'
--- Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.h 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
1//
2// NSMutableURLRequest+Parameters.h
3//
4// Created by Jon Crosby on 10/19/07.
5// Copyright 2007 Kaboomerang LLC. All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25#import <Foundation/Foundation.h>
26#import "OARequestParameter.h"
27#import "NSURL+Base.h"
28
29
30@interface NSMutableURLRequest (OAParameterAdditions)
31
32@property(nonatomic, retain) NSArray *parameters;
33
34- (void)setHTTPBodyWithString:(NSString *)body;
35- (void)attachFileWithName:(NSString *)name filename:(NSString*)filename contentType:(NSString *)contentType data:(NSData*)data;
36
37@end
380
=== removed file 'Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.m'
--- Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.m 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Categories/NSMutableURLRequest+Parameters.m 1970-01-01 00:00:00 +0000
@@ -1,116 +0,0 @@
1//
2// NSMutableURLRequest+Parameters.m
3//
4// Created by Jon Crosby on 10/19/07.
5// Copyright 2007 Kaboomerang LLC. All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25
26#import "NSMutableURLRequest+Parameters.h"
27
28static NSString *Boundary = @"-----------------------------------0xCoCoaouTHeBouNDaRy";
29
30@implementation NSMutableURLRequest (OAParameterAdditions)
31
32- (BOOL)isMultipart {
33 return [[self valueForHTTPHeaderField:@"Content-Type"] hasPrefix:@"multipart/form-data"];
34}
35
36- (NSArray *)parameters {
37 NSString *encodedParameters = nil;
38
39// if (![self isMultipart]) {
40 // TODO: review what this is supposed to do, but for now this solves the immediate problem
41 if ([[self valueForHTTPHeaderField:@"Content-Type"] hasPrefix:@"application/x-www-form-urlencoded"])
42 {
43 if ([[self HTTPMethod] isEqualToString:@"GET"] || [[self HTTPMethod] isEqualToString:@"DELETE"]) {
44 encodedParameters = [[self URL] query];
45 } else {
46 encodedParameters = [[[NSString alloc] initWithData:[self HTTPBody] encoding:NSASCIIStringEncoding] autorelease];
47 }
48 }
49
50 if (encodedParameters == nil || [encodedParameters isEqualToString:@""]) {
51 return nil;
52 }
53// NSLog(@"raw parameters %@", encodedParameters);
54 NSArray *encodedParameterPairs = [encodedParameters componentsSeparatedByString:@"&"];
55 NSMutableArray *requestParameters = [NSMutableArray arrayWithCapacity:[encodedParameterPairs count]];
56
57 for (NSString *encodedPair in encodedParameterPairs) {
58 NSArray *encodedPairElements = [encodedPair componentsSeparatedByString:@"="];
59 OARequestParameter *parameter = [[OARequestParameter alloc] initWithName:[[encodedPairElements objectAtIndex:0] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
60 value:[[encodedPairElements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
61 [requestParameters addObject:parameter];
62 [parameter release];
63 }
64
65 return requestParameters;
66}
67
68- (void)setParameters:(NSArray *)parameters
69{
70 NSMutableArray *pairs = [[[NSMutableArray alloc] initWithCapacity:[parameters count]] autorelease];
71 for (OARequestParameter *requestParameter in parameters) {
72 [pairs addObject:[requestParameter URLEncodedNameValuePair]];
73 }
74
75 NSString *encodedParameterPairs = [pairs componentsJoinedByString:@"&"];
76
77 if ([[self HTTPMethod] isEqualToString:@"GET"] || [[self HTTPMethod] isEqualToString:@"DELETE"]) {
78 [self setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", [[self URL] URLStringWithoutQuery], encodedParameterPairs]]];
79 } else {
80 // POST, PUT
81 [self setHTTPBodyWithString:encodedParameterPairs];
82 [self setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
83 }
84}
85
86- (void)setHTTPBodyWithString:(NSString *)body {
87 NSData *bodyData = [body dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
88 [self setValue:[NSString stringWithFormat:@"%d", [bodyData length]] forHTTPHeaderField:@"Content-Length"];
89 [self setHTTPBody:bodyData];
90}
91
92- (void)attachFileWithName:(NSString *)name filename:(NSString*)filename contentType:(NSString *)contentType data:(NSData*)data {
93
94 NSArray *parameters = [self parameters];
95 [self setValue:[@"multipart/form-data; boundary=" stringByAppendingString:Boundary] forHTTPHeaderField:@"Content-type"];
96
97 NSMutableData *bodyData = [NSMutableData new];
98 for (OARequestParameter *parameter in parameters) {
99 NSString *param = [NSString stringWithFormat:@"--%@\r\nContent-Disposition: form-data; name=\"%@\"\r\n\r\n%@\r\n",
100 Boundary, [parameter URLEncodedName], [parameter value]];
101
102 [bodyData appendData:[param dataUsingEncoding:NSUTF8StringEncoding]];
103 }
104
105 NSString *filePrefix = [NSString stringWithFormat:@"--%@\r\nContent-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\nContent-Type: %@\r\n\r\n",
106 Boundary, name, filename, contentType];
107 [bodyData appendData:[filePrefix dataUsingEncoding:NSUTF8StringEncoding]];
108 [bodyData appendData:data];
109
110 [bodyData appendData:[[[@"\r\n--" stringByAppendingString:Boundary] stringByAppendingString:@"--"] dataUsingEncoding:NSUTF8StringEncoding]];
111 [self setValue:[NSString stringWithFormat:@"%d", [bodyData length]] forHTTPHeaderField:@"Content-Length"];
112 [self setHTTPBody:bodyData];
113 [bodyData release];
114}
115
116@end
1170
=== removed file 'Dependencies/oauthconsumer/Categories/NSString+URLEncoding.h'
--- Dependencies/oauthconsumer/Categories/NSString+URLEncoding.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Categories/NSString+URLEncoding.h 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
1//
2// NSString+URLEncoding.h
3//
4// Created by Jon Crosby on 10/19/07.
5// Copyright 2007 Kaboomerang LLC. All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25
26#import <Foundation/Foundation.h>
27
28
29@interface NSString (OAURLEncodingAdditions)
30
31- (NSString *)encodedURLString;
32- (NSString *)encodedURLParameterString;
33- (NSString *)decodedURLString;
34- (NSString *)removeQuotes;
35@end
360
=== removed file 'Dependencies/oauthconsumer/Categories/NSString+URLEncoding.m'
--- Dependencies/oauthconsumer/Categories/NSString+URLEncoding.m 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Categories/NSString+URLEncoding.m 1970-01-01 00:00:00 +0000
@@ -1,73 +0,0 @@
1//
2// NSString+URLEncoding.m
3//
4// Created by Jon Crosby on 10/19/07.
5// Copyright 2007 Kaboomerang LLC. All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23// THE SOFTWARE.
24
25
26#import "NSString+URLEncoding.h"
27
28
29@implementation NSString (OAURLEncodingAdditions)
30
31- (NSString *)encodedURLString {
32 NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
33 (CFStringRef)self,
34 NULL, // characters to leave unescaped (NULL = all escaped sequences are replaced)
35 CFSTR("?=&+"), // legal URL characters to be escaped (NULL = all legal characters are replaced)
36 kCFStringEncodingUTF8); // encoding
37 return [result autorelease];
38}
39
40- (NSString *)encodedURLParameterString {
41 NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
42 (CFStringRef)self,
43 NULL,
44 CFSTR(":/=,!$&'()*+;[]@#?"),
45 kCFStringEncodingUTF8);
46 return [result autorelease];
47}
48
49- (NSString *)decodedURLString {
50 NSString *result = (NSString*)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
51 (CFStringRef)self,
52 CFSTR(""),
53 kCFStringEncodingUTF8);
54
55 return [result autorelease];
56
57}
58
59-(NSString *)removeQuotes
60{
61 NSUInteger length = [self length];
62 NSString *ret = self;
63 if ([self characterAtIndex:0] == '"') {
64 ret = [ret substringFromIndex:1];
65 }
66 if ([self characterAtIndex:length - 1] == '"') {
67 ret = [ret substringToIndex:length - 2];
68 }
69
70 return ret;
71}
72
73@end
740
=== removed file 'Dependencies/oauthconsumer/Categories/NSURL+Base.h'
--- Dependencies/oauthconsumer/Categories/NSURL+Base.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Categories/NSURL+Base.h 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
1//
2// NSURL+Base.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import <Foundation/Foundation.h>
28
29
30@interface NSURL (OABaseAdditions)
31
32- (NSString *)URLStringWithoutQuery;
33
34@end
350
=== removed file 'Dependencies/oauthconsumer/Categories/NSURL+Base.m'
--- Dependencies/oauthconsumer/Categories/NSURL+Base.m 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Categories/NSURL+Base.m 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
1//
2// NSURL+Base.m
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26
27#import "NSURL+Base.h"
28
29
30@implementation NSURL (OABaseAdditions)
31
32- (NSString *)URLStringWithoutQuery {
33 NSArray *parts = [[self absoluteString] componentsSeparatedByString:@"?"];
34 return [parts objectAtIndex:0];
35}
36
37@end
380
=== removed directory 'Dependencies/oauthconsumer/Crypto'
=== removed file 'Dependencies/oauthconsumer/Crypto/Base64Transcoder.c'
--- Dependencies/oauthconsumer/Crypto/Base64Transcoder.c 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Crypto/Base64Transcoder.c 1970-01-01 00:00:00 +0000
@@ -1,230 +0,0 @@
1/*
2 * Base64Transcoder.c
3 * Base64Test
4 *
5 * Created by Jonathan Wight on Tue Mar 18 2003.
6 * Copyright (c) 2003 Toxic Software. All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27
28#include "Base64Transcoder.h"
29
30#include <math.h>
31#include <string.h>
32
33const u_int8_t kBase64EncodeTable[64] = {
34 /* 0 */ 'A', /* 1 */ 'B', /* 2 */ 'C', /* 3 */ 'D',
35 /* 4 */ 'E', /* 5 */ 'F', /* 6 */ 'G', /* 7 */ 'H',
36 /* 8 */ 'I', /* 9 */ 'J', /* 10 */ 'K', /* 11 */ 'L',
37 /* 12 */ 'M', /* 13 */ 'N', /* 14 */ 'O', /* 15 */ 'P',
38 /* 16 */ 'Q', /* 17 */ 'R', /* 18 */ 'S', /* 19 */ 'T',
39 /* 20 */ 'U', /* 21 */ 'V', /* 22 */ 'W', /* 23 */ 'X',
40 /* 24 */ 'Y', /* 25 */ 'Z', /* 26 */ 'a', /* 27 */ 'b',
41 /* 28 */ 'c', /* 29 */ 'd', /* 30 */ 'e', /* 31 */ 'f',
42 /* 32 */ 'g', /* 33 */ 'h', /* 34 */ 'i', /* 35 */ 'j',
43 /* 36 */ 'k', /* 37 */ 'l', /* 38 */ 'm', /* 39 */ 'n',
44 /* 40 */ 'o', /* 41 */ 'p', /* 42 */ 'q', /* 43 */ 'r',
45 /* 44 */ 's', /* 45 */ 't', /* 46 */ 'u', /* 47 */ 'v',
46 /* 48 */ 'w', /* 49 */ 'x', /* 50 */ 'y', /* 51 */ 'z',
47 /* 52 */ '0', /* 53 */ '1', /* 54 */ '2', /* 55 */ '3',
48 /* 56 */ '4', /* 57 */ '5', /* 58 */ '6', /* 59 */ '7',
49 /* 60 */ '8', /* 61 */ '9', /* 62 */ '+', /* 63 */ '/'
50};
51
52/*
53-1 = Base64 end of data marker.
54-2 = White space (tabs, cr, lf, space)
55-3 = Noise (all non whitespace, non-base64 characters)
56-4 = Dangerous noise
57-5 = Illegal noise (null byte)
58*/
59
60const int8_t kBase64DecodeTable[128] = {
61 /* 0x00 */ -5, /* 0x01 */ -3, /* 0x02 */ -3, /* 0x03 */ -3,
62 /* 0x04 */ -3, /* 0x05 */ -3, /* 0x06 */ -3, /* 0x07 */ -3,
63 /* 0x08 */ -3, /* 0x09 */ -2, /* 0x0a */ -2, /* 0x0b */ -2,
64 /* 0x0c */ -2, /* 0x0d */ -2, /* 0x0e */ -3, /* 0x0f */ -3,
65 /* 0x10 */ -3, /* 0x11 */ -3, /* 0x12 */ -3, /* 0x13 */ -3,
66 /* 0x14 */ -3, /* 0x15 */ -3, /* 0x16 */ -3, /* 0x17 */ -3,
67 /* 0x18 */ -3, /* 0x19 */ -3, /* 0x1a */ -3, /* 0x1b */ -3,
68 /* 0x1c */ -3, /* 0x1d */ -3, /* 0x1e */ -3, /* 0x1f */ -3,
69 /* ' ' */ -2, /* '!' */ -3, /* '"' */ -3, /* '#' */ -3,
70 /* '$' */ -3, /* '%' */ -3, /* '&' */ -3, /* ''' */ -3,
71 /* '(' */ -3, /* ')' */ -3, /* '*' */ -3, /* '+' */ 62,
72 /* ',' */ -3, /* '-' */ -3, /* '.' */ -3, /* '/' */ 63,
73 /* '0' */ 52, /* '1' */ 53, /* '2' */ 54, /* '3' */ 55,
74 /* '4' */ 56, /* '5' */ 57, /* '6' */ 58, /* '7' */ 59,
75 /* '8' */ 60, /* '9' */ 61, /* ':' */ -3, /* ';' */ -3,
76 /* '<' */ -3, /* '=' */ -1, /* '>' */ -3, /* '?' */ -3,
77 /* '@' */ -3, /* 'A' */ 0, /* 'B' */ 1, /* 'C' */ 2,
78 /* 'D' */ 3, /* 'E' */ 4, /* 'F' */ 5, /* 'G' */ 6,
79 /* 'H' */ 7, /* 'I' */ 8, /* 'J' */ 9, /* 'K' */ 10,
80 /* 'L' */ 11, /* 'M' */ 12, /* 'N' */ 13, /* 'O' */ 14,
81 /* 'P' */ 15, /* 'Q' */ 16, /* 'R' */ 17, /* 'S' */ 18,
82 /* 'T' */ 19, /* 'U' */ 20, /* 'V' */ 21, /* 'W' */ 22,
83 /* 'X' */ 23, /* 'Y' */ 24, /* 'Z' */ 25, /* '[' */ -3,
84 /* '\' */ -3, /* ']' */ -3, /* '^' */ -3, /* '_' */ -3,
85 /* '`' */ -3, /* 'a' */ 26, /* 'b' */ 27, /* 'c' */ 28,
86 /* 'd' */ 29, /* 'e' */ 30, /* 'f' */ 31, /* 'g' */ 32,
87 /* 'h' */ 33, /* 'i' */ 34, /* 'j' */ 35, /* 'k' */ 36,
88 /* 'l' */ 37, /* 'm' */ 38, /* 'n' */ 39, /* 'o' */ 40,
89 /* 'p' */ 41, /* 'q' */ 42, /* 'r' */ 43, /* 's' */ 44,
90 /* 't' */ 45, /* 'u' */ 46, /* 'v' */ 47, /* 'w' */ 48,
91 /* 'x' */ 49, /* 'y' */ 50, /* 'z' */ 51, /* '{' */ -3,
92 /* '|' */ -3, /* '}' */ -3, /* '~' */ -3, /* 0x7f */ -3
93};
94
95const u_int8_t kBits_00000011 = 0x03;
96const u_int8_t kBits_00001111 = 0x0F;
97const u_int8_t kBits_00110000 = 0x30;
98const u_int8_t kBits_00111100 = 0x3C;
99const u_int8_t kBits_00111111 = 0x3F;
100const u_int8_t kBits_11000000 = 0xC0;
101const u_int8_t kBits_11110000 = 0xF0;
102const u_int8_t kBits_11111100 = 0xFC;
103
104size_t EstimateBas64EncodedDataSize(size_t inDataSize)
105{
106size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4;
107theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72;
108return(theEncodedDataSize);
109}
110
111size_t EstimateBas64DecodedDataSize(size_t inDataSize)
112{
113size_t theDecodedDataSize = (int)ceil(inDataSize / 4.0) * 3;
114//theDecodedDataSize = theDecodedDataSize / 72 * 74 + theDecodedDataSize % 72;
115return(theDecodedDataSize);
116}
117
118bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize)
119{
120size_t theEncodedDataSize = EstimateBas64EncodedDataSize(inInputDataSize);
121if (*ioOutputDataSize < theEncodedDataSize)
122 return(false);
123*ioOutputDataSize = theEncodedDataSize;
124const u_int8_t *theInPtr = (const u_int8_t *)inInputData;
125u_int32_t theInIndex = 0, theOutIndex = 0;
126for (; theInIndex < (inInputDataSize / 3) * 3; theInIndex += 3)
127 {
128 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2];
129 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000) >> 4];
130 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 1] & kBits_00001111) << 2 | (theInPtr[theInIndex + 2] & kBits_11000000) >> 6];
131 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 2] & kBits_00111111) >> 0];
132 if (theOutIndex % 74 == 72)
133 {
134 outOutputData[theOutIndex++] = '\r';
135 outOutputData[theOutIndex++] = '\n';
136 }
137 }
138const size_t theRemainingBytes = inInputDataSize - theInIndex;
139if (theRemainingBytes == 1)
140 {
141 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2];
142 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (0 & kBits_11110000) >> 4];
143 outOutputData[theOutIndex++] = '=';
144 outOutputData[theOutIndex++] = '=';
145 if (theOutIndex % 74 == 72)
146 {
147 outOutputData[theOutIndex++] = '\r';
148 outOutputData[theOutIndex++] = '\n';
149 }
150 }
151else if (theRemainingBytes == 2)
152 {
153 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2];
154 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000) >> 4];
155 outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 1] & kBits_00001111) << 2 | (0 & kBits_11000000) >> 6];
156 outOutputData[theOutIndex++] = '=';
157 if (theOutIndex % 74 == 72)
158 {
159 outOutputData[theOutIndex++] = '\r';
160 outOutputData[theOutIndex++] = '\n';
161 }
162 }
163return(true);
164}
165
166bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize)
167{
168memset(ioOutputData, '.', *ioOutputDataSize);
169
170size_t theDecodedDataSize = EstimateBas64DecodedDataSize(inInputDataSize);
171if (*ioOutputDataSize < theDecodedDataSize)
172 return(false);
173*ioOutputDataSize = 0;
174const u_int8_t *theInPtr = (const u_int8_t *)inInputData;
175u_int8_t *theOutPtr = (u_int8_t *)ioOutputData;
176size_t theInIndex = 0, theOutIndex = 0;
177u_int8_t theOutputOctet;
178size_t theSequence = 0;
179for (; theInIndex < inInputDataSize; )
180 {
181 int8_t theSextet = 0;
182
183 int8_t theCurrentInputOctet = theInPtr[theInIndex];
184 theSextet = kBase64DecodeTable[theCurrentInputOctet];
185 if (theSextet == -1)
186 break;
187 while (theSextet == -2)
188 {
189 theCurrentInputOctet = theInPtr[++theInIndex];
190 theSextet = kBase64DecodeTable[theCurrentInputOctet];
191 }
192 while (theSextet == -3)
193 {
194 theCurrentInputOctet = theInPtr[++theInIndex];
195 theSextet = kBase64DecodeTable[theCurrentInputOctet];
196 }
197 if (theSequence == 0)
198 {
199 theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 2 & kBits_11111100;
200 }
201 else if (theSequence == 1)
202 {
203 theOutputOctet |= (theSextet >- 0 ? theSextet : 0) >> 4 & kBits_00000011;
204 theOutPtr[theOutIndex++] = theOutputOctet;
205 }
206 else if (theSequence == 2)
207 {
208 theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 4 & kBits_11110000;
209 }
210 else if (theSequence == 3)
211 {
212 theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 2 & kBits_00001111;
213 theOutPtr[theOutIndex++] = theOutputOctet;
214 }
215 else if (theSequence == 4)
216 {
217 theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 6 & kBits_11000000;
218 }
219 else if (theSequence == 5)
220 {
221 theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 0 & kBits_00111111;
222 theOutPtr[theOutIndex++] = theOutputOctet;
223 }
224 theSequence = (theSequence + 1) % 6;
225 if (theSequence != 2 && theSequence != 4)
226 theInIndex++;
227 }
228*ioOutputDataSize = theOutIndex;
229return(true);
230}
2310
=== removed file 'Dependencies/oauthconsumer/Crypto/Base64Transcoder.h'
--- Dependencies/oauthconsumer/Crypto/Base64Transcoder.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Crypto/Base64Transcoder.h 1970-01-01 00:00:00 +0000
@@ -1,36 +0,0 @@
1/*
2 * Base64Transcoder.h
3 * Base64Test
4 *
5 * Created by Jonathan Wight on Tue Mar 18 2003.
6 * Copyright (c) 2003 Toxic Software. All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27
28#include <stdlib.h>
29#include <stdbool.h>
30
31extern size_t EstimateBas64EncodedDataSize(size_t inDataSize);
32extern size_t EstimateBas64DecodedDataSize(size_t inDataSize);
33
34extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize);
35extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize);
36
370
=== removed file 'Dependencies/oauthconsumer/Crypto/hmac.c'
--- Dependencies/oauthconsumer/Crypto/hmac.c 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Crypto/hmac.c 1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
1//
2// hmac.c
3// OAuthConsumer
4//
5// Created by Jonathan Wight on 4/8/8.
6// Copyright 2008 Jonathan Wight. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26/*
27 * Implementation of HMAC-SHA1. Adapted from example at http://tools.ietf.org/html/rfc2104
28
29 */
30
31#include "sha1.h"
32
33#include <stdlib.h>
34#include <string.h>
35
36void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, size_t inKeyLength, u_int8_t *outDigest);
37
38void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, size_t inKeyLength, u_int8_t *outDigest)
39{
40#define B 64
41#define L 20
42
43SHA1_CTX theSHA1Context;
44u_int8_t k_ipad[B + 1]; /* inner padding - key XORd with ipad */
45u_int8_t k_opad[B + 1]; /* outer padding - key XORd with opad */
46
47/* if key is longer than 64 bytes reset it to key=SHA1 (key) */
48if (inKeyLength > B)
49 {
50 SHA1Init(&theSHA1Context);
51 SHA1Update(&theSHA1Context, inKey, inKeyLength);
52 SHA1Final(inKey, &theSHA1Context);
53 inKeyLength = L;
54 }
55
56/* start out by storing key in pads */
57memset(k_ipad, 0, sizeof k_ipad);
58memset(k_opad, 0, sizeof k_opad);
59memcpy(k_ipad, inKey, inKeyLength);
60memcpy(k_opad, inKey, inKeyLength);
61
62/* XOR key with ipad and opad values */
63int i;
64for (i = 0; i < B; i++)
65 {
66 k_ipad[i] ^= 0x36;
67 k_opad[i] ^= 0x5c;
68 }
69
70/*
71* perform inner SHA1
72*/
73SHA1Init(&theSHA1Context); /* init context for 1st pass */
74SHA1Update(&theSHA1Context, k_ipad, B); /* start with inner pad */
75SHA1Update(&theSHA1Context, (u_int8_t *)inText, inTextLength); /* then text of datagram */
76SHA1Final((u_int8_t *)outDigest, &theSHA1Context); /* finish up 1st pass */
77
78/*
79* perform outer SHA1
80*/
81SHA1Init(&theSHA1Context); /* init context for 2nd
82* pass */
83SHA1Update(&theSHA1Context, k_opad, B); /* start with outer pad */
84SHA1Update(&theSHA1Context, (u_int8_t *)outDigest, L); /* then results of 1st
85* hash */
86SHA1Final((u_int8_t *)outDigest, &theSHA1Context); /* finish up 2nd pass */
87
88}
89\ No newline at end of file0\ No newline at end of file
901
=== removed file 'Dependencies/oauthconsumer/Crypto/hmac.h'
--- Dependencies/oauthconsumer/Crypto/hmac.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Crypto/hmac.h 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1//
2// hmac.h
3// OAuthConsumer
4//
5// Created by Jonathan Wight on 4/8/8.
6// Copyright 2008 Jonathan Wight. All rights reserved.
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24// THE SOFTWARE.
25
26#ifndef HMAC_H
27#define HMAC_H 1
28
29extern void hmac_sha1(const u_int8_t *inText, size_t inTextLength, u_int8_t* inKey, const size_t inKeyLength, u_int8_t *outDigest);
30
31#endif /* HMAC_H */
32\ No newline at end of file0\ No newline at end of file
331
=== removed file 'Dependencies/oauthconsumer/Crypto/sha1.c'
--- Dependencies/oauthconsumer/Crypto/sha1.c 2011-10-25 23:45:21 +0000
+++ Dependencies/oauthconsumer/Crypto/sha1.c 1970-01-01 00:00:00 +0000
@@ -1,171 +0,0 @@
1/*
2SHA-1 in C
3By Steve Reid <steve@edmweb.com>
4100% Public Domain
5
6Test Vectors (from FIPS PUB 180-1)
7"abc"
8 A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
9"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
10 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
11A million repetitions of "a"
12 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
13*/
14
15/* #define LITTLE_ENDIAN * This should be #define'd if true. */
16#if __LITTLE_ENDIAN__
17#define LITTLE_ENDIAN
18#endif
19/* #define SHA1HANDSOFF * Copies data before messing with it. */
20
21#include <stdio.h>
22#include <string.h>
23
24#include "sha1.h"
25
26void SHA1Transform(u_int32_t state[5], u_int8_t buffer[64]);
27
28#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
29
30/* blk0() and blk() perform the initial expand. */
31/* I got the idea of expanding during the round function from SSLeay */
32#ifdef LITTLE_ENDIAN
33#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
34 |(rol(block->l[i],8)&0x00FF00FF))
35#else
36#define blk0(i) block->l[i]
37#endif
38#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
39 ^block->l[(i+2)&15]^block->l[i&15],1))
40
41/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
42#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
43#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
44#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
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);
46#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
47
48
49/* Hash a single 512-bit block. This is the core of the algorithm. */
50
51void SHA1Transform(u_int32_t state[5], u_int8_t buffer[64])
52{
53u_int32_t a, b, c, d, e;
54typedef union {
55 u_int8_t c[64];
56 u_int32_t l[16];
57} CHAR64LONG16;
58CHAR64LONG16* block;
59#ifdef SHA1HANDSOFF
60static u_int8_t workspace[64];
61 block = (CHAR64LONG16*)workspace;
62 memcpy(block, buffer, 64);
63#else
64 block = (CHAR64LONG16*)buffer;
65#endif
66 /* Copy context->state[] to working vars */
67 a = state[0];
68 b = state[1];
69 c = state[2];
70 d = state[3];
71 e = state[4];
72 /* 4 rounds of 20 operations each. Loop unrolled. */
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
93 /* Add the working vars back into context.state[] */
94 state[0] += a;
95 state[1] += b;
96 state[2] += c;
97 state[3] += d;
98 state[4] += e;
99 /* Wipe variables */
100 a = b = c = d = e = 0;
101 (void)a; // shut up the static analyzer
102}
103
104
105/* SHA1Init - Initialize new context */
106
107void SHA1Init(SHA1_CTX* context)
108{
109 /* SHA1 initialization constants */
110 context->state[0] = 0x67452301;
111 context->state[1] = 0xEFCDAB89;
112 context->state[2] = 0x98BADCFE;
113 context->state[3] = 0x10325476;
114 context->state[4] = 0xC3D2E1F0;
115 context->count[0] = context->count[1] = 0;
116}
117
118
119/* Run your data through this. */
120
121void SHA1Update(SHA1_CTX* context, u_int8_t* data, unsigned int len)
122{
123unsigned int i, j;
124
125 j = (context->count[0] >> 3) & 63;
126 if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
127 context->count[1] += (len >> 29);
128 if ((j + len) > 63) {
129 memcpy(&context->buffer[j], data, (i = 64-j));
130 SHA1Transform(context->state, context->buffer);
131 for ( ; i + 63 < len; i += 64) {
132 SHA1Transform(context->state, &data[i]);
133 }
134 j = 0;
135 }
136 else i = 0;
137 memcpy(&context->buffer[j], &data[i], len - i);
138}
139
140
141/* Add padding and return the message digest. */
142
143void SHA1Final(u_int8_t digest[20], SHA1_CTX* context)
144{
145u_int32_t i, j;
146u_int8_t finalcount[8];
147
148 for (i = 0; i < 8; i++) {
149 finalcount[i] = (u_int8_t)((context->count[(i >= 4 ? 0 : 1)]
150 >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */
151 }
152 SHA1Update(context, (u_int8_t *)"\200", 1);
153 while ((context->count[0] & 504) != 448) {
154 SHA1Update(context, (u_int8_t *)"\0", 1);
155 }
156 SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
157 for (i = 0; i < 20; i++) {
158 digest[i] = (u_int8_t)
159 ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
160 }
161 /* Wipe variables */
162 i = j = 0;
163 (void)i; // shut up the static analyzer
164 memset(context->buffer, 0, 64);
165 memset(context->state, 0, 20);
166 memset(context->count, 0, 8);
167 memset(&finalcount, 0, 8);
168#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */
169 SHA1Transform(context->state, context->buffer);
170#endif
171}
1720
=== removed file 'Dependencies/oauthconsumer/Crypto/sha1.h'
--- Dependencies/oauthconsumer/Crypto/sha1.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/Crypto/sha1.h 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1#include <sys/types.h>
2
3// From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c
4
5typedef struct {
6 u_int32_t state[5];
7 u_int32_t count[2];
8 u_int8_t buffer[64];
9} SHA1_CTX;
10
11extern void SHA1Init(SHA1_CTX* context);
12extern void SHA1Update(SHA1_CTX* context, u_int8_t* data, u_int32_t len);
13extern void SHA1Final(u_int8_t digest[20], SHA1_CTX* context);
140
=== removed file 'Dependencies/oauthconsumer/OAAttachment.h'
--- Dependencies/oauthconsumer/OAAttachment.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/OAAttachment.h 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1//
2// OAAttachment.h
3// Zeus
4//
5// Created by Jamie Pinkham on 2/3/11.
6// Copyright 2011 Tumblr. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11
12@interface OAAttachment : NSObject {
13 NSString *name;
14 NSString *fileName;
15 NSString *contentType;
16 NSData *data;
17}
18
19@property (nonatomic, copy) NSString *name;
20@property (nonatomic, copy) NSString *fileName;
21@property (nonatomic, copy) NSString *contentType;
22@property (nonatomic, copy) NSData *data;
23
24- (id)initWithName:(NSString *)aName filename:(NSString *)aFilename contentType:(NSString *)aContentType data:(NSData *)aData;
25
26@end
270
=== removed file 'Dependencies/oauthconsumer/OAAttachment.m'
--- Dependencies/oauthconsumer/OAAttachment.m 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/OAAttachment.m 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1//
2// OAAttachment.h
3// Zeus
4//
5// Created by Jamie Pinkham on 2/3/11.
6// Copyright 2011 Tumblr. All rights reserved.
7//
8
9#import "OAAttachment.h"
10
11@implementation OAAttachment
12
13@synthesize name, fileName, contentType, data;
14
15- (id)initWithName:(NSString *)aName filename:(NSString *)aFilename contentType:(NSString *)aContentType data:(NSData *)aData{
16 if((self = [super init])){
17 self.name = aName;
18 self.fileName = aFilename;
19 self.contentType = aContentType;
20 self.data = aData;
21 }
22 return self;
23}
24
25- (void)dealloc{
26 [name release];
27 [fileName release];
28 [contentType release];
29 [data release];
30 [super dealloc];
31}
32
33@end
34\ No newline at end of file0\ No newline at end of file
351
=== removed file 'Dependencies/oauthconsumer/OACall.h'
--- Dependencies/oauthconsumer/OACall.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/OACall.h 1970-01-01 00:00:00 +0000
@@ -1,63 +0,0 @@
1//
2// OACall.h
3// OAuthConsumer
4//
5// Created by Alberto García Hierro on 04/09/08.
6// Copyright 2008 Alberto García Hierro. All rights reserved.
7// bynotes.com
8
9#import <Foundation/Foundation.h>
10
11@class OAProblem;
12@class OACall;
13
14@protocol OACallDelegate
15
16- (void)call:(OACall *)call failedWithError:(NSError *)error;
17- (void)call:(OACall *)call failedWithProblem:(OAProblem *)problem;
18
19@end
20
21@class OAConsumer;
22@class OAToken;
23@class OADataFetcher;
24@class OAMutableURLRequest;
25@class OAServiceTicket;
26
27@interface OACall : NSObject {
28 NSURL *url;
29 NSString *method;
30 NSArray *parameters;
31 NSDictionary *files;
32 NSObject <OACallDelegate> *delegate;
33 SEL finishedSelector;
34 OADataFetcher *fetcher;
35 OAMutableURLRequest *request;
36 OAServiceTicket *ticket;
37}
38
39@property(readonly) NSURL *url;
40@property(readonly) NSString *method;
41@property(readonly) NSArray *parameters;
42@property(readonly) NSDictionary *files;
43@property(nonatomic, retain) OAServiceTicket *ticket;
44
45- (id)init;
46- (id)initWithURL:(NSURL *)aURL;
47- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod;
48- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters;
49- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters;
50- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters files:(NSDictionary*)theFiles;
51
52- (id)initWithURL:(NSURL *)aURL
53 method:(NSString *)aMethod
54 parameters:(NSArray *)theParameters
55 files:(NSDictionary*)theFiles;
56
57- (void)perform:(OAConsumer *)consumer
58 token:(OAToken *)token
59 realm:(NSString *)realm
60 delegate:(NSObject <OACallDelegate> *)aDelegate
61 didFinish:(SEL)finished;
62
63@end
640
=== removed file 'Dependencies/oauthconsumer/OACall.m'
--- Dependencies/oauthconsumer/OACall.m 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/OACall.m 1970-01-01 00:00:00 +0000
@@ -1,170 +0,0 @@
1//
2// OACall.m
3// OAuthConsumer
4//
5// Created by Alberto García Hierro on 04/09/08.
6// Copyright 2008 Alberto García Hierro. All rights reserved.
7// bynotes.com
8
9#import "OAConsumer.h"
10#import "OAToken.h"
11#import "OAProblem.h"
12#import "OADataFetcher.h"
13#import "OAServiceTicket.h"
14#import "OAMutableURLRequest.h"
15#import "OACall.h"
16
17@interface OACall (Private)
18
19- (void)callFinished:(OAServiceTicket *)ticket withData:(NSData *)data;
20- (void)callFailed:(OAServiceTicket *)ticket withError:(NSError *)error;
21
22@end
23
24@implementation OACall
25
26@synthesize url, method, parameters, files, ticket;
27
28- (id)init {
29 return [self initWithURL:nil
30 method:nil
31 parameters:nil
32 files:nil];
33}
34
35- (id)initWithURL:(NSURL *)aURL {
36 return [self initWithURL:aURL
37 method:nil
38 parameters:nil
39 files:nil];
40}
41
42- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod {
43 return [self initWithURL:aURL
44 method:aMethod
45 parameters:nil
46 files:nil];
47}
48
49- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters {
50 return [self initWithURL:aURL
51 method:nil
52 parameters:theParameters];
53}
54
55- (id)initWithURL:(NSURL *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters {
56 return [self initWithURL:aURL
57 method:aMethod
58 parameters:theParameters
59 files:nil];
60}
61
62- (id)initWithURL:(NSURL *)aURL parameters:(NSArray *)theParameters files:(NSDictionary*)theFiles {
63 return [self initWithURL:aURL
64 method:@"POST"
65 parameters:theParameters
66 files:theFiles];
67}
68
69- (id)initWithURL:(NSURL *)aURL
70 method:(NSString *)aMethod
71 parameters:(NSArray *)theParameters
72 files:(NSDictionary*)theFiles {
73 if ((self = [super init])) {
74 url = [aURL retain];
75 method = [aMethod retain];
76 parameters = [theParameters retain];
77 files = [theFiles retain];
78 fetcher = nil;
79 request = nil;
80 }
81
82 return self;
83}
84
85- (void)dealloc {
86 [url release];
87 [method release];
88 [parameters release];
89 [files release];
90 [fetcher release];
91 [request release];
92 [ticket release];
93 [super dealloc];
94}
95
96- (void)callFailed:(OAServiceTicket *)aTicket withError:(NSError *)error {
97 NSLog(@"error body: %@", aTicket.body);
98 self.ticket = aTicket;
99 [aTicket release];
100 OAProblem *problem = [OAProblem problemWithResponseBody:ticket.body];
101 if (problem) {
102 [delegate call:self failedWithProblem:problem];
103 } else {
104 [delegate call:self failedWithError:error];
105 }
106}
107
108- (void)callFinished:(OAServiceTicket *)aTicket withData:(NSData *)data {
109 self.ticket = aTicket;
110 [aTicket release];
111 if (ticket.didSucceed) {
112// NSLog(@"Call body: %@", ticket.body);
113 [delegate performSelector:finishedSelector withObject:self withObject:ticket.body];
114 } else {
115// NSLog(@"Failed call body: %@", ticket.body);
116 [self callFailed:[ticket retain] withError:nil];
117 }
118}
119
120- (void)perform:(OAConsumer *)consumer
121 token:(OAToken *)token
122 realm:(NSString *)realm
123 delegate:(NSObject <OACallDelegate> *)aDelegate
124 didFinish:(SEL)finished
125
126{
127 delegate = aDelegate;
128 finishedSelector = finished;
129
130 request = [[OAMutableURLRequest alloc] initWithURL:url
131 consumer:consumer
132 token:token
133 realm:realm
134 signatureProvider:nil];
135 if(method) {
136 [request setHTTPMethod:method];
137 }
138
139 if (self.parameters) {
140 [request setParameters:self.parameters];
141 }
142// if (self.files) {
143// for (NSString *key in self.files) {
144// [request attachFileWithName:@"file" filename:NSLocalizedString(@"Photo.jpg", @"") data:[self.files objectForKey:key]];
145// }
146// }
147 fetcher = [[OADataFetcher alloc] init];
148 [fetcher fetchDataWithRequest:request
149 delegate:self
150 didFinishSelector:@selector(callFinished:withData:)
151 didFailSelector:@selector(callFailed:withError:)];
152}
153
154/*- (BOOL)isEqual:(id)object {
155 if ([object isKindOfClass:[self class]]) {
156 return [self isEqualToCall:(OACall *)object];
157 }
158 return NO;
159}
160
161- (BOOL)isEqualToCall:(OACall *)aCall {
162 return (delegate == aCall->delegate
163 && finishedSelector == aCall->finishedSelector
164 && [url isEqualTo:aCall.url]
165 && [method isEqualToString:aCall.method]
166 && [parameters isEqualToArray:aCall.parameters]
167 && [files isEqualToDictionary:aCall.files]);
168}*/
169
170@end
1710
=== removed file 'Dependencies/oauthconsumer/OAConsumer.h'
--- Dependencies/oauthconsumer/OAConsumer.h 2011-08-31 14:56:30 +0000
+++ Dependencies/oauthconsumer/OAConsumer.h 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1//
2// OAConsumer.h
3// OAuthConsumer
4//
5// Created by Jon Crosby on 10/19/07.
6// Copyright 2007 Kaboomerang LLC. All rights reserved.
7//
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches