MMMPureLoadableGroup
Objective-C
@interface MMMPureLoadableGroup : NSObject <MMMPureLoadable>
Swift
class MMMPureLoadableGroup : NSObject, MMMPureLoadableProtocol
Allows to treat several “pure” loadables as one.
The group supports 2 different modes:
- “all” (this is the default), where the group is considered ‘synced successfully’ when all of its children are ‘synced successfully’;
- “at least one”, where the group is considered ‘synced successfully’ when at least one of its child loadables is ‘synced successfully’.
This can be used standalone or subclassed (see MMMLoadable+Subclasses.h
in this case.)
The ‘did change’ event of the group is triggered when its loadableState
changes or, if all objects are loaded,
then every time any of the them emits ‘did change’.
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithLoadables:(nullable NSArray<id<MMMPureLoadable>> *)loadables mode:(MMMLoadableGroupMode)mode NS_DESIGNATED_INITIALIZER;
Swift
init(loadables: [any MMMPureLoadableProtocol]?, mode: MMMLoadableGroupMode)
-
Convenience initializer using the “all” mode (former “strict” failure policy) for compatibility.
Declaration
Objective-C
- (nonnull instancetype)initWithLoadables: (nullable NSArray<id<MMMPureLoadable>> *)loadables;
Swift
convenience init(loadables: [any MMMPureLoadableProtocol]?)
-
Deprecated.**
Declaration
Objective-C
- (nonnull instancetype) initWithLoadables:(nullable NSArray<id<MMMPureLoadable>> *)loadables failurePolicy:(MMMLoadableGroupFailurePolicy)failurePolicy;
Swift
convenience init(loadables: [any MMMPureLoadableProtocol]?, failurePolicy: MMMLoadableGroupFailurePolicy)
-
Unavailable
Undocumented
Declaration
Objective-C
- (id)init NS_UNAVAILABLE;