r/ObjectiveC • u/whackylabs • Mar 13 '20
Objective-C Properties Problems
https://whackylabs.com/objc/2020/03/12/objc-properties/
5
Upvotes
r/ObjectiveC • u/whackylabs • Mar 13 '20
View all comments
1
u/andyscorner Mar 14 '20 edited Mar 14 '20
For his
DateWrapperclasshethe author should have internally stored anNSDateComponentsinstance instead of generating a new one each time the getter is called. There's.dateto get anNSDateobject back from theNSDateComponentsclass.NSDateComponentsare meant to be used to manipulate dates so why not use that from the beginning. This is just a code smell and a bad example.