Just provide the Swift 4 patch for @ gebirgsbärbel's answer . "prefeContentSizeCategory" in Objective-C is a method, but in Swift it is a read-only variable. So, in your AppDelegate, it looks like this:
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? // MARK: - UIApplicationDelegate func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { UIApplication.classInit self.window = UIWindow(frame: UIScreen.main.bounds) ... self.window?.makeKeyAndVisible() return true } } // MARK: - Fix Dynamic Type extension UIApplication { static let classInit: Void = { method_exchangeImplementations( class_getInstanceMethod(UIApplication.self, #selector(getter: fixedPreferredContentSizeCategory))!, class_getInstanceMethod(UIApplication.self, #selector(getter: preferredContentSizeCategory))! ) }() @objc var fixedPreferredContentSizeCategory: UIContentSizeCategory { return .large } }
LQ Ruan
source share