Re: iOS: preventing popping nav controller
Re: iOS: preventing popping nav controller
- Subject: Re: iOS: preventing popping nav controller
- From: Roland King <email@hidden>
- Date: Tue, 13 Mar 2012 09:57:34 +0800
I think it's a pretty common pattern, quite a few of the apps I have on my phone do something like this, less to force modality, more to make better use of the limited space for icons on the navigation bar and be contextual. Pages, Numbers etc do it to some extent. I just tested iPhoto and that doesn't do it, but neither does it capture you going back when in edit mode which seems hopelessly wrong to me.
If you really hate that, not sure what you can do. What was your idea for subclassing UINavigationController? I didn't instantly see a place to hook in without messing with the navigationBar delegate, something the documentation tells you not to do (although I'd probably try that anyway).
I do wish the nav controller had an option for making a button which looks like a back button, I've wanted this before. Then you could replace the back button with one which looks exactly like it, unanimated, and capture your own events easily. I don't know of a way to do that however.
On Mar 13, 2012, at 9:43 AM, Rick Mann wrote:
> Yeah, I thought of this approach, but it smells funny to me. It doesn't seem much different from putting the game in a modal sheet, which also strikes me as wrong.
>
> But maybe that's the right thing to do.
>
> --
> Rick
>
> On Mar 12, 2012, at 18:41 , Roland King wrote:
>
>> When the game starts, replace the back button on the navigation item with your own 'quit' button, or remove it totally and put a quit button on the right-hand-side of the navigation bar instead. This can be quite a nice way to show you are no longer just 'navigating' but you are now in a different state of 'playing'. Since it's your own button you can get the action message from it, pause the game, pop up your 'do you want to quit?' sheet and do the necessary.
>>
>> If you look at some other applications you'll see they do this kind of thing when you go into edit mode or similar. When just navigating, the left button is Back and the right button is Edit, when you hit Edit, the left button becomes Cancel and the right button Done. As well as showing what mode you're in and being clear about it, it prevents you going back until you actually get out of edit mode.
>>
>> Something like that work for you?
>>
>> On Mar 13, 2012, at 9:27 AM, Rick Mann wrote:
>>
>>> So, googling suggests I can't do this. I'm rather surprised. In my case, I want to have the user verify they're about to resign the game they're playing if they go back.
>>>
>>> I can't set the nav bar delegate, which is what I need to do. I can subclass UINavigationController to ask my top view if it can be popped, but I wanted to verify there wasn't a cleaner way to do this already.
>>>
>>> Thanks,
>>> Rick
>>>
>>>
>>> _______________________________________________
>>>
>>> Cocoa-dev mailing list (email@hidden)
>>>
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden