ColorMatchTabs
ColorMatchTabs copied to clipboard
willTransitionToTraitCollection is not forwarded to TabsViewController
Currently
override func willTransitionToTraitCollection(newCollection: UITraitCollection, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
super.willTransitionToTraitCollection(newCollection, withTransitionCoordinator: coordinator)
}
gets never called in a viewController of a tab bar item.
Same applies to
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
}
Hi @mooseDev! Because in only portrait orientation a trait collection is still the same. If you enable landscape orientation these methods get called. It also can happen if you locked changing orientation on your device
Hmm...
Let me explain it again:
Example Project:
- Add 'Landscape Left/Right' to targets device orientation
- ExampleViewContoller.swift : Add ' willTransitionToTraitCollection' and 'viewWillTransitionToSize' like mentioned above
- StubContentViewController.swift: Add ' willTransitionToTraitCollection' and 'viewWillTransitionToSize' like mentioned above
Action:
- Run and change orientation and set breakpoint to the added functions
Result:
- Only in ExampleViewController.swift we hit the breakpoints & not in the child view controllers (StubContentViewController.swift)
I got your point. I'll investigate the issue later. Thanks for reporting!
thanks :)