The following code works on all the devices simulators I have access. However, some users reported the issue that leads me to think the completion block is not being called in some situation. I am out of idea at this moment. Any suggestion?
CATransaction.begin()
CATransaction.setCompletionBlock {
self.performSegue(withIdentifier: "ContractViewController", sender: sender.companyJob)
}
self.navigationController?.popViewController(animated: true)
CATransaction.commit()
BTW, what I wanted to achieve is to have the pop and push screen transition animations. At this point, I am open for any solution or workaround. Thanks in advance.
Extra document from doc:
/* Accessors for the "completionBlock" per-thread transaction property. * Once set to a non-nil value the block is guaranteed to be called (on * the main thread) as soon as all animations subsequently added by * this transaction group have completed (or been removed). If no * animations are added before the current transaction group is * committed (or the completion block is set to a different value), the * block will be invoked immediately. Added in Mac OS X 10.6. */