Skip to content

Instantly share code, notes, and snippets.

@dimohamdy
Created January 2, 2019 14:51
Show Gist options
  • Save dimohamdy/61ad9ddf97626333557373afe84ef83a to your computer and use it in GitHub Desktop.
Save dimohamdy/61ad9ddf97626333557373afe84ef83a to your computer and use it in GitHub Desktop.
import UIKit
extension UIViewController {
static let classInit: Void = {
let originalSelector = #selector(viewDidDisappear)
let swizzledSelector = #selector(swizzled_viewDidDisappear)
swizzling(UIViewController.self, originalSelector, swizzledSelector)
}()
@objc func swizzled_viewDidDisappear() {
swizzled_viewDidDisappear()
print("swizzled_viewDidDisappear")
dch_checkDeallocation()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment