From 812c87a3af418decd9063cc34c676eaf2193a745 Mon Sep 17 00:00:00 2001 From: Diego Chohfi Date: Tue, 25 Feb 2014 00:17:08 -0300 Subject: [PATCH] Adding property to manage delay time to hide interface --- MWPhotoBrowser/Classes/MWPhotoBrowser.h | 1 + MWPhotoBrowser/Classes/MWPhotoBrowser.m | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MWPhotoBrowser/Classes/MWPhotoBrowser.h b/MWPhotoBrowser/Classes/MWPhotoBrowser.h index 7ceae443d..ecc99f974 100644 --- a/MWPhotoBrowser/Classes/MWPhotoBrowser.h +++ b/MWPhotoBrowser/Classes/MWPhotoBrowser.h @@ -47,6 +47,7 @@ @property (nonatomic) BOOL alwaysShowControls; @property (nonatomic) BOOL enableGrid; @property (nonatomic) BOOL startOnGrid; +@property (nonatomic) NSUInteger delayToHideElements; @property (nonatomic, readonly) NSUInteger currentIndex; // Init diff --git a/MWPhotoBrowser/Classes/MWPhotoBrowser.m b/MWPhotoBrowser/Classes/MWPhotoBrowser.m index d5f0514a7..0e9a52a8c 100644 --- a/MWPhotoBrowser/Classes/MWPhotoBrowser.m +++ b/MWPhotoBrowser/Classes/MWPhotoBrowser.m @@ -70,6 +70,7 @@ - (void)_initialisation { _viewIsActive = NO; _enableGrid = YES; _startOnGrid = NO; + _delayToHideElements = 5; _visiblePages = [[NSMutableSet alloc] init]; _recycledPages = [[NSMutableSet alloc] init]; _photos = [[NSMutableArray alloc] init]; @@ -1344,7 +1345,7 @@ - (void)cancelControlHiding { - (void)hideControlsAfterDelay { if (![self areControlsHidden]) { [self cancelControlHiding]; - _controlVisibilityTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(hideControls) userInfo:nil repeats:NO]; + _controlVisibilityTimer = [NSTimer scheduledTimerWithTimeInterval:self.delayToHideElements target:self selector:@selector(hideControls) userInfo:nil repeats:NO]; } }