SBSDKProgress

@interface SBSDKProgress : NSProgress

A NSProgress subclass with a simpler update mechanism and linked operation cancelling. To cancel the underlying operation simply call -cancel on the progress object.

  • The standard process for observing a NSProgress progressing is to use KVO on the NSProgress instance. The SBSDKProgressUpdateHandler simplifies observing the progress largely. It is called on main thread whenever the progress changes. Usually here you update your UI, e.g. UIProgressView.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) SBSDKProgessUpdateHandler updateHandler;

    Swift

    var updateHandler: SBSDKProgessUpdateHandler? { get set }
  • A convenience initializer mimicking the behavior of NSProgress.

    Declaration

    Objective-C

    + (nonnull SBSDKProgress *)progressWithTotalUnitCount:(int64_t)unitCount;

    Swift

    /*not inherited*/ init(totalUnitCount unitCount: Int64)

    Parameters

    unitCount

    The number of total work units the progress. See NSProgress.