diff --git a/BFRImageViewController/BFRImageViewController.h b/BFRImageViewController/BFRImageViewController.h index 84ae004..7fe2504 100644 --- a/BFRImageViewController/BFRImageViewController.h +++ b/BFRImageViewController/BFRImageViewController.h @@ -18,6 +18,8 @@ /*! When peeking, iOS already hides the status bar for you. In that case, leave this to the default value of NO. If you are using this class outside of 3D touch, set this to YES. */ @property (nonatomic, getter=shouldHideStatusBar) BOOL hideStatusBar; + +/*! Flag property that lets disable the doneButton. Default to YES */ @property (nonatomic) BOOL enableDoneButton; @end diff --git a/BFRImageViewController/BFRImageViewController.m b/BFRImageViewController/BFRImageViewController.m index 5042d81..2034c2f 100644 --- a/BFRImageViewController/BFRImageViewController.m +++ b/BFRImageViewController/BFRImageViewController.m @@ -38,6 +38,7 @@ - (instancetype)initWithImageSource:(NSArray *)images { NSAssert(images.count > 0, @"You must supply at least one image source to use this class."); self.images = images; self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + self.enableDoneButton = YES; } return self; diff --git a/BFRImageViewerDemo/BFRImageViewer/FirstViewController.m b/BFRImageViewerDemo/BFRImageViewer/FirstViewController.m index e29b58c..6f219f5 100644 --- a/BFRImageViewerDemo/BFRImageViewer/FirstViewController.m +++ b/BFRImageViewerDemo/BFRImageViewer/FirstViewController.m @@ -26,8 +26,7 @@ - (void)viewDidLoad { - (void)openImage { //Here, the image source could be an array containing/a mix of URL strings, NSURLs, PHAssets, or UIImages - BFRImageViewController *imageVC = [[BFRImageViewController alloc] initWithImageSource:@[self.imgURL]]; - imageVC.enableDoneButton = YES; + BFRImageViewController *imageVC = [[BFRImageViewController alloc] initWithImageSource:@[self.imgURL]]; [self presentViewController:imageVC animated:YES completion:nil]; }