mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
clarify different methods
These method names were too similar to existing methods in PureLayout, which have slightly different behavior. ows_autoPinToSuperviewEdges uses left/right, whereas PureLayouts uses leading/trailing ows_autoPinToSuperviewMargins uses our own constraint adding logic, which behaves differently in some cases.
This commit is contained in:
parent
9df6b4bb78
commit
8da47b64d9
16 changed files with 23 additions and 23 deletions
|
@ -75,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
layer.opacity = 0.5f;
|
||||
}];
|
||||
[self.view addSubview:maskingView];
|
||||
[maskingView autoPinToSuperviewEdges];
|
||||
[maskingView ows_autoPinToSuperviewEdges];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
|
|
|
@ -132,7 +132,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
label.textColor = UIColor.ows_materialBlueColor;
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
[self addSubview:label];
|
||||
[label autoPinToSuperviewEdges];
|
||||
[label ows_autoPinToSuperviewEdges];
|
||||
[label autoSetDimension:ALDimensionHeight toSize:OWSContactShareButtonsView.buttonHeight];
|
||||
|
||||
self.userInteractionEnabled = YES;
|
||||
|
|
|
@ -157,7 +157,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[hStackView addArrangedSubview:labelsView];
|
||||
[hStackView addArrangedSubview:disclosureImageView];
|
||||
[self addSubview:hStackView];
|
||||
[hStackView autoPinToSuperviewEdges];
|
||||
[hStackView ows_autoPinToSuperviewEdges];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -363,7 +363,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[self.viewConstraints addObjectsFromArray:[clipView autoPinToEdgesOfView:proxyView]];
|
||||
|
||||
[clipView addSubview:bodyMediaView];
|
||||
[self.viewConstraints addObjectsFromArray:[bodyMediaView autoPinToSuperviewEdges]];
|
||||
[self.viewConstraints addObjectsFromArray:[bodyMediaView ows_autoPinToSuperviewEdges]];
|
||||
|
||||
[self.bubbleView addPartnerView:shadowView1];
|
||||
[self.bubbleView addPartnerView:shadowView2];
|
||||
|
@ -447,7 +447,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
}];
|
||||
[gradientView.layer addSublayer:gradientLayer];
|
||||
[bodyMediaView addSubview:gradientView];
|
||||
[self.viewConstraints addObjectsFromArray:[gradientView autoPinToSuperviewEdges]];
|
||||
[self.viewConstraints addObjectsFromArray:[gradientView ows_autoPinToSuperviewEdges]];
|
||||
|
||||
[self.footerView configureWithConversationViewItem:self.viewItem
|
||||
isOverlayingMedia:YES
|
||||
|
@ -528,7 +528,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[self.viewConstraints addObjectsFromArray:[clipView autoPinToEdgesOfView:proxyView]];
|
||||
|
||||
[clipView addSubview:buttonsView];
|
||||
[self.viewConstraints addObjectsFromArray:[buttonsView autoPinToSuperviewEdges]];
|
||||
[self.viewConstraints addObjectsFromArray:[buttonsView ows_autoPinToSuperviewEdges]];
|
||||
|
||||
[self.bubbleView addPartnerView:shadowView];
|
||||
[self.bubbleView addPartnerView:clipView];
|
||||
|
@ -1091,7 +1091,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[[AttachmentUploadView alloc] initWithAttachment:self.attachmentStream
|
||||
attachmentStateCallback:attachmentStateCallback];
|
||||
[self.bubbleView addSubview:attachmentUploadView];
|
||||
[attachmentUploadView autoPinToSuperviewEdges];
|
||||
[attachmentUploadView ows_autoPinToSuperviewEdges];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ const CGFloat kDisappearingMessageIconSize = 12.f;
|
|||
{
|
||||
self.imageView = [UIImageView new];
|
||||
[self addSubview:self.imageView];
|
||||
[self.imageView autoPinToSuperviewEdges];
|
||||
[self.imageView ows_autoPinToSuperviewEdges];
|
||||
[self.imageView autoSetDimension:ALDimensionWidth toSize:kDisappearingMessageIconSize];
|
||||
[self.imageView autoSetDimension:ALDimensionHeight toSize:kDisappearingMessageIconSize];
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
hStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
hStackView.spacing = self.hSpacing;
|
||||
[innerBubbleView addSubview:hStackView];
|
||||
[hStackView autoPinToSuperviewEdges];
|
||||
[hStackView ows_autoPinToSuperviewEdges];
|
||||
|
||||
UIView *stripeView = [UIView new];
|
||||
stripeView.backgroundColor = [self.conversationStyle quotedReplyStripeColorWithIsIncoming:!self.isOutgoing];
|
||||
|
|
|
@ -248,7 +248,7 @@ const CGFloat kMaxTextViewHeight = 98;
|
|||
UIView *wrapper = [UIView containerView];
|
||||
wrapper.layoutMargins = UIEdgeInsetsMake(self.quotedMessageTopMargin, 0, 0, 0);
|
||||
[wrapper addSubview:quotedMessagePreview];
|
||||
[quotedMessagePreview autoPinToSuperviewMargins];
|
||||
[quotedMessagePreview ows_autoPinToSuperviewMargins];
|
||||
|
||||
[self.contentRows insertArrangedSubview:wrapper atIndex:0];
|
||||
|
||||
|
@ -386,7 +386,7 @@ const CGFloat kMaxTextViewHeight = 98;
|
|||
|
||||
self.voiceMemoContentView = [UIView new];
|
||||
[self.voiceMemoUI addSubview:self.voiceMemoContentView];
|
||||
[self.voiceMemoContentView autoPinToSuperviewEdges];
|
||||
[self.voiceMemoContentView ows_autoPinToSuperviewEdges];
|
||||
|
||||
self.recordingLabel = [UILabel new];
|
||||
self.recordingLabel.textColor = [UIColor ows_destructiveRedColor];
|
||||
|
|
|
@ -206,7 +206,7 @@ class GifPickerCell: UICollectionViewCell {
|
|||
let imageView = YYAnimatedImageView()
|
||||
self.imageView = imageView
|
||||
self.contentView.addSubview(imageView)
|
||||
imageView.autoPinToSuperviewEdges()
|
||||
imageView.ows_autoPinToSuperviewEdges()
|
||||
}
|
||||
guard let imageView = imageView else {
|
||||
owsFail("\(TAG) missing imageview.")
|
||||
|
|
|
@ -180,7 +180,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
}
|
||||
|
||||
[scrollView autoPinToSuperviewEdges];
|
||||
[scrollView ows_autoPinToSuperviewEdges];
|
||||
|
||||
if (self.isAnimated) {
|
||||
if (self.attachmentStream.isValidImage) {
|
||||
|
|
|
@ -293,7 +293,7 @@ class MenuActionSheetView: UIView, MenuActionViewDelegate {
|
|||
|
||||
backgroundColor = UIColor.ows_light10
|
||||
addSubview(actionStackView)
|
||||
actionStackView.autoPinToSuperviewEdges()
|
||||
actionStackView.ows_autoPinToSuperviewEdges()
|
||||
|
||||
self.clipsToBounds = true
|
||||
|
||||
|
@ -378,7 +378,7 @@ class MenuActionView: UIButton {
|
|||
contentRow.isUserInteractionEnabled = false
|
||||
|
||||
self.addSubview(contentRow)
|
||||
contentRow.autoPinToSuperviewMargins()
|
||||
contentRow.ows_autoPinToSuperviewMargins()
|
||||
contentRow.autoSetDimension(.height, toSize: 56, relation: .greaterThanOrEqual)
|
||||
|
||||
self.addTarget(self, action: #selector(didPress(sender:)), for: .touchUpInside)
|
||||
|
|
|
@ -289,7 +289,7 @@ typedef void (^CustomLayoutBlock)(void);
|
|||
layer.path = [UIBezierPath bezierPathWithOvalInRect:circle].CGPath;
|
||||
}];
|
||||
[fingerprintView addSubview:fingerprintCircle];
|
||||
[fingerprintCircle autoPinToSuperviewEdges];
|
||||
[fingerprintCircle ows_autoPinToSuperviewEdges];
|
||||
|
||||
UIImageView *fingerprintImageView = [UIImageView new];
|
||||
fingerprintImageView.image = self.fingerprint.image;
|
||||
|
|
|
@ -80,7 +80,7 @@ class ReminderView: UIView {
|
|||
|
||||
self.addSubview(container)
|
||||
container.layoutMargins = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
|
||||
container.autoPinToSuperviewEdges()
|
||||
container.ows_autoPinToSuperviewEdges()
|
||||
|
||||
// Label
|
||||
label.font = UIFont.ows_dynamicTypeSubheadline
|
||||
|
|
|
@ -41,7 +41,7 @@ public class OWSFlatButton: UIView {
|
|||
private func createContent() {
|
||||
self.addSubview(button)
|
||||
button.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside)
|
||||
button.autoPinToSuperviewEdges()
|
||||
button.ows_autoPinToSuperviewEdges()
|
||||
}
|
||||
|
||||
@objc
|
||||
|
|
|
@ -109,7 +109,7 @@ public class PlayerProgressBar: UIView {
|
|||
backgroundColor = UIColor.lightGray.withAlphaComponent(0.5)
|
||||
if !UIAccessibilityIsReduceTransparencyEnabled() {
|
||||
addSubview(blurEffectView)
|
||||
blurEffectView.autoPinToSuperviewEdges()
|
||||
blurEffectView.ows_autoPinToSuperviewEdges()
|
||||
}
|
||||
|
||||
// Configure controls
|
||||
|
|
|
@ -27,8 +27,8 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value);
|
|||
- (NSArray<NSLayoutConstraint *> *)autoPinHeightToSuperviewWithMargin:(CGFloat)margin;
|
||||
- (NSArray<NSLayoutConstraint *> *)autoPinHeightToSuperview;
|
||||
|
||||
- (NSArray<NSLayoutConstraint *> *)autoPinToSuperviewEdges;
|
||||
- (NSArray<NSLayoutConstraint *> *)autoPinToSuperviewMargins;
|
||||
- (NSArray<NSLayoutConstraint *> *)ows_autoPinToSuperviewEdges;
|
||||
- (NSArray<NSLayoutConstraint *> *)ows_autoPinToSuperviewMargins;
|
||||
|
||||
- (NSLayoutConstraint *)autoHCenterInSuperview;
|
||||
- (NSLayoutConstraint *)autoVCenterInSuperview;
|
||||
|
|
|
@ -79,7 +79,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|||
return result;
|
||||
}
|
||||
|
||||
- (NSArray<NSLayoutConstraint *> *)autoPinToSuperviewEdges
|
||||
- (NSArray<NSLayoutConstraint *> *)ows_autoPinToSuperviewEdges
|
||||
{
|
||||
NSArray<NSLayoutConstraint *> *result = @[
|
||||
[self autoPinEdgeToSuperviewEdge:ALEdgeLeft],
|
||||
|
@ -90,7 +90,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
|
|||
return result;
|
||||
}
|
||||
|
||||
- (NSArray<NSLayoutConstraint *> *)autoPinToSuperviewMargins
|
||||
- (NSArray<NSLayoutConstraint *> *)ows_autoPinToSuperviewMargins
|
||||
{
|
||||
NSArray<NSLayoutConstraint *> *result = @[
|
||||
[self autoPinTopToSuperviewMargin],
|
||||
|
|
Loading…
Reference in a new issue