Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions FLKAutoLayout/Private/FLKAutoLayoutPredicateList.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ - (void)addPredicateFromString:(NSString *)string {
if (priorityRange.location != NSNotFound) {
predicate.priority = [[string substringWithRange:priorityRange] integerValue];
}

NSAssert(predicate.priority < UILayoutPriorityRequired, @"Due to FLKAutoLayout's nullability API, priorities over 1000 ( which would fail and return null ) are not supported.");
[predicates addObject:[NSValue valueWithBytes:&predicate objCType:@encode(FLKAutoLayoutPredicate)]];
}

Expand Down
2 changes: 1 addition & 1 deletion FLKAutoLayout/Private/UIView+FLKAutoLayoutPredicate.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (NSLayoutConstraint *)applyPredicate:(FLKAutoLayoutPredicate)predicate toView:
}

- (NSLayoutConstraint *)applyPredicate:(FLKAutoLayoutPredicate)predicate toView:(id)viewOrLayoutGuide fromAttribute:(NSLayoutAttribute)fromAttribute toAttribute:(NSLayoutAttribute)toAttribute {
if (predicate.priority > UILayoutPriorityRequired) return nil;
NSAssert(predicate.priority < UILayoutPriorityRequired, @"Due to FLKAutoLayout's nullability API, priorities over 1000 ( which would fail and return null ) are not supported.");

UIView *view;
id toItem;
Expand Down
4 changes: 1 addition & 3 deletions FLKAutoLayout/UIView+FLKAutoLayout.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
@import UIKit;
NS_ASSUME_NONNULL_BEGIN

FOUNDATION_EXTERN NSString *const FLKNoConstraint;

/// A collection of categories for UIViews, note the
/// `view` API can either be a `UIView` subclass or a `FLKAutoLayoutGuide`.

@interface UIView (FLKAutoLayout)

#pragma mark Generic constraint methods for two views

/// Align an attribute of one view to another.
Expand Down
2 changes: 0 additions & 2 deletions FLKAutoLayout/UIView+FLKAutoLayout.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#import "UIView+FLKAutoLayout.h"
#import "FLKAutoLayoutPredicateList.h"

NSString *const FLKNoConstraint = @"0@1001"; // maximum valid priority is 1000, constraints with a priority > 1000 will be ignored by FLKAutoLayout

typedef NSArray *(^viewChainingBlock)(UIView *view1, UIView *view2);


Expand Down