Permalink
Browse files

initial commit

  • Loading branch information...
1 parent da9d4ad commit bd0e16831ca7e968b73ad3db916dd4ba9ab2ba46 @ideashower ideashower committed Jul 6, 2010
Showing with 21,104 additions and 0 deletions.
  1. +38 −0 Classes/Example/ExampleShareFile.h
  2. +82 −0 Classes/Example/ExampleShareFile.m
  3. +38 −0 Classes/Example/ExampleShareImage.h
  4. +83 −0 Classes/Example/ExampleShareImage.m
  5. +38 −0 Classes/Example/ExampleShareLink.h
  6. +78 −0 Classes/Example/ExampleShareLink.m
  7. +38 −0 Classes/Example/ExampleShareText.h
  8. +91 −0 Classes/Example/ExampleShareText.m
  9. +14 −0 Classes/Example/RootViewController.h
  10. +105 −0 Classes/Example/RootViewController.m
  11. +21 −0 Classes/Example/ShareKitAppDelegate.h
  12. +66 −0 Classes/Example/ShareKitAppDelegate.m
  13. BIN Classes/Example/example.pdf
  14. BIN Classes/Example/sanFran.jpg
  15. +35 −0 Classes/OAuth/Categories/NSMutableURLRequest+Parameters.h
  16. +97 −0 Classes/OAuth/Categories/NSMutableURLRequest+Parameters.m
  17. +34 −0 Classes/OAuth/Categories/NSString+URLEncoding.h
  18. +52 −0 Classes/OAuth/Categories/NSString+URLEncoding.m
  19. +34 −0 Classes/OAuth/Categories/NSURL+Base.h
  20. +38 −0 Classes/OAuth/Categories/NSURL+Base.m
  21. +230 −0 Classes/OAuth/Crytpo/Base64Transcoder.c
  22. +36 −0 Classes/OAuth/Crytpo/Base64Transcoder.h
  23. +86 −0 Classes/OAuth/Crytpo/hmac.c
  24. +31 −0 Classes/OAuth/Crytpo/hmac.h
  25. +169 −0 Classes/OAuth/Crytpo/sha1.c
  26. +12 −0 Classes/OAuth/Crytpo/sha1.h
  27. +45 −0 Classes/OAuth/OAAsynchronousDataFetcher.h
  28. +134 −0 Classes/OAuth/OAAsynchronousDataFetcher.m
  29. +40 −0 Classes/OAuth/OAConsumer.h
  30. +51 −0 Classes/OAuth/OAConsumer.m
  31. +45 −0 Classes/OAuth/OADataFetcher.h
  32. +65 −0 Classes/OAuth/OADataFetcher.m
  33. +32 −0 Classes/OAuth/OAHMAC_SHA1SignatureProvider.h
  34. +58 −0 Classes/OAuth/OAHMAC_SHA1SignatureProvider.m
  35. +68 −0 Classes/OAuth/OAMutableURLRequest.h
  36. +231 −0 Classes/OAuth/OAMutableURLRequest.m
  37. +31 −0 Classes/OAuth/OAPlaintextSignatureProvider.h
  38. +43 −0 Classes/OAuth/OAPlaintextSignatureProvider.m
  39. +53 −0 Classes/OAuth/OAProblem.h
  40. +165 −0 Classes/OAuth/OAProblem.m
  41. +45 −0 Classes/OAuth/OARequestParameter.h
  42. +70 −0 Classes/OAuth/OARequestParameter.m
  43. +47 −0 Classes/OAuth/OAServiceTicket.h
  44. +56 −0 Classes/OAuth/OAServiceTicket.m
  45. +34 −0 Classes/OAuth/OASignatureProviding.h
  46. +41 −0 Classes/OAuth/OAToken.h
  47. +105 −0 Classes/OAuth/OAToken.m
  48. +39 −0 Classes/OAuth/OAuthConsumer.h
  49. +89 −0 Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.h
  50. +272 −0 Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.m
  51. +172 −0 Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.h
  52. +666 −0 Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.m
  53. +38 −0 Classes/ShareKit/Core/Categories/UIWebView+SHK.h
  54. +37 −0 Classes/ShareKit/Core/Categories/UIWebView+SHK.m
  55. +41 −0 Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.h
  56. +434 −0 Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.m
  57. +35 −0 Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.h
  58. +97 −0 Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.m
  59. +34 −0 Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.h
  60. +52 −0 Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.m
  61. +34 −0 Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.h
  62. +38 −0 Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.m
  63. +230 −0 Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.c
  64. +36 −0 Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.h
  65. +86 −0 Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.c
  66. +31 −0 Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.h
  67. +169 −0 Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.c
  68. +12 −0 Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.h
  69. +45 −0 Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.h
  70. +134 −0 Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.m
  71. +40 −0 Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.h
  72. +51 −0 Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.m
  73. +45 −0 Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.h
  74. +65 −0 Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.m
  75. +32 −0 Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.h
  76. +58 −0 Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.m
  77. +68 −0 Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.h
  78. +231 −0 Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.m
  79. +31 −0 Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.h
  80. +43 −0 Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.m
  81. +53 −0 Classes/ShareKit/Core/Helpers/OAuth/OAProblem.h
  82. +165 −0 Classes/ShareKit/Core/Helpers/OAuth/OAProblem.m
  83. +45 −0 Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.h
  84. +70 −0 Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.m
  85. +47 −0 Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.h
  86. +56 −0 Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.m
  87. +34 −0 Classes/ShareKit/Core/Helpers/OAuth/OASignatureProviding.h
  88. +41 −0 Classes/ShareKit/Core/Helpers/OAuth/OAToken.h
  89. +105 −0 Classes/ShareKit/Core/Helpers/OAuth/OAToken.m
  90. +39 −0 Classes/ShareKit/Core/Helpers/OAuth/OAuthConsumer.h
  91. +74 −0 Classes/ShareKit/Core/Helpers/SHKRequest.h
  92. +148 −0 Classes/ShareKit/Core/Helpers/SHKRequest.m
  93. +120 −0 Classes/ShareKit/Core/SHK.h
  94. +460 −0 Classes/ShareKit/Core/SHK.m
  95. +86 −0 Classes/ShareKit/Core/SHKItem.h
  96. +183 −0 Classes/ShareKit/Core/SHKItem.m
  97. +56 −0 Classes/ShareKit/Core/SHKOfflineSharer.h
  98. +153 −0 Classes/ShareKit/Core/SHKOfflineSharer.m
  99. +21 −0 Classes/ShareKit/Core/SHKSharers.plist
  100. +35 −0 Classes/ShareKit/Customize UI/SHKCustomFormController.h
  101. +133 −0 Classes/ShareKit/Customize UI/SHKCustomFormController.m
  102. +36 −0 Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.h
  103. +35 −0 Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.m
  104. +40 −0 Classes/ShareKit/Customize UI/SHKCustomShareMenu.h
  105. +36 −0 Classes/ShareKit/Customize UI/SHKCustomShareMenu.m
  106. +45 −0 Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.h
  107. +35 −0 Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.m
  108. +88 −0 Classes/ShareKit/Reachability/Reachability.h
  109. +273 −0 Classes/ShareKit/Reachability/Reachability.m
  110. +36 −0 Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.h
  111. +88 −0 Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.m
  112. +46 −0 Classes/ShareKit/Sharers/Actions/Email/SHKMail.h
  113. +186 −0 Classes/ShareKit/Sharers/Actions/Email/SHKMail.m
  114. +36 −0 Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.h
  115. +79 −0 Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.m
  116. +41 −0 Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.h
  117. +193 −0 Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.m
  118. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/close.png
  119. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/fbicon.png
  120. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login.png
  121. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2.png
  122. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2_down.png
  123. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login_down.png
  124. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout.png
  125. BIN Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout_down.png
  126. +23 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.h
  127. +213 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.h
  128. +33 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.m
  129. +137 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.h
  130. +606 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m
  131. +42 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.h
  132. +85 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.m
  133. +49 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.h
  134. +162 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.m
  135. +24 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.h
  136. +129 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.m
  137. +31 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.h
  138. +100 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.m
  139. +165 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.h
  140. +378 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.m
  141. +188 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.h
  142. +286 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.m
  143. +62 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.h
  144. +77 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.m
  145. +32 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.h
  146. +152 −0 Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.m
  147. +52 −0 Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.h
  148. +218 −0 Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.m
  149. +44 −0 Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.h
  150. +301 −0 Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.m
  151. +36 −0 Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.h
  152. +173 −0 Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.m
  153. +35 −0 Classes/ShareKit/Sharers/Services/Read It Later/SHKReadItLater.h
  154. +188 −0 Classes/ShareKit/Sharers/Services/Read It Later/SHKReadItLater.m
  155. +61 −0 Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.h
  156. +379 −0 Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.m
  157. +44 −0 Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.h
  158. +212 −0 Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.m
  159. +46 −0 Classes/ShareKit/UI/SHKActionSheet.h
  160. +102 −0 Classes/ShareKit/UI/SHKActionSheet.m
  161. +59 −0 Classes/ShareKit/UI/SHKActivityIndicator.h
  162. +277 −0 Classes/ShareKit/UI/SHKActivityIndicator.m
  163. +82 −0 Classes/ShareKit/UI/SHKFormController.h
  164. +288 −0 Classes/ShareKit/UI/SHKFormController.m
  165. +61 −0 Classes/ShareKit/UI/SHKFormFieldCell.h
  166. +156 −0 Classes/ShareKit/UI/SHKFormFieldCell.m
  167. +55 −0 Classes/ShareKit/UI/SHKFormFieldSettings.h
  168. +54 −0 Classes/ShareKit/UI/SHKFormFieldSettings.m
  169. +36 −0 Classes/ShareKit/UI/SHKNavController.h
  170. +38 −0 Classes/ShareKit/UI/SHKNavController.m
  171. +57 −0 Classes/ShareKit/UI/SHKOAuthView.h
  172. +158 −0 Classes/ShareKit/UI/SHKOAuthView.m
  173. +56 −0 Classes/ShareKit/UI/SHKShareMenu.h
  174. +325 −0 Classes/ShareKit/UI/SHKShareMenu.m
  175. +35 −0 Classes/ShareKit/UI/SHKViewControllerWrapper.h
  176. +38 −0 Classes/ShareKit/UI/SHKViewControllerWrapper.m
  177. +279 −0 MainWindow.xib
  178. +384 −0 RootViewController.xib
  179. +30 −0 ShareKit-Info.plist
  180. +1,469 −0 ShareKit.xcodeproj/nate.mode1v3
  181. +1,472 −0 ShareKit.xcodeproj/nate.pbxuser
  182. +892 −0 ShareKit.xcodeproj/project.pbxproj
  183. +14 −0 ShareKit_Prefix.pch
  184. +17 −0 main.m
