ios - Navigation Controller title image disappears -


i have uitableviewcontroller embedded navigationcontroller, see below:

enter image description here

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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -