So I have a series of UIKit changes (these are being done on the main thread, per Apple's requirement). These changes are not being done in an animation. The relevant code snippet is here:
let transitionCenter = self.view!.superview!.convert(self.view!.center, to: fullscreenController!.view)
self.view!.transform = CGAffineTransform(rotationAngle: CGFloat(self.fullscreenAngle))
self.view!.center = transitionCenter
// Sometimes the screen is rendered in here, before the view is added
self.fullscreenController!.view.addSubview(self.view!)
Occasionally, the screen is being updated in between some of the changes. This produces a fairly noticeable artifacts. I've tried to use CADisplayLink to make sure that this is being done before the frame is rendered, but with no luck. I've also tried wrapping these lines of code in a explicit CATransaction, but still no luck.
Is there a way that I can force UIKit to not render these changes until all of them are made? I know that I cant stop rendering of the screen, as that is handled by the window server if I understand correctly.