You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -547,7 +548,7 @@ result = a > b ? x = c > d ? c : d : y;
547
548
548
549
## Init Methods
549
550
550
-
Init methods should follow the convention provided by Apple's generated code template. A return type of 'instancetype' should also be used instead of 'id'.
551
+
Init methods should follow the convention provided by Apple's generated code template. A return type of 'instancetype' should also be used instead of 'id'.
551
552
552
553
```objc
553
554
- (instancetype)init {
@@ -559,6 +560,18 @@ Init methods should follow the convention provided by Apple's generated code tem
559
560
}
560
561
```
561
562
563
+
See [Class Constructor Methods](#class-constructor-methods) for link to article on instancetype.
564
+
565
+
## Class Constructor Methods
566
+
567
+
Where class constructor methods are used, these should always return type of 'instancetype' and never 'id'. This ensures the compiler correctly infers the result type.
0 commit comments