From 707f292e4edc099e6469ec587bce4b58e764bc92 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 10 Dec 2018 12:59:31 +0530 Subject: Tunnels list: Fix AutoLayout error during deletion of a tunnel Signed-off-by: Roopesh Chander --- WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift') 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) -- cgit v1.2.3-59-g8ed1b