ios - How can I turn my UINavigationBar into UINavigationController (for use with this library)? -


i using mrprogress library. takes auinavigationcontroller argument. however, in viewcontroller (which presented modal), create uinavigationbar myself.

    // create navigation bar     navigationbar = uinavigationbar(frame: cgrectmake(0, 0, self.view.frame.size.width, 44 + statusbarheight()))     navigationbar.backgroundcolor = uicolor.whitecolor()     navigationbar.delegate = self;      // create navigation item title     let navigationitem = uinavigationitem()     navigationitem.title = "new conversation"     navigationbar.titletextattributes = [         nsforegroundcolorattributename: colors.logo0,         nsfontattributename: fonts.title     ]      //back button     let backbutton = uibutton(type: .custom)     backbutton.addtarget(self, action: #selector(createsessionviewcontroller.backbuttonaction(_:)), forcontrolevents: uicontrolevents.touchupinside)     backbutton.frame = cgrectmake(0, 0, 20, 20)     let cross = uiimage(named: "cross.png")     backbutton.tintcolor = uicolor(hex: 0xcccccc)     backbutton.setimage(cross?.imagewithrenderingmode(.alwaystemplate), forstate: uicontrolstate.normal)     backbuttonbar = uibarbuttonitem(customview: backbutton)     navigationitem.leftbarbuttonitems =  [backbuttonbar]      //add nav bar     navigationbar.items = [navigationitem]     self.view.addsubview(navigationbar) 

how can pass navigation bar library argument? library supports:

mrnavigationbarprogressview(fornavigationcontroller: uinavigationcontroller!)

if makes sense, present modally uinavigationcontroller wraps viewcontroller.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -