ios - UISegmentedControl as UINavigationBar title item loads after some delay -


since updated xcode8/ios10 & swift 3 have weird issue on segmented controls used navigation bar titles.. takes time appear. or can touch area (invisible @ time) , appear.

i believe item been loaded not drawn , got either draw touching area or because of event loop asking view redraw.

ui not blocked.

can't find way fix it.

ps: not reproduce on fresh new project

after delay.. on touching area

breaking debug view hierarchy, appears uisegmentedcontrols lives not initialised colors/texts.. will, few seconds later.

enter image description here

ok due threads.

my app on loading initialising core data stack. on callback of instantiating right view controller using window.rootviewcontroller = vc, needs executed on main thread, completion of core data stack init launch on background one.


something weird yet. had implemented uiwindow extension

extension uiwindow {    func setrootviewcontroller(with viewcontroller: uiviewcontroller) {     dispatchqueue.main.async {       self.rootviewcontroller = viewcontroller     }   }  }  // beeing in background thread self.window.setrootviewcontroller(with: self.rootvc) 

this produce issue below.

but next work

extension uiwindow {    func setrootviewcontroller(with viewcontroller: uiviewcontroller) {     self.rootviewcontroller = viewcontroller   }  }  // beeing in background thread dispatchqueue.main.async {    self.window.setrootviewcontroller(with: self.rootvc) } 

don't know what's difference.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -