Downloadable
public protocol Downloadable : AnyObject
Protocol for observing, binding and (re)creating objects which can be downloaded
-
Fabric initializer
Declaration
Swift
init?(_ downloadableUniqueId: String)
Parameters
downloadableUniqueId
unique ID for identifying specific object in this type of objects
-
Unique ID for identifying specific object in this type of objects
Declaration
Swift
var downloadUniqueId: String { get }
-
Remote file/source URL
Declaration
Swift
var downloadRemoteUrl: URL { get }
-
Local/target URL
Declaration
Swift
var downloadLocalUrl: URL { get }
-
observe(by:)
Extension methodAdding listener who observes this
Downloadable
downloading progressDeclaration
Swift
func observe(by observer: DownloadStatusListner)
Parameters
observer
observer which listenes
-
resumeDownload()
Extension methodStarts/Resumes download. Should not be called before downloading service is ready - can appear multiple identical downloads.
Declaration
Swift
public func resumeDownload() -> Self
Return Value
returns object which is binded to dowload service and can be observed etc.
-
cancelDownload()
Extension methodCancelles downloading
Declaration
Swift
public func cancelDownload()
-
isDownloading
Extension methodGets downloading status
Declaration
Swift
public var isDownloading: Bool { get }
-
isDownloadLocalFileExist
Extension methodChecks if file already downloaded
Declaration
Swift
public var isDownloadLocalFileExist: Bool { get }