mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 06:10:03 +00:00
39 lines
899 B
Swift
39 lines
899 B
Swift
import Foundation
|
|
import TelegramCore
|
|
|
|
func findIdentity(_ values: [SecureIdValue]) -> (Int, SecureIdIdentityValue)? {
|
|
for i in 0 ..< values.count {
|
|
switch values[i] {
|
|
case let .identity(identity):
|
|
return (i, identity)
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func findPhone(_ values: [SecureIdValue]) -> (Int, SecureIdPhoneValue)? {
|
|
for i in 0 ..< values.count {
|
|
switch values[i] {
|
|
case let .phone(phone):
|
|
return (i, phone)
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func findEmail(_ values: [SecureIdValue]) -> (Int, SecureIdEmailValue)? {
|
|
for i in 0 ..< values.count {
|
|
switch values[i] {
|
|
case let .email(email):
|
|
return (i, email)
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
return nil
|
|
}
|