ReactiveCocoa -- RACTuple,
Basic Information
Example
[[self rac_signalForSelector:@selector(tableView:didSelectRowAtIndexPath:) fromProtocol:@protocol(UITableViewDelegate)] subscribeNext:^(RACTuple *tuple) { NSLog(@"%@", tuple.first); NSLog(@"%@", tuple.second); }];
It is used in combination with the protocol.
Method Introduction
+ (instancetype)tupleWithObjectsFromArray:(NSArray *)array;
Initializes a RACTuple object. The data comes from an array.
+ (instancetype)tupleWithObjectsFromArray:(NSArray *)array convertNullsToNils:(BOOL)convert;
Initialize a RACTuple object and the data comes from an array. Ifconvert
Set to YES, thenNSNull
The value is convertedRACTupleNil
+ (instancetype)tupleWithObjects:(id)object, ... NS_REQUIRES_NIL_TERMINATION;
Initializes a RACTuple object. The data comes from an array.
- (NSArray *)allObjects;
Returns an array of elements.
- (instancetype)tupleByAddingObject:(id)obj;
You can also add elements.