Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

willTransitionToTraitCollection is not forwarded to TabsViewController #9

Open
mooseDev opened this issue Aug 10, 2016 · 4 comments
Open
Assignees

Comments

@mooseDev
Copy link

mooseDev commented Aug 10, 2016

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)
    }
@serejahh
Copy link
Contributor

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

@mooseDev
Copy link
Author

mooseDev commented Aug 18, 2016

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)

@serejahh
Copy link
Contributor

serejahh commented Aug 18, 2016

I got your point. I'll investigate the issue later. Thanks for reporting!

@mooseDev
Copy link
Author

thanks :)

@ZdorAnna ZdorAnna self-assigned this Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants