There are many ways to do this. One way is to add an observer.
Like this
NSNotificationCenter.defaultCenter().addObserver(self, selector:"updateStuff", name: UIApplicationWillEnterForegroundNotification, object: nil) func updateStuff() -> Void{
Thus, Selection calls a function in your Today Widget class.
Thus, your widget will call your function when your wider one introduces the foreground.
Please note that your widgetPerformUpdateWithCompletionHandler(completionHandler: ((NCUpdateResult) -> Void)) need to download content from the Internet. What you do not need an observer
Hope I help you.
source share