Thanks to NSHipster’s review of instancetype
, I now know that I can
define class methods like this:
+ (instancetype)awesomeObjectWithName:(NSString *)name
{
// ...
}
Instead of this:
+ (NSAwesomeObject *)awesomeObjectWithName:(NSString *)name
{
// ...
}
I sure hope this means we’re going to get more and more type inference in Objective-C.
✦ PermalinkMy books...