prepareForSegue = class_getInstanceMethod(type(of: self), #selector(UIViewController.prepare)) let _prepare = class_getInstanceMethod(type(of: self), #selector(UIViewController._prepare(segue:sender:))) method_exchangeImplementations(prepareForSegue!, _prepare!) } public func performSegue(_ withIdentifier: String, closure: ((UIStoryboardSegue) -> Void)? = nil) { swizzling() self.performSegue(withIdentifier: withIdentifier, sender: SegueEventHolder(segueClosure: closure)) swizzling() } } IUUQTHJUIVCDPNCBOO[BJ4FHVF"EEJUJPOCMPCNBTUFS$MBTTFT4FHVF"EEJUJPOTXJGU