Move codes to an embed framework
- Move bundle/group identifiers to passKit/Global - Fix Core Data - Change Defaults to SharedDefaults
This commit is contained in:
parent
850dc75820
commit
d2ba620ae4
45 changed files with 1062 additions and 523 deletions
|
|
@ -1,41 +0,0 @@
|
|||
//
|
||||
// PasswordEntity.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 11/2/2017.
|
||||
// Copyright © 2017 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftyUserDefaults
|
||||
|
||||
extension PasswordEntity {
|
||||
|
||||
var nameWithCategory: String {
|
||||
get {
|
||||
if let p = path, p.hasSuffix(".gpg") {
|
||||
return p.substring(to: p.index(p.endIndex, offsetBy: -4))
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getCategoryText() -> String {
|
||||
var parentEntity = parent
|
||||
var passwordCategoryArray: [String] = []
|
||||
while parentEntity != nil {
|
||||
passwordCategoryArray.append(parentEntity!.name!)
|
||||
parentEntity = parentEntity!.parent
|
||||
}
|
||||
passwordCategoryArray.reverse()
|
||||
return passwordCategoryArray.joined(separator: " > ")
|
||||
}
|
||||
|
||||
func getURL() -> URL? {
|
||||
if let p = path {
|
||||
return URL(string: p.stringByAddingPercentEncodingForRFC3986()!)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue