Consider fields only as URL fields if the title contains "url"

This commit is contained in:
Danny Moesch 2018-12-07 21:50:28 +01:00 committed by Bob Sun
parent 3cc7510b29
commit 9b7fc4219e

View file

@ -59,7 +59,7 @@ class LabelTableViewCell: UITableViewCell {
contentLabel.text = Globals.oneTimePasswordDots
}
contentLabel.font = Globals.passwordFont
} else if title.lowercased().range(of: "url") != nil || verifyUrl(content) {
} else if title.lowercased().contains("url") {
type = .URL
contentLabel.text = content
contentLabel.font = UIFont.systemFont(ofSize: contentLabel.font.pointSize)
@ -198,12 +198,4 @@ class LabelTableViewCell: UITableViewCell {
}
self.accessoryView = buttons
}
private func verifyUrl(_ urlString: String?) -> Bool {
guard let urlString = urlString,
let _ = URL(string: urlString) else {
return false
}
return true
}
}