Polish codes about password details

- in Password.swift: allow get otpType
- in PasswordDetailTableVC.swift: make many things private
- in LabelTableViewCell: remove password and password entity
- in Globals: add password dots and fonts
This commit is contained in:
Yishi Lin 2017-03-22 01:39:26 +08:00
parent 131c3af873
commit 93901ec010
4 changed files with 117 additions and 96 deletions

View file

@ -28,6 +28,24 @@ class Password {
var firstLineIsOTPField = false
var otpToken: Token?
enum OtpType {
case totp, hotp, none
}
var otpType: OtpType {
get {
guard let token = self.otpToken else {
return OtpType.none
}
switch token.generator.factor {
case .counter:
return OtpType.hotp
case .timer:
return OtpType.totp
}
}
}
init(name: String, plainText: String) {
self.initEverything(name: name, plainText: plainText)
}