Protocols

The following protocols are available globally.

  • A protocol for a “read only” view on a loadable object which allows to observe the state but does not allow to sync the contents (i.e. trigger a refresh, upload, etc depending on the context). (It’s similar to the difference between “Promise” in “Deferred” in jQuery.)

    Note that there is no explicit “value” property here, the extension of the protocol should specify additional fields (“contents” properties) that together constitute the “value” of the promise.

    See more

    Declaration

    Objective-C

    @protocol MMMPureLoadable <NSObject>

    Swift

    protocol MMMPureLoadableProtocol : NSObjectProtocol
  • A part of the ‘loadable’ interface allowing to trigger a refresh (sync).

    See more

    Declaration

    Objective-C

    @protocol MMMLoadable <MMMPureLoadable>

    Swift

    protocol MMMLoadableProtocol : MMMPureLoadableProtocol
  • Protocol observers of loadable objects should conform to. You can use it directly in your classes observing loadables or employ a proxy object defined below which allows to use blocks or selectors and which won’t forget to remove itself when deallocated.

    See more

    Declaration

    Objective-C

    @protocol MMMLoadableObserver <NSObject>

    Swift

    protocol MMMLoadableObserverProtocol : NSObjectProtocol
  • We need thumbnail images in a couple of places and they are not typically accessible immediately even if they sit in a local cache or DB. So here is a simple protocol based on MMMLoadable (which is kind of a “promise” object) to wrap such images.

    See more

    Declaration

    Objective-C

    @protocol MMMLoadableImage <MMMLoadable>

    Swift

    protocol MMMLoadableImage : MMMLoadableProtocol