From fb6631df5f60e624b316a61322842869c7cff324 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 11:24:19 -0400 Subject: [PATCH] Remove cancel button from attachment caption view. --- .../AttachmentCaptionViewController.swift | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift b/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift index c54a8e31c..7b57106b6 100644 --- a/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentCaptionViewController.swift @@ -75,11 +75,6 @@ class AttachmentCaptionViewController: OWSViewController { configureTextView() - let cancelButton = UIBarButtonItem(barButtonSystemItem: .cancel, - target: self, - action: #selector(didTapCancel)) - cancelButton.tintColor = .white - navigationItem.leftBarButtonItem = cancelButton let doneIcon = UIImage(named: "image_editor_checkmark_full")?.withRenderingMode(.alwaysTemplate) let doneButton = UIBarButtonItem(image: doneIcon, style: .plain, target: self, @@ -96,7 +91,6 @@ class AttachmentCaptionViewController: OWSViewController { stackView.axis = .vertical stackView.spacing = 20 stackView.alignment = .fill - stackView.addBackgroundView(withBackgroundColor: UIColor(white: 0, alpha: 0.5)) stackView.layoutMargins = UIEdgeInsets(top: 16, left: 20, bottom: 16, right: 20) stackView.isLayoutMarginsRelativeArrangement = true self.view.addSubview(stackView) @@ -104,6 +98,15 @@ class AttachmentCaptionViewController: OWSViewController { stackView.autoPinEdge(toSuperviewEdge: .trailing) self.autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true) + let backgroundView = UIView() + backgroundView.backgroundColor = UIColor(white: 0, alpha: 0.5) + view.addSubview(backgroundView) + view.sendSubview(toBack: backgroundView) + backgroundView.autoPinEdge(toSuperviewEdge: .leading) + backgroundView.autoPinEdge(toSuperviewEdge: .trailing) + backgroundView.autoPinEdge(toSuperviewEdge: .bottom) + backgroundView.autoPinEdge(.top, to: .top, of: stackView) + let minTextHeight: CGFloat = textView.font?.lineHeight ?? 0 textViewHeightConstraint = textView.autoSetDimension(.height, toSize: minTextHeight)