I had the same problem and fix it.
My decision
1. Change the swizzling () method for public from private
public let swizzling: (AnyClass, Selector, Selector) -> () = { forClass, originalSelector, swizzledSelector in
let originalMethod = class_getInstanceMethod(forClass, originalSelector)
let swizzledMethod = class_getInstanceMethod(forClass, swizzledSelector)
method_exchangeImplementations(originalMethod, swizzledMethod)
}
2. Remove the initialize () method in extension UIViewController
3. swizzling() AppDelegate:: didFinishLaunchingWithOptions
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
swizzling(UIViewController.self)
return true
}
/ . ( )
, . :
Swift 3.1 initialize(). ?