I am very new to iOS App development and I am writing a Widget using the Swift Language (Swift 3) and noticed that the behaviour of my Widget has changed after upgrading to iOS 10, namely, the Widget stops running as soon as the Notification windows is not in view, but in the previous version of iOS, the widget could run as a service, stopping when I tell it to. Has anyone else experienced this issue, and if so, is there a permission that I can set to keep it running even when the Notification window is out of view?
Here a simple test, it counts values infinitely, but when I go out of view, it stops counting...
override func viewDidLoad() {
super.viewDidLoad()
var counter:Int = 1
while(true){
print("Counter:\t\(counter)")
}
}
If anyone could please explain the difference between the lifecycle of the widgets in iOS, I would be extremely grateful.