swift - Adding custom buttons to UITabBarController (adding button in the center) -


i'm trying make custom tab bar images made , i'm having trouble. i'm trying add button tab bar , seems can't it. want this: http://a4.mzstatic.com/us/r30/purple122/v4/6a/43/85/6a438540-94f5-a549-f0b4-3b94d63fbc95/screen696x696.jpeg

then adding animations button. how can go adding button? need subclass uitabbarcontroller? thank you!

you should implement delegate method of uitabbarcontrollerdelegate:

func tabbarcontroller(_ tabbarcontroller: uitabbarcontroller, shouldselect viewcontroller: uiviewcontroller) -> bool {       if viewcontroller == (self.tabbarcontroller?.viewcontrollers?[theindexofthebutton])! {        // stuffs here         return false      }     return true } 

don't forget set self.tabbarcontroller?.delegate = self


Comments