diff --git a/SKPhotoBrowser/SKLocalPhoto.swift b/SKPhotoBrowser/SKLocalPhoto.swift index f7736c0..4eb9bb2 100644 --- a/SKPhotoBrowser/SKLocalPhoto.swift +++ b/SKPhotoBrowser/SKLocalPhoto.swift @@ -15,7 +15,7 @@ public class SKLocalPhoto: NSObject, SKPhotoProtocol { public var photoURL: String! public var shouldCachePhotoURLImage: Bool = false public var caption: String! - public var index: Int? + public var index: Int = 0 override init() { super.init() diff --git a/SKPhotoBrowser/SKPhoto.swift b/SKPhotoBrowser/SKPhoto.swift index 5acff7c..b8aef3e 100644 --- a/SKPhotoBrowser/SKPhoto.swift +++ b/SKPhotoBrowser/SKPhoto.swift @@ -8,10 +8,10 @@ import UIKit -public protocol SKPhotoProtocol: NSObjectProtocol { +@objc public protocol SKPhotoProtocol: NSObjectProtocol { var underlyingImage: UIImage! { get } var caption: String! { get } - var index: Int? { get set} + var index: Int { get set} func loadUnderlyingImageAndNotify() func checkCache() } @@ -23,7 +23,7 @@ public class SKPhoto: NSObject, SKPhotoProtocol { public var photoURL: String! public var shouldCachePhotoURLImage: Bool = false public var caption: String! - public var index: Int? + public var index: Int = 0 override init() { super.init()