swift - Non Standart UITabBarItem Action -


i have uitabbarcontroller view enter image description here

so on every tabbar have viewcontroller. on center uitabbaritem need call modal uiviewcontroller. , should enter image description here

my uitabbarcontroller class like

class planettabbarcontroller: uitabbarcontroller {     override func viewdidload() {         super.viewdidload()         self.tabbar.tintcolor = ktintcolor          var items = self.tabbar.items as! [uitabbaritem]         let centredtabbar:uitabbaritem = items[2]         self.tabbar.layer.borderwidth = 0.50          centredtabbar.image = ktabcentredbarimage         self.tabbar.layer.bordercolor = uicolor.clearcolor().cgcolor         self.tabbar.layer.borderwidth = 0          self.tabbar.shadowimage = uiimage()         // self.tabbar.backgroundimage = ktabbarimage         self.tabbar.backgroundimage?.imagewithalignmentrectinsets          print( uidevice.currentdevice().modelname)         if( uidevice.currentdevice().modelname != "iphone 6" && uidevice.currentdevice().modelname != "iphone 6 plus") {            self.tabbar.backgroundimage = ktabbarimage          }         if( uidevice.currentdevice().modelname == "ipad 2" ) {             self.tabbar.backgroundimage = ktabbarimage         }          if let font = uifont(name: "avenir-black", size: 10) {             let appearance = uitabbaritem.appearance()             let attributes = [nsfontattributename:font]             appearance.settitletextattributes(attributes, forstate: uicontrolstate.normal)         }     } } 

i have no idea how override standart calling of uiviewcontroller , call modal =) please give me advice need search

you can either place uibutton in same area uitabbaritem , fire action or can fire action when selectedsegmentindex changes("value changed" in ib) uitabbar after creating center uitabbaritem. design choice yours. first step understand objects you're working with. easier add button, center aligned, on top of standard uitabbar @ bottom don't deal custom uitabbarcontroller handle non-uniform image above tab bar.

or create own tabbar down there. it's setup few uibuttons or uiviews next 1 don't have static height such uitabbarcontroller allow center object.

uitabbarcontroller

uiviewcontroller

presenting viewcontroller


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -