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

add a property "isInGrid" to find are we in grid #561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Pod/Classes/MWPhotoBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
@property (nonatomic) BOOL autoPlayOnAppear;
@property (nonatomic) NSUInteger delayToHideElements;
@property (nonatomic, readonly) NSUInteger currentIndex;
@property (nonatomic, readonly) BOOL isInGrid;

// Customise image selection icons as they are the only icons with a colour tint
// Icon should be located in the app's main bundle
Expand Down
8 changes: 6 additions & 2 deletions Pod/Classes/MWPhotoBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ - (void)updateNavigation {

// Title
NSUInteger numberOfPhotos = [self numberOfPhotos];
if (_gridController) {
if (self.isInGrid) {
if (_gridController.selectionMode) {
self.title = NSLocalizedString(@"Select Photos", nil);
} else {
Expand Down Expand Up @@ -1301,13 +1301,17 @@ - (void)positionVideoLoadingIndicator {

#pragma mark - Grid

- (BOOL)isInGrid{
return _gridController != nil;
}

- (void)showGridAnimated {
[self showGrid:YES];
}

- (void)showGrid:(BOOL)animated {

if (_gridController) return;
if (self.isInGrid) return;

// Clear video
[self clearCurrentVideo];
Expand Down