grgcombs / IntelligentSplitViewController

A smarter UISplitViewController that rotates correctly when placed inside a UITabBarController
Other
111 stars 22 forks source link

Doesn't work but with a minor tweak, it works #15

Closed zontarian closed 9 years ago

zontarian commented 11 years ago

Hi!

thanks for the code. I've had a real bad time trying to make a splitview inside a tabbar work (with the proper hiding of the master view that is)..

I've found your code via devforums.apple.com and downloaded it. Out of the box it does not work, at least for me:

my layout is a UITabbarController as root, with 3 UISplitViewController. OF these controllers, only the first one must hide the masterview when in portrait.

Ive' just forced the code in your willRotate method to be executed, that is I've forced a variable so that the code

if (!isSelectedTab || !notModal)  {
        // Looks like we're not "visible" ... propogate rotation info
        [super willRotateToInterfaceOrientation:toOrientation duration:duration];

is executed. The problem was that if I'm on the selected tab (the one where I want to handle the rotation) the if was not executed (isSelected=true and notModal=true).

I've changed to

if (isSelectedTab || !notModal)  {
        // Looks like we're not "visible" ... propogate rotation info
        [super willRotateToInterfaceOrientation:toOrientation duration:duration];

(notice the missing exclamation mark). Now it works for me. I'm experiencing at the moment a bad access while trying to access the delegate after a few rotations but I'm confident i will overcome this.

Thanks! Walter

grgcombs commented 11 years ago

What version of iOS are you using? Does the example application work for you?

On Nov 24, 2012, at 12:06 PM, zontarian notifications@github.com wrote:

Hi!

thanks for the code. I've had a real bad time trying to make a splitview inside a tabbar work (with the proper hiding of the master view that is)..

I've found your code via devforums.apple.com and downloaded it. Out of the box it does not work, at least for me:

my layout is a UITabbarController as root, with 3 UISplitViewController. OF these controllers, only the first one must hide the masterview when in portrait.

Ive' just forced the code in your willRotate method to be executed, that is I've forced a variable so that the code

if (!isSelectedTab || !notModal) { // Looks like we're not "visible" ... propogate rotation info [super willRotateToInterfaceOrientation:toOrientation duration:duration];

is executed. The problem was that if I'm on the selected tab (the one where I want to handle the rotation) the if was not executed (isSelected=true and notModal=true).

I've changed to

if (isSelectedTab || !notModal) { // Looks like we're not "visible" ... propogate rotation info [super willRotateToInterfaceOrientation:toOrientation duration:duration];

(notice the missing exclamation mark). Now it works for me. I'm experiencing at the moment a bad access while trying to access the delegate after a few rotations but I'm confident i will overcome this.

Thanks! Walter

— Reply to this email directly or view it on GitHub.

zontarian commented 11 years ago

At the moment I'm testing on iOS5. I haven't tried the sample application since I need to apply the tweak to an exisiting app which is quite complex. At the moment I've solved the previous issue: during navigation the detail view changed so I had to update the delegate. This corrected the exception.

But the thing is far from perfect: changing the detail view controller has some side effects, i.e. sometimes when I navigate back and forth in my master view, I lose the popupButton, but I'm investigating, since I don't think it's related to your excellent patch.