0

I am trying to add a UILabel as a custom view to the backButtonItem of the navigationItem but it doesn’t show up.

I want to achieve something like the Mail iOS App as in the following picture where the back button shows the number of unread messages with a background and nice corner radius.

Refer reference image.

enter image description here

Kuldeep
  • 4,466
  • 8
  • 32
  • 59
  • you can refer from https://stackoverflow.com/questions/30022780/uibarbuttonitem-in-navigation-bar-programmatically – Sagar Bhut Aug 20 '18 at 09:46
  • Can you show us what have you done coding on `backButtonItem` so far? – x4h1d Aug 20 '18 at 09:48
  • Possible duplicate of [UIBarButtonItem in navigation bar programmatically?](https://stackoverflow.com/questions/30022780/uibarbuttonitem-in-navigation-bar-programmatically) – Kamaldeep singh Bhatia Aug 20 '18 at 09:49
  • You don't add a custom view to the `navigationItem` on the `backButtonItem`, you just add it as a new button item. Refer to @SagarBhut 's comment to see how to create the item. – George Aug 20 '18 at 10:16

0 Answers0