ios - Navigation Controller title image disappears -
i have uitableviewcontroller embedded navigationcontroller, see below:
and here how added in image in title:
navigationitem.titleview = uiimageview(image: views.navigationbarlogo)
however, have uitableviewcontroller create programmatically , of course image in navigation controller disappear, there way add in image without repeating code above.
thanks!
the uinavigationitem specific single view controller. way want create base class sets titleview , have each of desired view controllers in navigation controller inherit base class. sample base class:
class mybaseclass: uiviewcontroller { override func viewdidload() { super.viewdidload() // additional setup after loading view. self.navigationitem.titleview = uiimageview(image: views.navigationbarlogo) } }
Comments
Post a Comment