From 9fe3bbd808a95356f7d40fd4af09a127a616ea52 Mon Sep 17 00:00:00 2001 From: komitake Date: Fri, 1 Apr 2016 03:10:19 +0900 Subject: [PATCH] Fixed delegate didDismissActionSheetWithButtonIndex was not called --- SKPhotoBrowser/SKPhotoBrowser.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SKPhotoBrowser/SKPhotoBrowser.swift b/SKPhotoBrowser/SKPhotoBrowser.swift index d391094..34a8cc9 100644 --- a/SKPhotoBrowser/SKPhotoBrowser.swift +++ b/SKPhotoBrowser/SKPhotoBrowser.swift @@ -1179,9 +1179,9 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate { let actionSheetController = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet) actionSheetController.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: { (action) -> Void in })) - for actionTitle in titles { - actionSheetController.addAction(UIAlertAction(title: actionTitle, style: .Default, handler: { (action) -> Void in - + for idx in titles.indices { + actionSheetController.addAction(UIAlertAction(title: titles[idx], style: .Default, handler: { (action) -> Void in + self.delegate?.didDismissActionSheetWithButtonIndex?(idx, photoIndex: self.currentPageIndex) })) }