24 lines
469 B
Swift
24 lines
469 B
Swift
|
|
import Foundation
|
|
|
|
import UIKit
|
|
import YYCategories
|
|
|
|
extension String {
|
|
|
|
var localized: String {
|
|
return String(localized: LocalizationValue(self))
|
|
}
|
|
|
|
|
|
func localizedReplace(text: String) -> String {
|
|
return self.localized.replacingOccurrences(of: "##", with: text)
|
|
}
|
|
|
|
|
|
func size(_ font: UIFont, _ size: CGSize) -> CGSize {
|
|
return (self as NSString).size(for: font, size: size, mode: .byWordWrapping)
|
|
}
|
|
|
|
}
|