Better handling of CIDR values.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jeroen Leenarts
2018-10-03 21:34:51 +02:00
parent 24f7dcb7d6
commit 6346bad069
2 changed files with 40 additions and 11 deletions
@@ -224,6 +224,14 @@ extension InterfaceTableViewCell: UITextFieldDelegate {
}
}
}
func textFieldDidEndEditing(_ textField: UITextField) {
if textField == addressesField {
if let addresses = model.addresses?.commaSeparatedToArray() {
textField.text = addresses.compactMap { try? CIDRAddress(stringRepresentation: $0 ) }.compactMap { $0?.stringRepresentation }.joined(separator: ", ")
}
}
}
}
protocol PeerTableViewCellDelegate: class {