From e915b09ee5ab7b9fe07dbaba56589b6ae0e623fe Mon Sep 17 00:00:00 2001 From: suzuki_keishi Date: Mon, 22 Feb 2016 18:47:22 +0900 Subject: [PATCH] [clean]some. --- SKPhotoBrowser/SKPhotoBrowser.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SKPhotoBrowser/SKPhotoBrowser.swift b/SKPhotoBrowser/SKPhotoBrowser.swift index 762eeb9..ef33ed6 100644 --- a/SKPhotoBrowser/SKPhotoBrowser.swift +++ b/SKPhotoBrowser/SKPhotoBrowser.swift @@ -61,8 +61,8 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate, UIActionShe private var doneButtonHideFrame: CGRect = CGRect(x: 5, y: -20, width: 44, height: 44) private var deleteButton: UIButton! - private var deleteButtonShowFrame: CGRect = CGRect(x: UIScreen.mainScreen().bounds.size.width - 60, y: 5, width: 44, height: 44) - private var deleteButtonHideFrame: CGRect = CGRect(x: UIScreen.mainScreen().bounds.size.width - 60, y: -20, width: 44, height: 44) + private var deleteButtonShowFrame: CGRect = CGRect(x: UIScreen.mainScreen().bounds.size.width - 44 - 5, y: 5, width: 44, height: 44) + private var deleteButtonHideFrame: CGRect = CGRect(x: UIScreen.mainScreen().bounds.size.width - 44 - 5, y: -20, width: 44, height: 44) // photo's paging private var visiblePages: Set = Set() @@ -865,9 +865,10 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate, UIActionShe } func deletePhoto(avc:UIAlertAction) -> Void{ - let index = photos[currentPageIndex].index - deleted.append(index!) - print(deleted) + guard let index = photos[currentPageIndex].index else { + return + } + deleted.append(index) if photos.count == 1 { dismissPhotoBrowser() } else {