Hank Brekke
Hank Brekke

Reputation: 2024

Tap UINavigationBar title to change

I was wondering how I could create a Navigation Bar where the user could tap the title of the navigation bar, so that it will open a new modal view, similar to the Twitter application when the user is creating a Tweet when they have multiple accounts linked.

Upvotes: 4

Views: 2600

Answers (1)

PengOne
PengOne

Reputation: 48398

You can put a custom subclass of UIView as the titleView of the navigation bar. The easiest thing is to make this a button (or a UIButton on a UIView) and set up an action to present the modal view as you like. You could instead set a view to respond to touches, but I really don't see the advantage of going that route.

Upvotes: 7

Related Questions