Powered by
Powered by
HuntMyIdeas-Inspire You To Make It Happen
Follow
   Me
  • Blogs
  • About Me
  • Home

How to Explain  iOS Application LifeCycle ?

8/18/2018

0 Comments

 
iOS applications transition between a number of states in response to actions happening throughout the system.These states are known as states of Application's lifecycle.

​Apple introduced background processing or multithreading in iOS 4.0.
A running application change it's state because of some interruptions
​

Example:
When a user presses the home button or when he gets a phone call or the app goes through a number of state transitions.

Before discussing the details about the topic,let's focus on the given flow chat of iOS App lifecycle.
Read:
iOS Interview Questions And Answers Part12
Top 5 Basic iOS Questions Asked in interviews

During the entire lifecycle of App,it moves through a series of states .Let me point out the several states of iOS Apps below.The iOS Application lifecycle shows each of the activity in an app from the time it is installed until the time it has been removed from a device. 

Not running  state- This state indicates the app is not launched yet or exited by the system.This means your app has either not been launched, or it has been terminated by the system for some reason.

The App currently staying in Not Running state can be moved into the inactive state when it's launched


Inactive state - This state indicates that the App is running but executing some other codes.This occurs while the app is in the foreground state but does not receive events

Example:
 System locks Device screen automatically to save power.

 The Apps that are currently inactive can move into either the active or background state.


Active  state- It's also called running state .The app is running in the foreground and responding for users action. This is the normal mode for any running app. 

 Active apps can only transition into an inactive state.


Background  state- This state indicates that the App is running in background and executing code. The app enetrs this state while working on any other app in foreground.This state indidates that the app is not active, but still executes code.

In this App state,the app can extend  the execution time to run some additional stuffs.

Read:

Application's Background Transition Cycle in iOS

An app in the background state can move into either the inactive or suspended state.

Note:
The apps can only enter the background state on devices that support multitasking.
Read:

Concept Of Multitasking In iOS App 
​

Suspended  state- The app is running in background but not executing code.Apps in this state are in the background but they don't execute code or receive events. 
-In this state ,system can suspend the App anytime without any notice,if it finds no tasks 
to execute or tasks have been finished it's execution.

Example:

When the device goes through a low memory, system purges apps from memory to release memory.

This happens when an app is running in the foreground requires some additional resources.

Suspended apps can transition into the background or be terminated by the system as required


When an iOS Application moves from one state to another state, system triggers some events or methods,so that user can implement those events to  accomplish some tasks.

Let's discuss those methods one by one.These methods are included in AppDelegate Class.AppDelegate is a Class centrally located to coordinate the behaviours of Application.
It's instantiated by the Main Class of iOS App.

application:willFinishLaunchingWithOption:
This event is triggered when,the app is about to launch for the first time.It is the initial method of app delegate.


application:didFinishLaunchingWithOption : 
This event is triggered just after an app is launched first time.

applicationDidBecomeActive : 
This method is called just after an app enters in foreground mode. This says that app is in Active state.
applicationWillResignActive : 
This method is called just before an app enters in Background state. This Indicates that app is in Inactive state.

applicationDidEnterBackground : 
This method is called just after an app enters in Background state.
In this state app may move to suspended state at any time.

applicationWillEnterForeground :
 This event is called when an app state changes from background mode to foreground mode. It indicates that app is in Inactive state.

applicationWillTerminated : This method is called just before an app exits and try to transition into Not running state.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Delivered by FeedBurner

    RSS Feed

    Archives

    December 2019
    August 2018
    January 2018
    December 2017
    November 2017
    October 2017
    August 2017
    April 2017
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014


    ​​Categories

    All
    Affiliate Marketing
    Alexa Rank
    Apple's Latest Updates
    Blog Tips
    Cocos2d X
    Cocos2d-x
    Google AdSense Tips
    Grab-some-ultimate-ideas
    How-to-create-a-twinkling-star-background-effect-in-ios
    In-App Purchase Tutorial In Cocos2d-x (C++) Using SDKBOX
    Ios Interview Questions And Answers
    IOS Multiple Choice Questions And Answers
    Objective C
    Online Business
    Python
    Secrets To Effective IPhone App Marketing
    SEO Tips
    Swift Interview Questions
    Swift Tutorials
    Top 10 Articles Objective C
    Top 10 Articles-Objective-C
    Top 10 Popular Movies Ever
    Top 10 Popular Things To Know
    Top 10 Ultimate Issues Xcode
    Top 400 IOS Interview Questions
    Top IOS Sample Projects To Learn From
    Top Secrets To App Marketing
    UICollectionView
    Unity 3D
    Xcode

WELCOME TO HUNTMYIDEAS

Picture
I am Jitendra Gochhayat,an iOS Developer,Designer,blogger,
​from Odisha,India.
I write about ​​​blog tips and,
Make money online Tips,
​Objective C tutorials
SUSCRIBE TO NEWSLETTER

    Subscribe to this blog and receive notifications of new posts by email

Suscribe
Picture
Picture
Picture
Picture
Picture
HuntMyIdeas-2016 Powered By Weebly
Picture
Powered by Create your own unique website with customizable templates.
Powered by
Powered by