I have a view controller. Basically, I want check some conditions, and if those conditions are true, I want to set it's size class manually (override it's default size class).
To do so, I would have to override it's UITraitCollection. I did some research, and was able to find this function:
setOverrideTraitCollection(collection: UITraitCollection!, forChildViewController childViewController: UIViewController!)
The function allows me to override the trait collection of a child view controller, but I want the view controller to be able to override it's own traits.
So just to recap, I want to do the following. When a view controller loads, I want it to check some conditions. If they are true, I want the view controller to override it's size class to a custom one.
Thanks for the help!