This PR cleans up a swathe of classes to do the following:
remove manual property synthesis (i.e. @synthesize propertyName = _ivarName) except for properties defined in protocols.
remove manual ivar declarations that are already declared by properties.
move any remaining ivar declarations into the .m and .mm files.
This PR also clarifies a bunch of redundant or inappropriate @property attributes, according to the following rules:
remove assign from non-object properties (this is inferred)
add nonatomic to properties that are not expected to be thread-safe (almost all of them)
add atomic to properties that actually are expected to be thread-safe (mostly around async operations and rendering)
remove nullable from weak properties (this is implied)
remove copy, weak and strong from computed readonly properties (these attributes are only relevant for stored properties, not computed ones)
mark delegate-style properties as weak, or in rare cases unsafe_unretained(where code clearly relies on the property having a value)
mark weak IBOutlets as strong instead (this is now Apple's recommended practice)
Some classes with complex sets of ivars (e.g. BXSession and BXEmulator) have not yet been migrated, as they need additional work to expose necessary properties to subclasses/subcomponents. I have no doubt also missed a bunch of property attributes too.
cc @MaddTheSane you've done a lot of cleanup work around property attributes - this integrates your latest changes, and I'd appreciate your eyes on this in case I've inadvertently regressed something.
Based off https://github.com/alunbestor/Boxer/tree/64bit/master, which is a clone of https://github.com/MaddTheSane/Boxer/commit/234a6a7859ad2a2499eef59be345eacc7d5d79f8
This PR cleans up a swathe of classes to do the following:
@synthesize propertyName = _ivarName
) except for properties defined in protocols..m
and.mm
files.This PR also clarifies a bunch of redundant or inappropriate
@property
attributes, according to the following rules:assign
from non-object properties (this is inferred)nonatomic
to properties that are not expected to be thread-safe (almost all of them)atomic
to properties that actually are expected to be thread-safe (mostly around async operations and rendering)nullable
fromweak
properties (this is implied)copy
,weak
andstrong
from computedreadonly
properties (these attributes are only relevant for stored properties, not computed ones)delegate
-style properties asweak
, or in rare casesunsafe_unretained
(where code clearly relies on the property having a value)weak
IBOutlets asstrong
instead (this is now Apple's recommended practice)Some classes with complex sets of ivars (e.g.
BXSession
andBXEmulator
) have not yet been migrated, as they need additional work to expose necessary properties to subclasses/subcomponents. I have no doubt also missed a bunch of property attributes too.