mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Refactor PeerInfoUI and related modules
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import Foundation
|
||||
import Contacts
|
||||
import AddressBook
|
||||
import TelegramPresentationData
|
||||
|
||||
public func localizedPhoneNumberLabel(label: String, strings: PresentationStrings) -> String {
|
||||
if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
|
||||
if label.isEmpty {
|
||||
return strings.ContactInfo_PhoneLabelMain
|
||||
} else if label == "X-iPhone" {
|
||||
return "iPhone"
|
||||
} else {
|
||||
return CNLabeledValue<CNPhoneNumber>.localizedString(forLabel: label)
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
if label == "_$!<Mobile>!$_" {
|
||||
return "mobile"
|
||||
} else if label == "_$!<Home>!$_" {
|
||||
return "home"
|
||||
} else {
|
||||
return label
|
||||
}
|
||||
}
|
||||
|
||||
public func localizedGenericContactFieldLabel(label: String, strings: PresentationStrings) -> String {
|
||||
if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
|
||||
if label.isEmpty {
|
||||
return strings.ContactInfo_PhoneLabelMain
|
||||
}
|
||||
return CNLabeledValue<NSString>.localizedString(forLabel: label)
|
||||
} else {
|
||||
|
||||
}
|
||||
if label == "_$!<Mobile>!$_" {
|
||||
return "mobile"
|
||||
} else if label == "_$!<Home>!$_" {
|
||||
return "home"
|
||||
} else {
|
||||
return label
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user