Multiline Large title

Hi, is there any information on how to implement such multiline large titles like in AppStore? I have implemented my own solution for multiline large title, but for me it's more preferable to use standard UIKit solution, which is implemented in AppStore app.



Replies

how to implement such multiline large titles like in AppStore

Do you mean the navigation title ?

Have a look here for a detailed solution:
https://stackoverflow.com/questions/47901318/how-to-set-multi-line-large-title-in-navigation-bar-new-feature-of-ios-11

The above solution doesnt work in Xcode 12.5

Are any updates to this question? I'm struggling to find a solution too

Try this

  • Create a custom UINavigationController
  • Add the protocol UINavigationBarDelegate to the class definition
  • Override the function navigationBar(_:shouldPush:)
  • Activate two lines mode using hidden variable item.setValue(true, forKey: "__largeTitleTwoLineMode")
  • Make navigationController.navigationBar.prefersLargeTitles = true
  • This is not ideal as it's using private APIs, which Apple can change at the drop of the hat, and then you're left explaining to your boss why your code doesn't work any more. It's better to find a solution that uses the documented APIs, or tell your designers the UX is not possible.

Add a Comment