forked from x2on/PhotoViewer
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Showing showing off how integration with ShareKit could work with the EGOPhotoViewer with the modular design.
- Loading branch information
Franklin Webber
committed
Apr 23, 2012
1 parent
eca7635
commit de136a6
Showing
138 changed files
with
13,982 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// MySHKConfigurator.h | ||
// EGOPhotoViewer_Demo | ||
// | ||
// Created by Franklin Webber on 4/23/12. | ||
// Copyright (c) 2012 Franklin Webber. All rights reserved. | ||
// | ||
|
||
#import "SHKConfiguration.h" | ||
|
||
@interface MySHKConfigurator : DefaultSHKConfigurator | ||
|
||
+ (void)setup; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// MySHKConfigurator.m | ||
// EGOPhotoViewer_Demo | ||
// | ||
// Created by Franklin Webber on 4/23/12. | ||
// Copyright (c) 2012 Franklin Webber. All rights reserved. | ||
// | ||
|
||
#import "MySHKConfigurator.h" | ||
|
||
@implementation MySHKConfigurator | ||
|
||
+ (void)setup { | ||
|
||
static BOOL configurationHasNotBeenDone = YES; | ||
|
||
if (configurationHasNotBeenDone) { | ||
DefaultSHKConfigurator *configurator = [[MySHKConfigurator alloc] init]; | ||
[SHKConfiguration sharedInstanceWithConfigurator:configurator]; | ||
|
||
configurationHasNotBeenDone = NO; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// SHKActionViewController.h | ||
// EGOPhotoViewer_Demo | ||
// | ||
// Created by Franklin Webber on 4/23/12. | ||
// Copyright (c) 2012 Franklin Webber. All rights reserved. | ||
// | ||
|
||
#import "EGOActionViewController.h" | ||
#import "SHK.h" | ||
|
||
@interface SHKActionViewController : UIViewController <EGOActionViewController,UIActionSheetDelegate> | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// | ||
// SHKActionViewController.m | ||
// EGOPhotoViewer_Demo | ||
// | ||
// Created by Franklin Webber on 4/23/12. | ||
// Copyright (c) 2012 Franklin Webber. All rights reserved. | ||
// | ||
|
||
#import "SHKActionViewController.h" | ||
#import "MySHKConfigurator.h" | ||
|
||
@interface SHKActionViewController () | ||
|
||
@property (nonatomic,strong) SHKActionSheet *actionSheet; | ||
|
||
@end | ||
|
||
@implementation SHKActionViewController | ||
|
||
@synthesize photoSource; | ||
@synthesize currentIndex; | ||
@synthesize embeddedInPopover; | ||
|
||
@synthesize actionSheet = actionSheet_; | ||
|
||
- (id)init { | ||
self = [super init]; | ||
if (self) { | ||
[MySHKConfigurator setup]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
|
||
self.view.userInteractionEnabled = NO; | ||
|
||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated { | ||
[super viewWillAppear:animated]; | ||
|
||
SHKItem *shareItem = [SHKItem image:[[self photo] image] title:[[self photo] title]]; | ||
|
||
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:shareItem]; | ||
|
||
[SHK setRootViewController:self.parentViewController]; | ||
|
||
[actionSheet showFromToolbar:self.navigationController.toolbar]; | ||
|
||
actionSheet.delegate = self; | ||
self.actionSheet = actionSheet; | ||
|
||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated { | ||
[super viewDidAppear:animated]; | ||
} | ||
|
||
#pragma mark - Photo Helper | ||
|
||
- (id<EGOPhoto>)photo { | ||
return [self.photoSource photoAtIndex:self.currentIndex]; | ||
} | ||
|
||
#pragma mark - UIActionSheetDelegate Adherence | ||
|
||
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ | ||
|
||
[self.view removeFromSuperview]; | ||
[self removeFromParentViewController]; | ||
|
||
} | ||
|
||
@end |
99 changes: 99 additions & 0 deletions
99
Demo/Vendor/ShareKit/Configuration/DefaultSHKConfigurator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// | ||
// DefaultSHKConfigurationDelegate.h | ||
// ShareKit | ||
// | ||
// Created by Edward Dale on 10/16/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. | ||
// | ||
// | ||
|
||
/* | ||
Debugging | ||
------ | ||
To show ShareKit specific debug output in the console, define _SHKDebugShowLogs (uncomment next line). | ||
*/ | ||
//#define _SHKDebugShowLogs | ||
|
||
#ifdef _SHKDebugShowLogs | ||
#define SHKDebugShowLogs 1 | ||
#define SHKLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) | ||
#else | ||
#define SHKDebugShowLogs 0 | ||
#define SHKLog( s, ... ) | ||
#endif | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface DefaultSHKConfigurator : NSObject | ||
|
||
- (NSString*)appName; | ||
- (NSString*)appURL; | ||
- (NSArray*)defaultFavoriteURLSharers; | ||
- (NSArray*)defaultFavoriteImageSharers; | ||
- (NSArray*)defaultFavoriteTextSharers; | ||
- (NSArray*)defaultFavoriteFileSharers; | ||
- (NSString*)vkontakteAppId; | ||
- (NSString*)facebookAppId; | ||
- (NSString*)facebookLocalAppId; | ||
- (NSArray*)facebookListOfPermissions; | ||
- (NSString*)readItLaterKey; | ||
- (NSNumber*)forcePreIOS5TwitterAccess; | ||
- (NSString*)twitterConsumerKey; | ||
- (NSString*)twitterSecret; | ||
- (NSString*)twitterCallbackUrl; | ||
- (NSNumber*)twitterUseXAuth; | ||
- (NSString*)twitterUsername; | ||
- (NSString*)evernoteUserStoreURL; | ||
- (NSString*)evernoteNetStoreURLBase; | ||
- (NSString*)evernoteConsumerKey; | ||
- (NSString*)evernoteSecret; | ||
- (NSString*)flickrConsumerKey; | ||
- (NSString*)flickrSecretKey; | ||
- (NSString*)flickrCallbackUrl; | ||
- (NSString*)bitLyLogin; | ||
- (NSString*)bitLyKey; | ||
- (NSString*)linkedInConsumerKey; | ||
- (NSString*)linkedInSecret; | ||
- (NSString*)linkedInCallbackUrl; | ||
- (NSString*)readabilityConsumerKey; | ||
- (NSString*)readabilitySecret; | ||
- (NSNumber*)readabilityUseXAuth; | ||
- (NSString*)foursquareV2ClientId; | ||
- (NSString*)foursquareV2RedirectURI; | ||
- (NSNumber*)shareMenuAlphabeticalOrder; | ||
- (NSNumber*)sharedWithSignature; | ||
- (NSString*)barStyle; | ||
- (UIColor*)barTintForView:(UIViewController*)vc; | ||
- (UIColor*)formFontColor; | ||
- (UIColor*)formBackgroundColor; | ||
- (NSString*)modalPresentationStyle; | ||
- (NSString*)modalTransitionStyle; | ||
- (NSNumber*)maxFavCount; | ||
- (NSNumber*)autoOrderFavoriteSharers; | ||
- (NSString*)favsPrefixKey; | ||
- (NSString*)authPrefix; | ||
- (NSString*)sharersPlistName; | ||
- (NSNumber*)showActionSheetMoreButton; | ||
- (NSNumber*)allowOffline; | ||
- (NSNumber*)allowAutoShare; | ||
- (NSNumber*)usePlaceholders; | ||
|
||
@end |
Oops, something went wrong.