Detect and handle, or override, clicks on a navigation bar

Posted by Henrik Erlandsson on Stack Overflow See other posts from Stack Overflow or by Henrik Erlandsson
Published on 2010-05-31T07:37:39Z Indexed on 2010/05/31 7:42 UTC
Read the original article Hit count: 228

I have an app where I've pushed two items onto the navigation bar. The top item, which ends up as a 'back' button, should have the function to jump all the way back to the start page, which is a list of web news. The other one simply displays a logo. The boss wants a navigation bar look and feel but with a simple function, so the user can click around the news site, but always be able to jump to the news list page with just the one click.

Is the only option to create a fixed navbar with two items in IB, so that I can connect an outlet to the clickable item - or is there some way to intercept clicks to the navbar to make a requestURL? touchesBegan or touchUpInside would be fine, but I've found no way of implementing that so far.

It's okay if the whole navbar is clickable, I just need some hint how to make it happen. Add a transparent UIlabel on top and detect clicks for that, maybe?

A bonus would be to hide the item in the 'back' position without popping it from the stack.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about override