Skip to content
/ HOM Public

Higher Order Messaging in Obj-C

Notifications You must be signed in to change notification settings

pistelak/HOM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Higher Order Messaging

WIP

ifResponds

[[self.delegate ifResponds] aSelector]; 

can be used instead of:

if ([self.delegate respondsToSelector:@selector(aSelector)]) {
    [self.delegate performSelector:@selector(aSelector) withObject:self];
}

collect

- (NSArray *)customerNames {
    return [self.allCustomers collect] name]; 
}

can be used instead of:

- (NSArray *)customerNames {
   
    NSMutableArray *allNames = [NSMutableArray alloc] init];

    for (Customer *customer in [self allCustomers]) {
        [allNames addObject:customer.name];
    }

    return [allNames copy]; 
}

where Customer:

@interface Customer: NSObject
@property (nonatomic, copy, nonnull) NSString *name; 
@end 

More informations:

Releases

No releases published

Packages

No packages published