0

So I have a navigation bar with title that can be changed. The title strings are very long and are not truncated unless I move off this page and come back again.

So after the initial title change it will look like this: Immediately after changing title

Then after segueing to another page and going back it will switch back to what everyone would expect: After segueing out and coming back

I want to be able to have this text truncation occur immediately after the text has been updated

The problem is I have no idea what is causing this issue or where it is happening, thus do not know what code to include in my question.. I was guessing something like navigationItem.titleView to have an "update contents" but cannot find anything that fixes this problem.

Tamarisk
  • 929
  • 2
  • 11
  • 27
  • Check below link. May be it ill solve your issue. [http://stackoverflow.com/a/15480235/1850983](http://stackoverflow.com/a/15480235/1850983) – Payal Maniyar Mar 29 '16 at 05:50

1 Answers1

0

All view controllers has a property called "title", try to put your string like this...

- (void)viewDidLoad { 
    [super viewDidLoad];
    self.title = "YourString";
}

Or in Swift code...

func viewDidLoad {
   super.viewDidLoad()
   self.title = "YourString"
}
iGongora
  • 23
  • 4