@@ -0,0 +1,38 @@
+//
+// ExampleShareFile.h
+// ShareKit
+//
+// Created by Nathan Weiner on 6/29/10.
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface ExampleShareFile : UIViewController <UIWebViewDelegate>
+{
+ UIWebView *webView;
+}
+
+@property (nonatomic, retain) UIWebView *webView;
+
+@end
@@ -0,0 +1,82 @@
+//
+// ExampleShareFile.m
+// ShareKit
+//
+// Created by Nathan Weiner on 6/29/10.
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+#import "ExampleShareFile.h"
+#import "SHK.h"
+#import "SHKActionSheet.h"
+
+@implementation ExampleShareFile
+
+@synthesize webView;
+
+- (void)dealloc
+{
+ [webView release];
+ [super dealloc];
+}
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
+ {
+ self.toolbarItems = [NSArray arrayWithObjects:
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease],
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease],
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease],
+ nil
+ ];
+ }
+
+ return self;
+}
+
+- (void)loadView
+{
+ self.webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+ webView.delegate = self;
+ webView.scalesPageToFit = YES;
+ [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"example.pdf"]]]];
+
+ self.view = webView;
+}
+
+- (void)share
+{
+ NSString *filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"example.pdf"];
+ NSData *file = [NSData dataWithContentsOfFile:filePath];
+
+ SHKItem *item = [SHKItem file:file filename:@"Awesome.pdf" mimeType:@"application/pdf" title:@"My Awesome PDF"];
+ SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
+ [actionSheet showFromToolbar:self.navigationController.toolbar];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return YES;
+}
+
+@end
@@ -0,0 +1,38 @@
+//
+// ExampleShareImage.h
+// ShareKit
+//
+// Created by Nathan Weiner on 6/18/10.
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface ExampleShareImage : UIViewController
+{
+ UIImageView *imageView;
+}
+
+@property (nonatomic, retain) UIImageView *imageView;
+
+@end
@@ -0,0 +1,83 @@
+ //
+// ExampleShareImage.m
+// ShareKit
+//
+// Created by Nathan Weiner on 6/18/10.
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+#import "ExampleShareImage.h"
+#import "SHKItem.h"
+#import "SHKActionSheet.h"
+
+@implementation ExampleShareImage
+
+@synthesize imageView;
+
+- (void)dealloc
+{
+ [imageView release];
+ [super dealloc];
+}
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
+ {
+ self.toolbarItems = [NSArray arrayWithObjects:
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease],
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease],
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease],
+ nil
+ ];
+ }
+
+ return self;
+}
+
+- (void)loadView
+{
+ [super loadView];
+
+ self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sanFran.jpg"]];
+
+ imageView.frame = CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height);
+
+ [self.view addSubview:imageView];
+
+ [imageView release];
+}
+
+- (void)share
+{
+ SHKItem *item = [SHKItem image:imageView.image title:@"San Francisco"];
+ SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
+
+ [actionSheet showFromToolbar:self.navigationController.toolbar];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return YES;
+}
+
+@end
@@ -0,0 +1,38 @@
+//
+// ExampleShareLink.h
+// ShareKit
+//
+// Created by Nathan Weiner on 6/17/10.
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface ExampleShareLink : UIViewController <UIWebViewDelegate>
+{
+ UIWebView *webView;
+}
+
+@property (nonatomic, retain) UIWebView *webView;
+
+@end
@@ -0,0 +1,78 @@
+ //
+// ExampleShareLink.m
+// ShareKit
+//
+// Created by Nathan Weiner on 6/17/10.
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+#import "ExampleShareLink.h"
+#import "SHK.h"
+
+@implementation ExampleShareLink
+
+@synthesize webView;
+
+- (void)dealloc
+{
+ [webView release];
+ [super dealloc];
+}
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
+ {
+ self.toolbarItems = [NSArray arrayWithObjects:
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease],
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease],
+ [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease],
+ nil
+ ];
+ }
+
+ return self;
+}
+
+- (void)share
+{
+ SHKItem *item = [SHKItem URL:webView.request.URL title:[webView pageTitle]];
+ SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
+ [actionSheet showFromToolbar:self.navigationController.toolbar];
+}
+
+- (void)loadView
+{
+ self.webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+ webView.delegate = self;
+ webView.scalesPageToFit = YES;
+ [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apple.com/"]]];
+
+ self.view = webView;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return YES;
+}
+
+@end
Oops, something went wrong.

0 comments on commit bd0e168

Please sign in to comment.