Using CLANG_ANALYZER_NONNULL(i.e. -Xclang nullability), I got "Null returns from a function that should return a non-zero value":

Using the Xcode 7.3 and iOS 9.3 documentation, I checked initWithFrame:and returned nil:

But UIView.h encapsulates everything with NS_ASSUME_NONNULL_BEGIN, so we can interpret the following:

as:
- (nonnull instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
So the documentation explains this nullable, and the header file says nonnull. Who to trust?
Should I write:
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (!self) {
return (void * _Nonnull)nil;
}
return self;
}
Or:
- (nonnull instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
return self;
}
🔴🔴🔴
UPDATE
The Xcode documentation has been updated and now:

So there are more conflicts.