swift - Update Glance view in WatchKit -


hello i'm newbie in programming, wanna learn. here simple code in swift, how can update the illegalat label every time when open glance view , display updated value if any. thank help

import watchkit import foundation  class glanceinterfacecontroller: wkinterfacecontroller {      @iboutlet weak var illegalat: wkinterfacelabel!      override func awakewithcontext(context: anyobject?) {         super.awakewithcontext(context)          let  shareddefaults = nsuserdefaults(suitename: "group.birkyboy.todayextensionsharingdefaults")          let illat = shareddefaults?.objectforkey("illegalat") as! string         illegalat.sethidden(false)         illegalat.settext(illat)          // configure interface objects here.     }      override func willactivate() {         // method called when watch view controller visible user         super.willactivate()     } } 

each time glance displayed, willactivate called. that's appropriate place update illegalat label.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -