Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// MARK: - 端末のロケール設定
extension NSLocale {
class func customLocale() -> NSLocale {
return NSLocale(localeIdentifier: "ja")
let methodLocale = class_getClassMethod(NSLocale.self, #selector(getter: NSLocale.current))
let swizzledMethodLocale = class_getClassMethod(NSLocale.self, #selector(NSLocale.customLocale))
method_exchangeImplementations(methodLocale, swizzledMethodLocale)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.