Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use MWPhotoBrowser with storyboards #72

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions MWPhotoBrowser/Classes/MWPhotoBrowser.h
Expand Up @@ -33,6 +33,7 @@

// Properties
@property (nonatomic) BOOL displayActionButton;
@property (nonatomic) IBOutlet id<MWPhotoBrowserDelegate> delegate;

// Init
- (id)initWithPhotos:(NSArray *)photosArray __attribute__((deprecated)); // Depreciated
Expand Down
54 changes: 33 additions & 21 deletions MWPhotoBrowser/Classes/MWPhotoBrowser.m
Expand Up @@ -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;
}
Expand Down