From: Roopesh Chander Date: Mon, 10 Dec 2018 07:29:31 +0000 (+0530) Subject: Tunnels list: Fix AutoLayout error during deletion of a tunnel X-Git-Tag: 0.0.20181104-6~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=707f292e4edc099e6469ec587bce4b58e764bc92;p=thirdparty%2Fwireguard-apple.git Tunnels list: Fix AutoLayout error during deletion of a tunnel Signed-off-by: Roopesh Chander --- diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift index 187447c..b1102c4 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift @@ -363,12 +363,16 @@ class TunnelsListTableViewCell: UITableViewCell { nameLabel.translatesAutoresizingMaskIntoConstraints = false nameLabel.numberOfLines = 0 nameLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) + let bottomAnchorConstraint = contentView.layoutMarginsGuide.bottomAnchor.constraint( + equalToSystemSpacingBelow: nameLabel.bottomAnchor, multiplier: 1) + bottomAnchorConstraint.priority = .defaultLow // Allow this constraint to be broken when animating a cell away during deletion NSLayoutConstraint.activate([ nameLabel.topAnchor.constraint(equalToSystemSpacingBelow: contentView.layoutMarginsGuide.topAnchor, multiplier: 1), - contentView.layoutMarginsGuide.bottomAnchor.constraint(equalToSystemSpacingBelow: nameLabel.bottomAnchor, multiplier: 1), nameLabel.leftAnchor.constraint(equalToSystemSpacingAfter: contentView.layoutMarginsGuide.leftAnchor, multiplier: 1), - busyIndicator.leftAnchor.constraint(equalToSystemSpacingAfter: nameLabel.rightAnchor, multiplier: 1) + busyIndicator.leftAnchor.constraint(equalToSystemSpacingAfter: nameLabel.rightAnchor, multiplier: 1), + bottomAnchorConstraint ]) + self.accessoryType = .disclosureIndicator statusSwitch.addTarget(self, action: #selector(switchToggled), for: .valueChanged)