Fix substring depreciated warnings

This commit is contained in:
Yishi Lin 2017-09-23 16:43:14 +08:00
parent 774f05eae0
commit f646762f4b
3 changed files with 4 additions and 4 deletions

View file

@ -14,7 +14,7 @@ extension PasswordEntity {
public var nameWithCategory: String {
get {
if let p = path, p.hasSuffix(".gpg") {
return p.substring(to: p.index(p.endIndex, offsetBy: -4))
return String(p.prefix(upTo: p.index(p.endIndex, offsetBy: -4)))
} else {
return ""
}