[ASPrimitiveTraitCollection] Always treat preferredContentSize as a potential nil #trivial (#757)

* Fix ASPrimitiveTraitCollection initialization on iOS 9.
Add nil-value checks for preferredContentSizeCategory.

* * Mark -[ASTraitCollection init] as deprecated.
* Mark [ASViewController overrideDisplayTraitsWithWindowSize] as deprecated.

Code review changes:
* Remove unneeded nonnull annotations
* Add null check in ASTraitCollection constructor implementation
* Codestyle
* Add some documentation about ASPrimitiveTraitCollection vs ASTraitCollection usage

* Rename safeContentSizeCategory to AS_safeContentSizeCategory.

Remove safePrimitiveContentSizeCategory in favour of AS_safeContentSizeCategory.
This commit is contained in:
Yevgen Pogribnyi
2018-03-21 14:44:30 +02:00
committed by Huy Nguyen
parent 5385d8b3ed
commit e954b1045a
3 changed files with 208 additions and 140 deletions

View File

@@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Set this block to customize the ASDisplayTraits returned when the VC transitions to the given window size.
*/
@property (nonatomic, copy) ASDisplayTraitsForTraitWindowSizeBlock overrideDisplayTraitsWithWindowSize;
@property (nonatomic, copy) ASDisplayTraitsForTraitWindowSizeBlock overrideDisplayTraitsWithWindowSize ASDISPLAYNODE_DEPRECATED_MSG("This property is actually never accessed inside the framework");
/**
* @abstract Passthrough property to the the .interfaceState of the node.