learn-co-curriculum / mobile-development-curriculum

Other
0 stars 0 forks source link

III.ii.07 - reading-ios-categories #41

Closed markedwardmurray closed 8 years ago

markedwardmurray commented 9 years ago

Set up the problem. When are categories useful? What can we do with them?

Discuss "composition" in brief terms if the previous reading on inheritance vs composition is dropped.

Maybe pick a different example? One with more common use? Maybe a category to add a reverse method on NSString ?

AnnJohn commented 9 years ago

Iceboxing for now and Mark will close when he's done with the issue

markedwardmurray commented 9 years ago

extending NSString with stringByReversingString: makes more sense. Best use case from my experience was extending NSDate for specific API response formats, but that requires explaining NSDate and NSDateFormatter.

https://github.com/learn-co-curriculum/reading-ios-categories

markedwardmurray commented 9 years ago

need to explain that properties cannot be added to extensions, mention that it has application for Core Data (though this may have changed in new versions of Xcode ?).