In an app called "Luvocracy" the title of the navigation bar is changed when the user swipes up on the screen. The old title is pushed up, while the new one is transitioned in. I don't have a video of it now, but here are some screen shots:
https://www.dropbox.com/s/sns0bsxkdv7pw3l/Photo%20Apr%2008%2C%2011%2001%2005%20AM.png
https://www.dropbox.com/s/ys9a49u3dyxrlcm/Photo%20Apr%2008%2C%2011%2001%2009%20AM.png
https://www.dropbox.com/s/dlcfvfvqqov3ag7/Photo%20Apr%2008%2C%2011%2001%2013%20AM.png
How can I animate or transition in a new navigation bar title as shown?
Edit: The app is no longer available on the app store so I am unable to upload a video of this action.
Just because a Swift answer was missing, here's the Swift implementation of Gavin's answer:
Setting up the custom title label:
And here's the title animation code:
This is an example:
(and others applications)
I don't understand very well your question!
This was a great answer but it took some tweaking for me to get it right.
So the general idea is that you have a text in the middle of your scrollView and when the user scrolls up past that text then you want it to become the new title. Furthermore, when you scroll back down, you want it to change back to the default title.
So, using the code that Gix posted, now converted to Swift 3, here's how you get it done.
Add these variables to the top of your viewController
In your viewDidLoad, add this code to set the default title.
Now you add some code to your scrollView delegate function:
The "labelName" var is the label in your scrollview that contains your future title.
You can animate the title changing by using a CATransition... however, because the title itself is a private property on the navigation bar, you need to first create a custom label and attach that to the navigation item.
Setup the title label (this would override the default navigation bar's title):
Then whenever you want to animate the title changing (assume on a scroll view delegate action), add a CAAnimation layer and presto:
You can obviously change the CATransition animation properties to get the effect you're after, but those will give you the 'push-up' effect.