clean code.

This commit is contained in:
suzuki_keishi 2016-08-23 15:12:46 +09:00
parent 50fe55684f
commit 9b77a81734
2 changed files with 2 additions and 6 deletions

View File

@ -47,9 +47,6 @@ public class SKPhotoBrowser: UIViewController {
private let animator = SKAnimator()
public weak var delegate: SKPhotoBrowserDelegate?
// helpers which often used
private let bundle = NSBundle(forClass: SKPhotoBrowser.self)
// photos
var photos: [SKPhotoProtocol] = [SKPhotoProtocol]()
var numberOfPhotos: Int {
@ -77,7 +74,6 @@ public class SKPhotoBrowser: UIViewController {
public convenience init(originImage: UIImage, photos: [SKPhotoProtocol], animatedFromView: UIView) {
self.init(nibName: nil, bundle: nil)
animator.senderOriginImage = originImage
animator.senderViewForAnimation = animatedFromView
@ -456,7 +452,6 @@ internal extension SKPhotoBrowser {
return
}
let photo = photos[currentPageIndex]
if let titles = SKPhotoBrowserOptions.actionButtonTitles {
let actionSheetController = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)
actionSheetController.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: { (action) -> Void in
@ -481,6 +476,7 @@ internal extension SKPhotoBrowser {
})
}
} else {
let photo = photos[currentPageIndex]
guard let underlyingImage = photo.underlyingImage else {
return
}

View File

@ -44,7 +44,7 @@ extension FromWebViewController {
private extension FromWebViewController {
func createWebPhotos() -> [SKPhotoProtocol] {
return (0..<10).map { (i: Int) -> SKPhotoProtocol in
let photo = SKPhoto.photoWithImageURL("https://placehold.jp/15\(i)x15\(i).png")
let photo = SKPhoto.photoWithImageURL("https://placehold.jp/150\(i)x150\(i).png")
photo.caption = caption[i%10]
photo.shouldCachePhotoURLImage = true
return photo