selva balasubramanian
selva balasubramanian

Reputation: 154

Transition not occurring properly in iOS swift?

The function override

func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) { } 

is not triggered when I build and run on iPad devices but it works fine in mobile devices(iphone 5,6,7...). How to solve this??

Thanks in advance!!

Upvotes: 2

Views: 393

Answers (1)

Krin-San
Krin-San

Reputation: 315

This function is not called because iPad has Regular traits for any rotation. Prefer using func viewWillTransition(to: CGSize, with: UIViewControllerTransitionCoordinator) instead.

Upvotes: 6

Related Questions