Description Background is a beautiful, well designed and easy to use, in which you can browse and save high quality, curated photos. Oct 2, Version 2. Bug fixes. Ratings and Reviews. Everything Subscription Promo. Get fresh content and all features. App Privacy. Information Seller Tron Apps Inc. Size Compatibility iPhone Requires iOS Mac Requires macOS Languages English. The iOS application lifecycle is a collection of application states and methods for moving between them. An application transitions between states based on the behavior of the user and the backgrounding requirements of the application.
The movement is illustrated by the following diagram:. Since the introduction of multitasking support, iOS rarely terminates idle applications, and instead keeps their processes Suspended in memory.
Keeping an application's process alive ensures that the application launches quickly the next time the user opens it. It also means applications can move freely from the Suspended state back into the Backgrounded state without drawing on system resources.
When an app changes state, iOS notifies the application through event methods in the AppDelegate class:. A wallpaper or background also known as a desktop wallpaper, desktop background, desktop picture or desktop image on computers is a digital image photo, drawing etc.
On a computer it is usually for the desktop, while on a mobile phone it is usually the background for the 'home' or 'idle' screen. Though most devices come with a default picture, users can usually change it to custom files of their choosing. A mobile wallpaper is a computer wallpaper sized to fit a mobile device such as a mobile phone, personal digital assistant or digital audio player. The height is often greater than or equal to the width. Kicking off tasks to run in the background allows DidEnterBackground to return in a timely manner, keeping the UI responsive and preventing the watchdog from killing the application.
By keeping track of the remaining backgrounding time, and using expiration handlers when necessary, we can avoid iOS terminating the application. If an application with registered tasks gets moved to the background, the registered tasks will get about seconds to run. We can check how much time the task has to complete using the static BackgroundTimeRemaining property of the UIApplication class.
The following code will give us the time, in seconds, that our background task has left:. In addition to giving access to the BackgroundTimeRemaining property, iOS provides a graceful way to handle background time expiration through an Expiration Handler. This is an optional block of code that will get executed when the time allotted for a task is about to expire. Code in the Expiration Handler calls EndBackgroundTask and passes in the task ID, which indicates that the app is behaving well and prevents iOS from terminating the app even if the task runs out of time.
EndBackgroundTask must be called within the expiration handler, as well as in the normal course of execution. The expiration handler is expressed as an anonymous function using a lambda expression, as illustrated below:. While expiration handlers are not required for the code to run, you should always use an expiration handler with a background task. The biggest change in iOS 7 with regard to background tasks is not how the tasks are implemented, but when they run.
Recall that pre-iOS 7, a task running in the background had seconds to complete. One reason for this limit is that a task running in the background would keep the device awake for the duration of the task:. In iOS 7, backgrounding becomes opportunistic: instead of keeping the device awake, tasks respect when the device goes to sleep, and instead do their processing in chunks when the device wakes up to handle phone calls, notifications, incoming emails, and other common interruptions.
The following diagram provides insight into how a task might be broken up:.
0コメント