2015-08-15 16:05:48 -05:00
|
|
|
// 15 august 2015
|
|
|
|
#import "uipriv_darwin.h"
|
|
|
|
|
2016-04-30 16:14:14 -05:00
|
|
|
NSLayoutConstraint *mkConstraint(id view1, NSLayoutAttribute attr1, NSLayoutRelation relation, id view2, NSLayoutAttribute attr2, CGFloat multiplier, CGFloat c, NSString *desc)
|
2015-08-15 16:05:48 -05:00
|
|
|
{
|
2016-04-30 17:07:36 -05:00
|
|
|
NSLayoutConstraint *constraint;
|
2015-08-15 16:05:48 -05:00
|
|
|
|
2016-04-30 17:07:36 -05:00
|
|
|
constraint = [NSLayoutConstraint constraintWithItem:view1
|
2016-04-30 16:14:14 -05:00
|
|
|
attribute:attr1
|
|
|
|
relatedBy:relation
|
|
|
|
toItem:view2
|
|
|
|
attribute:attr2
|
|
|
|
multiplier:multiplier
|
|
|
|
constant:c];
|
|
|
|
// apparently only added in 10.9
|
2016-04-30 17:07:36 -05:00
|
|
|
if ([constraint respondsToSelector:@selector(setIdentifier:)])
|
|
|
|
[((id) constraint) setIdentifier:desc];
|
|
|
|
return constraint;
|
2015-08-15 16:05:48 -05:00
|
|
|
}
|