Navigation bar topitem add right bar button item not shown iOS swift
Problem:
I want to add condition that sometime right bar button item shown and sometime it will not to be shown.That condition all time no button came.But i added item.My code as like below.
if i == 0 {
self.navBar.topItem?.rightBarB
}
Solution:
The above code have a problem that you cannot initialise and assigned right bar button item.First you have to assign right bar button item and then add it.It will works.Change the code as like below.
self.navBar.topItem?.rightBa
if i == 0 {
self.navBar.topItem?.rightBarB
}
Comments
Post a Comment