FirebaseStorage Framework Reference

StorageObservableTask

@available(iOS13,tvOS13,macOS10.15,watchOS7,*)@objc(FIRStorageObservableTask)openclassStorageObservableTask:StorageTask

An extended StorageTask providing observable semantics that can be used for responding to changes in task state.

Observers produce a StorageHandle, which is used to keep track of and remove specific observers at a later date.

  • Observes changes in the upload status: Resume, Pause, Progress, Success, and Failure.

    Declaration

    Swift

    @discardableResult@objc(observeStatus:handler:)openfuncobserve(_status:StorageTaskStatus,handler:@escaping(StorageTaskSnapshot)->Void)->String

    Parameters

    status

    The StorageTaskStatus change to observe.

    handler

    A callback that fires every time the status event occurs, containing a StorageTaskSnapshot describing task state.

    Return Value

    A task handle that can be used to remove the observer at a later date.

  • Removes the single observer with the provided handle.

    Declaration

    Swift

    @objc(removeObserverWithHandle:)openfuncremoveObserver(withHandlehandle:String)

    Parameters

    handle

    The handle of the task to remove.

  • Removes all observers for a single status.

    Declaration

    Swift

    @objc(removeAllObserversForStatus:)openfuncremoveAllObservers(forstatus:StorageTaskStatus)

    Parameters

    status

    A StorageTaskStatus to remove all listeners for.

  • Removes all observers.

    Declaration

    Swift

    @objcopenfuncremoveAllObservers()
close