Re: Managing navigation in an iOS app

2013-05-22 Thread Thomas Davie
Hi James,

I'd suggest that you're probably pushing the idea of decoupling things a bit 
too far here.

View Controllers are inherantly tied to the behaviour of your application, and 
your user's experience of the flow through it.  In 95% of cases, it's 
absolutely correct for the view controller to know "the user pushed this 
button, therefore I should show them this other view controller".

For the 5% of remaining cases where (for example) you have a highly reusable 
view controller that gets used in many different places in the app, and may 
push a different child VC depending on its usage location, I'd suggest simply 
using a delegate to that particular VC to allow you to separate out what gets 
pushed.

Thanks

Tom Davie

On 21 May 2013, at 20:56, j...@clvr.im wrote:

> I'd like to get some opinions on handling navigation without having
> your view controllers modify the navigation stack directly.
> I'm currently working on an app where I've subclassed
> UINavigationController, which in turn has custom methods for showing
> the various views of the app. Each of my app's view controllers has no
> sense of the other pieces of the app, and do not push directly on the
> navigation controller. I'm thinking this a much better method since it
> decouples view controllers from each other and allows the flow of the
> app to be updated more easily.
> I'm using a lot of NSNotifications to signal commands to the
> navigation controller, and it's getting a bit messy. I love the idea
> of a centralized, decoupled navigation controller, but I haven't seen
> any good examples of this yet.
> I would love to get some feedback as to if this is a good idea in the
> first place, or techniques you've implemented to handle this sort of
> thing.
> 
> Cheers,
> 
> James
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/tom.davie%40gmail.com
> 
> This email sent to tom.da...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Managing navigation in an iOS app

2013-05-22 Thread jw
I'd like to get some opinions on handling navigation without having
your view controllers modify the navigation stack directly.
I'm currently working on an app where I've subclassed
UINavigationController, which in turn has custom methods for showing
the various views of the app. Each of my app's view controllers has no
sense of the other pieces of the app, and do not push directly on the
navigation controller. I'm thinking this a much better method since it
decouples view controllers from each other and allows the flow of the
app to be updated more easily.
I'm using a lot of NSNotifications to signal commands to the
navigation controller, and it's getting a bit messy. I love the idea
of a centralized, decoupled navigation controller, but I haven't seen
any good examples of this yet.
I would love to get some feedback as to if this is a good idea in the
first place, or techniques you've implemented to handle this sort of
thing.

Cheers,

James
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com