EkoObject
@interface EkoObject<__covariant ObjectType> : NSObject
Proxy for an object.
-
Current object data status.
Declaration
Objective-C
@property (nonatomic) EkoDataStatus dataStatus;
Swift
var dataStatus: EkoDataStatus { get set }
-
Current local object data status.
Declaration
Objective-C
@property (nonatomic) EkoLoadingStatus loadingStatus;
Swift
var loadingStatus: EkoLoadingStatus { get set }
-
Direct access to this object.
Declaration
Objective-C
@property (readonly, nonatomic, nullable) ObjectType object;
Swift
var object: ObjectType? { get }
-
@abstract Adds a block to observe changes in the proxied object. @discussion Observers can be notified when the object is available. In case the object doesn’t exist, or was unavailable, an error will be passed.
Declaration
Objective-C
- (nonnull EkoNotificationToken *)observeWithBlock: (nonnull void (^)(EkoObject<ObjectType> *_Nonnull, NSError *_Nullable))block;
Swift
func observe(_ block: @escaping (EkoObject<ObjectType>, Error?) -> Void) -> EkoNotificationToken
Parameters
block
The block to execute when the request result has changed.
Return Value
EkoNotificationToken object that should be retained to continue to observe.
-
@abstract Adds a block to observe a change in the proxy exactly once. @discussion Observers can be notified when the object is available. In case the object doesn’t exist or was unavailable an error will be passed.
Declaration
Objective-C
- (nonnull EkoNotificationToken *)observeOnceWithBlock: (nonnull void (^)(EkoObject<ObjectType> *_Nonnull, NSError *_Nullable))block;
Swift
func observeOnce(_ block: @escaping (EkoObject<ObjectType>, Error?) -> Void) -> EkoNotificationToken
Parameters
block
The block to execute exactly once when the request result has changed.
Return Value
EkoNotificationToken object that should be retained to continue to observe.
-
Unavailable
Block call of
init
andnew
because EkoObject cannot be created directlyDeclaration
Objective-C
- (nonnull instancetype)init;