iPad Rotation Animation Lag

135 Views Asked by At

I have an iPad app that needs to display a unique layout for Portrait and Landscape. I am using viewWillTransitionToSize to make this happen. I have two containers views, which each have a view controller, so my method looks like this:

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        let methodStart = NSDate()
        let vc1Size = CGSizeMake(size.width * 0.6, size.height)
        let vc2Size = CGSizeMake(size.width * 0.4, size.height)
        self.viewController1.viewWillTransitionToSize(vc1Size, withTransitionCoordinator: coordinator)
        self.viewController2.viewWillTransitionToSize(vc2Size, withTransitionCoordinator: coordinator)
        self.configureSubmitButton()
        let methodFinish = NSDate()
        let executionTime = methodFinish.timeIntervalSinceDate(methodStart)
        print("Execution time: \(executionTime)")
    }

My log out put looks like this :

Execution time: 0.0536490082740784

So viewWillTransitionToSize is not the culprit. After I get this log output, there is a long lag before the rotation animation occurs. I mainly want to know what other methods are firing after viewWillTransitionToSize that I could investigate. The layout looks fine once it rotates, this is just taking too much time.

0

There are 0 best solutions below