|
|
@ -2,8 +2,8 @@
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#import "OWSMath.h"
|
|
|
|
|
|
|
|
#import "UIView+OWS.h"
|
|
|
|
#import "UIView+OWS.h"
|
|
|
|
|
|
|
|
#import "OWSMath.h"
|
|
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
|
@ -36,8 +36,8 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinWidthToSuperviewWithMargin:(CGFloat)margin
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinWidthToSuperviewWithMargin:(CGFloat)margin
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
[self autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.superview withOffset:+margin],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:margin],
|
|
|
|
[self autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:self.superview withOffset:-margin],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:margin],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -45,8 +45,8 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinWidthToSuperview
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinWidthToSuperview
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
[self autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeLeft],
|
|
|
|
[self autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeRight],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -63,8 +63,8 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinHeightToSuperviewWithMargin:(CGFloat)margin
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinHeightToSuperviewWithMargin:(CGFloat)margin
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
[self autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.superview withOffset:+margin],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:margin],
|
|
|
|
[self autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.superview withOffset:-margin],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:margin],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -72,8 +72,8 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinHeightToSuperview
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinHeightToSuperview
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
[self autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeTop],
|
|
|
|
[self autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeBottom],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -81,10 +81,10 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinToSuperviewEdges
|
|
|
|
- (NSArray<NSLayoutConstraint *> *)autoPinToSuperviewEdges
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
NSArray<NSLayoutConstraint *> *result = @[
|
|
|
|
[self autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeLeft ],
|
|
|
|
[self autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeRight ],
|
|
|
|
[self autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeTop ],
|
|
|
|
[self autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.superview],
|
|
|
|
[self autoPinEdgeToSuperviewEdge:ALEdgeBottom ],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|