Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

use MWPhotoBrowser with storyboards #72

Closed
wants to merge 1 commit into from

2 participants

@vectoroc

Hello. I wrote a small monkey patch to provide ability to init MWPhotoBrowser from prepareForSegue.
Check it out pls.

@OCipriano

I would also like to use this with storyboards

@mwaterfall mwaterfall closed this pull request from a commit
@mwaterfall Added delegate as IBOutlet.
Closes #72
42ebd81
@mwaterfall mwaterfall closed this in 42ebd81
@gongpengjun gongpengjun referenced this pull request from a commit
@mwaterfall Added delegate as IBOutlet.
Closes #72
ea4a723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 17, 2012
  1. @vectoroc
This page is out of date. Refresh to see the latest.
View
1  MWPhotoBrowser/Classes/MWPhotoBrowser.h
@@ -33,6 +33,7 @@
// Properties
@property (nonatomic) BOOL displayActionButton;
+@property (nonatomic) IBOutlet id<MWPhotoBrowserDelegate> delegate;
// Init
- (id)initWithPhotos:(NSArray *)photosArray __attribute__((deprecated)); // Depreciated
View
54 MWPhotoBrowser/Classes/MWPhotoBrowser.m
@@ -139,31 +139,43 @@ @implementation MWPhotoBrowser
@synthesize displayActionButton = _displayActionButton, actionsSheet = _actionsSheet;
@synthesize progressHUD = _progressHUD;
@synthesize previousViewControllerBackButton = _previousViewControllerBackButton;
+@synthesize delegate = _delegate;
#pragma mark - NSObject
-- (id)init {
+- (id) init {
if ((self = [super init])) {
-
- // Defaults
- self.wantsFullScreenLayout = YES;
- self.hidesBottomBarWhenPushed = YES;
- _photoCount = NSNotFound;
- _currentPageIndex = 0;
- _performingLayout = NO; // Reset on view did appear
- _rotating = NO;
- _viewIsActive = NO;
- _visiblePages = [[NSMutableSet alloc] init];
- _recycledPages = [[NSMutableSet alloc] init];
- _photos = [[NSMutableArray alloc] init];
- _displayActionButton = NO;
- _didSavePreviousStateOfNavBar = NO;
-
- // Listen for MWPhoto notifications
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(handleMWPhotoLoadingDidEndNotification:)
- name:MWPHOTO_LOADING_DID_END_NOTIFICATION
- object:nil];
+ [self _initialization];
+ }
+ return self;
+}
+
+- (void) _initialization {
+ // Defaults
+ self.wantsFullScreenLayout = YES;
+ self.hidesBottomBarWhenPushed = YES;
+ _photoCount = NSNotFound;
+ _currentPageIndex = 0;
+ _performingLayout = NO; // Reset on view did appear
+ _rotating = NO;
+ _viewIsActive = NO;
+ _visiblePages = [[NSMutableSet alloc] init];
+ _recycledPages = [[NSMutableSet alloc] init];
+ _photos = [[NSMutableArray alloc] init];
+ _displayActionButton = NO;
+ _didSavePreviousStateOfNavBar = NO;
+
+ // Listen for MWPhoto notifications
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(handleMWPhotoLoadingDidEndNotification:)
+ name:MWPHOTO_LOADING_DID_END_NOTIFICATION
+ object:nil];
+}
+
+- (id) initWithCoder:(NSCoder *)aDecoder {
+ self = [super initWithCoder:aDecoder];
+ if (self) {
+ [self _initialization];
}
return self;
}
Something went wrong with that request. Please try again.