Red > Green > Refactor > Red

cycle is based on desire

which to use id or instancetype

use instancetype

  • readable
  • (type safe)

ex. generally in ‘init’ …

‘init’ returns 'the instance’

so it’s clear if it’s written ‘instancetype is returned’

(id) init; // what type will be returned?
(instancetype) init; // ah ... instance will be returned


(continue to survey…, instancetype will make type safe)


Why you should use instancetype instead of id |