diff --git a/Pod/Classes/MWPhotoBrowser.h b/Pod/Classes/MWPhotoBrowser.h index 4225f9cc1..58dc1f547 100644 --- a/Pod/Classes/MWPhotoBrowser.h +++ b/Pod/Classes/MWPhotoBrowser.h @@ -50,6 +50,8 @@ @property (nonatomic) BOOL enableSwipeToDismiss; @property (nonatomic) BOOL startOnGrid; @property (nonatomic) BOOL autoPlayOnAppear; +@property (nonatomic) BOOL hidesControlsOnSwipe; +@property (nonatomic) BOOL enableHideTimer; @property (nonatomic) NSUInteger delayToHideElements; @property (nonatomic, readonly) NSUInteger currentIndex; diff --git a/Pod/Classes/MWPhotoBrowser.m b/Pod/Classes/MWPhotoBrowser.m index 0de7faaab..b35b27307 100644 --- a/Pod/Classes/MWPhotoBrowser.m +++ b/Pod/Classes/MWPhotoBrowser.m @@ -82,7 +82,8 @@ - (void)_initialisation { _currentGridContentOffset = CGPointMake(0, CGFLOAT_MAX); _didSavePreviousStateOfNavBar = NO; self.automaticallyAdjustsScrollViewInsets = NO; - + _hidesControlsOnSwipe = YES; + _enableHideTimer = YES; // Listen for MWPhoto notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleMWPhotoLoadingDidEndNotification:) @@ -355,7 +356,8 @@ - (void)viewWillAppear:(BOOL)animated { [self setNavBarAppearance:animated]; // Update UI - [self hideControlsAfterDelay]; + if(_enableHideTimer) + [self hideControlsAfterDelay]; // Initial appearance if (!_viewHasAppearedInitially) { @@ -577,7 +579,8 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInte _currentPageIndex = _pageIndexBeforeRotation; // Delay control holding - [self hideControlsAfterDelay]; + if(_enableHideTimer) + [self hideControlsAfterDelay]; // Layout [self layoutVisiblePages]; @@ -1067,7 +1070,9 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { // Hide controls when dragging begins - [self setControlsHidden:YES animated:YES permanent:NO]; + if (_hidesControlsOnSwipe) { + [self setControlsHidden:YES animated:YES permanent:NO]; + } } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { @@ -1129,7 +1134,8 @@ - (void)jumpToPageAtIndex:(NSUInteger)index animated:(BOOL)animated { } // Update timer to give more time - [self hideControlsAfterDelay]; + if (_enableHideTimer) + [self hideControlsAfterDelay]; }