Questions regarding the lifecycle of iOS apps (e.g. when are applicationDidBecomeActive or applicationWillTerminate called, or when is the best time to do certain initialisations or actions).
Questions tagged [ios-lifecycle]
33 questions
0
votes
0 answers
Bluetooth background: Wake up application periodically (every 15min)
I’m currently working on a project using BLE device. Every 15min, the device send a status to the app.
While the app is on background state, the request sent by this device wakes up the app.
Based on apple documentation, the application could only…

plpb
- 1
0
votes
1 answer
Are there UIScenes that are not UIWindowScenes?
Apple's boilerplate code for UISceneDelegate contains a stub implementation for scene(_:willConnectTo:options:). This starts with:
guard let _ = (scene as? UIWindowScene) else { return }
Is is really possible that we end up in the else branch here?…

Tobi
- 2,591
- 15
- 34
0
votes
3 answers
iOS mobile application first ever app launch detect
I was trying to initiate an integer value in UserDefaults. But I want to do this operation once. At the first launch.
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//…

S. S. Saruar Jahan
- 150
- 9
0
votes
0 answers
sceneWillEnterForeground called when app terminates
I'm updating a Firebase database variable in sceneWillEnterForeground, and for some reason it the update gets triggered not only when the app goes to foreground, but also when I quit the app, It doesn't get triggered when I go to background. How is…

lavenderblue
- 85
- 5
0
votes
1 answer
Are viewcontroller llfecycle events suppose to be called when app is launched into background?
I always knew that window?.makeKeyAndVisible() is to be done within didFinishLaunching
But I also thought non of the root viewcontroller’s life cycle events would get called until app is foregrounded. Is thought incorrect?
i.e. by calling…

mfaani
- 33,269
- 19
- 164
- 293
0
votes
2 answers
Understanding iOS application lifecycle
I'm a bit confused with one transition shown on official Apple lifecycle figure. This Suspended -> Inactive transition looks weird to me. I mean how the app can skip the Background state. The only way for the app to get to the Suspended state is…

starwarrior8809
- 361
- 1
- 10
0
votes
1 answer
viewDidAppear called after applicationDidEnterBackground?
As far as I know nothing can be called after applicationDidEnterBackground returns since after that the app gets suspended. My app is designed in such a way - it start with the initial controller which loads some data from the server and once it is…

starwarrior8809
- 361
- 1
- 10
0
votes
1 answer
How iOS handles events that occurs just right before the background?
First of all I'd like to say sorry in case my question is dummy, I'm really new to iOS and what to understand how thing are going on. Imagine such a situation - user taps on home button and the app starts to collapse, but immediately after taping on…

starwarrior8809
- 361
- 1
- 10
0
votes
1 answer
What happens with the code execution when app goes to the background?
First of all I'd like to say sorry in case you consider my question dummy, but I'm really new to iOS and just want to understand how things works. My question is - what happens with the code execution when I press the home button on my iOS device.…

starwarrior8809
- 361
- 1
- 10
0
votes
0 answers
How to keep an app always running in foreground?
I am making an app that is kind of a countdown timer.
I have it all working fine but when the app goes to background the timer stops. The app also goes into background mode as normal.
I've seen apps in the AppStore where the app is always running -…

Joan Cardona
- 3,463
- 2
- 25
- 43
0
votes
3 answers
setup func can't change backgroundColor in a viewController
I actually use this to switch from a ViewController to another
let vue = MAINSTORYBOARD.instantiateViewController(withIdentifier: "addhoraire") as! Addhoraire
self.present(vue, animated: true, completion: nil)
sometimes I want to change…

Cydiaddict
- 277
- 4
- 17
0
votes
1 answer
Data Passing between VC : Objective C
I am newbie working on objective C. I am facing one problem .
I have tab bar controller containing three view controllers out of which I am concerned about only two VCs named "Setting" and "BBVC" . "BBVC" has a UIButton and "Setting" has a…

blueWings
- 71
- 1
- 9
0
votes
1 answer
Preserving and restoring application state in xamarin forms
In Prism for xamarin forms, How does the navigation stack is restored when application is resumed after got killed by OS?

manvendra yadav
- 129
- 1
- 7
0
votes
1 answer
Open settings from my app then handle comeback event
I am opening setting from my application viewcontroller like this
if let url = NSURL(string: UIApplicationOpenSettingsURLString) as URL? {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
And after turning notifications on…

Yawar
- 1,924
- 3
- 29
- 39
0
votes
1 answer
do network call from current ViewController or parent ViewController?
I'm writing an app that contains network call in every other screen. The result of calls would be the dataSource for a specific screen.
The question is, should I do network call in the parent viewController and inject the data before pushing…

sarawanak
- 387
- 1
- 6
- 17