diff --git a/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/UserInterfaceState.xcuserstate b/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/UserInterfaceState.xcuserstate index b7b960a..fcdddeb 100644 Binary files a/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/UserInterfaceState.xcuserstate and b/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index fd89c65..e10cb27 100644 --- a/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Example/RDImageViewerController.xcworkspace/xcuserdata/akira.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -31,7 +31,7 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "../RDImageViewerController/Classes/RDImageViewerController.swift" - timestampString = "577135342.8833359" + timestampString = "577297685.6991071" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "270" diff --git a/RDImageViewerController/Classes/RDImageContentData.swift b/RDImageViewerController/Classes/RDImageContentData.swift index c09af54..df46801 100644 --- a/RDImageViewerController/Classes/RDImageContentData.swift +++ b/RDImageViewerController/Classes/RDImageContentData.swift @@ -49,9 +49,9 @@ open class RDImageContentData: RDPageContentData { return true } - override open func reload() { + @objc override open func reload(completion: ((RDPageContentData) -> Void)?) { image = nil - preload() + preload(completion: completion) } override open func stopPreload() { diff --git a/RDImageViewerController/Classes/RDPageContentData.swift b/RDImageViewerController/Classes/RDPageContentData.swift index 63748af..5c6f598 100644 --- a/RDImageViewerController/Classes/RDPageContentData.swift +++ b/RDImageViewerController/Classes/RDPageContentData.swift @@ -13,6 +13,7 @@ public protocol RDPageContentProtocol { func preload(completion: ((RDPageContentData) -> Void)?) func stopPreload() func reload() + func reload(completion: ((RDPageContentData) -> Void)?) func reuseIdentifier() -> String func size(inRect rect: CGRect, direction: RDPagingView.ForwardDirection) -> CGSize } @@ -56,6 +57,10 @@ open class RDPageContentData: NSObject, RDPageContentProtocol { } @objc open func reload() { + reload(completion: nil) + } + + @objc open func reload(completion: ((RDPageContentData) -> Void)?) { NSException(name: NSExceptionName(rawValue: "RDPageContentData"), reason: "You have to override this method. \(#function)", userInfo: nil).raise() } diff --git a/RDImageViewerController/Classes/RDRemoteImageContentData.swift b/RDImageViewerController/Classes/RDRemoteImageContentData.swift index 69bea74..2c55197 100644 --- a/RDImageViewerController/Classes/RDRemoteImageContentData.swift +++ b/RDImageViewerController/Classes/RDRemoteImageContentData.swift @@ -31,13 +31,13 @@ open class RDRemoteImageContentData: RDImageContentData { } } - @objc override open func preload() { - preload(completion: nil) + @objc override open func reload(completion: ((RDPageContentData) -> Void)?) { + image = nil + preload(completion: completion) } - @objc override open func reload() { - image = nil - preload() + @objc override open func preload() { + preload(completion: nil) } open override func preload(completion: ((RDPageContentData) -> Void)?) {