Prevent API misuse at compile time (#2035)

Using Objective-C attributes, in this case `unavailable`, we can hide
unsupported APIs at compile time instead of detecting and warn about it
at runtime with a set of asserts.
This commit is contained in:
David Rodrigues
2016-08-05 03:00:46 +01:00
committed by Adlai Holler
parent 01c8dc3dc2
commit 70574243f7
14 changed files with 69 additions and 61 deletions

View File

@@ -17,4 +17,10 @@ NS_ASSUME_NONNULL_BEGIN
@end
@interface ASAbstractLayoutController (Unavailable)
- (NSSet *)indexPathsForScrolling:(ASScrollDirection)scrollDirection rangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType __unavailable;
@end
NS_ASSUME_NONNULL_END