关键字 infix operatore
infix operator <-->//: AdditionPrecedence
extension String {
static func <-->(_ content: String, _ comment: String) -> String {
return NSLocalizedString(content, comment: "")
}
func localization(_ comment: String? = nil) -> String {
return NSLocalizedString(self, comment: comment ?? "")
}
/// 项目中采用这个方法简化NSLocalizedString方法
var l: String {
get {
return NSLocalizedString(self, comment: "")
}
}
}
网友评论