traits, interface, inheritance

http://stackoverflow.com/questions/9205083/traits-vs-interfaces

Prefer interface to inheritance
use trait for inheritance
If have to use inheritance, use abstract class

is_a => interface

has properties => composition (traits, mixins)

template pattern => abstract class implements interface

inheritance is outdated, should be avoided these days

Advertisements

NS_ASSUME_NONNULL_BEGIN

It’s a convenience macro to save you typing nonnull in your headers. From the Swift blog detailing how new safety features have been incorporated back in Objective-C:

To ease adoption of the new annotations, you can mark certain regions of your Objective-C header files as audited for nullability. Within these regions, any simple pointer type will be assumed to be nonnull.

See Nullability and Objective-C – https://developer.apple.com/swift/blog/?id=25