SlideShare a Scribd company logo
App State Restoration
G. Abhisek
iOS Engineer at OLA
What are we gonna discuss?
• What is State Restoration?

• How does it help us?

• How does it work internally?

• How to integrate?
What is App State Restoration?
• Restore Behaviour and Appearance

• Restore applications Semantic State
What are we looking at?
How does it help us?
Only the strongest will survive
Let us INTEGRATE …. !!
• App Delegate

• View Controllers

• Save Data & Restore Data
App Delegate
• Enable State Restoration
View Controllers
• Provide with Restoration Identifier

• Confirm to UIStateRestoring Protocol

• Provide a Restoration Class (Optional)

• Confirm to UIViewControllerRestoration Protocol (Optional)

• Encode and Decode relevant Data
• If RestorationIdentifier is not set, UIKit skips restoration for the
view controller & subsequent controllers in hierarchy

• Storyboard handles providing restoration class and reference
to controller for restoration

• If implemented without storyboard, provide restoration id,
restoration class and controllers instance.
UIStateRestoring Protocol
UIViewControllerRestoration
Protocol
What to save?
What not to save?
• Data necessary to recreate the view controller

• Primary key of records

• UI states e.g. Slider value, Button Selection
• Its not user defaults nor data

• Saved state can be lost

• If data is a preference, don’t store it in state
restoration archive

• Don’t convert to data and encode
Control Flow
App Launches
Load initial UI
First App initialisation
Does your app
supports state
restoration ?
Get the ViewControllers
Decode saved objects
Finish App restoration
Finish App Initialisation
Run App
NO
YES
UIKit
appDelegate:
applicationWillFinishLaunching:
appDelegate:
shouldRestoreApplicationState:
viewController:
withRestorationIdentifierPath
viewController: decodeRestorableState
appDelegate: didDecodeRestorableState
Testing State Restoration
• RestorationArchiveTool

• StateRestorationDebugLogging.mobileconfig

• StateRestorationDeveloperMode.mobileconfig
What we discussed?
• What is State Restoration?

• What are its benefits?

• How to integrate within App?

• Do’s and Don’ts

• Control Flow
Thanks 😊

More Related Content

PDF
Refreshing Your App in iOS 7
PPTX
IoT ppts unit 4.pptxdaaaaffffffffffaaaaaaaaaaaaff
PPTX
IoT ppts unitvxbxbdbdgaqarqfqwrfqa 4.pptx
PDF
Few features in IOS 8 for developers
PDF
uniwtfeydnsbchabdcccccccccccccchbwahcvhwgdwgciuwdhij
PDF
Splunk in Rakuten: Splunk as a Service for all
PDF
what is iqp overview
Refreshing Your App in iOS 7
IoT ppts unit 4.pptxdaaaaffffffffffaaaaaaaaaaaaff
IoT ppts unitvxbxbdbdgaqarqfqwrfqa 4.pptx
Few features in IOS 8 for developers
uniwtfeydnsbchabdcccccccccccccchbwahcvhwgdwgciuwdhij
Splunk in Rakuten: Splunk as a Service for all
what is iqp overview

Similar to App staterestoration (20)

PDF
Yaron Inger - Enlight - Inside the app of the year
PPTX
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
PPTX
Managing State & HTTP Requests In Ionic.
PPTX
IoT Platform Design Methodology for Design Management via and for Design Deve...
PDF
Universal programming recipes​ - Ekaterina Trofimenko - Women In Technology
PDF
"Universal programming recipes", Kateryna Trofimenko
PDF
Chapter 5 IoT Design methodologies
PDF
[PPT] _ Unit 2 _ 9.0 _ Domain Specific IoT _Home Automation.pdf
PDF
Chapter-5.pdf
PDF
The Future of AI-Based Test Automation
PPTX
apidays LIVE Helsinki & North - Ideas around automating API Management by Mat...
PPTX
Pa2 session 3
PDF
System Proposal(Personal Information & Leave Management System)
PPTX
1-Software Construction and Development.pptx
PDF
Deploy 22 microservices from scratch in 30 mins with GitOps
PPTX
Epicor Kinetic REST API Services Overview.pptx
PPTX
Oracle Identity Manager Basics
PPTX
FIWARE IoT Introduction 1
PPTX
Software Configuration Management
PPTX
Apple Watch and WatchKit - A Technical Overview
Yaron Inger - Enlight - Inside the app of the year
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
Managing State & HTTP Requests In Ionic.
IoT Platform Design Methodology for Design Management via and for Design Deve...
Universal programming recipes​ - Ekaterina Trofimenko - Women In Technology
"Universal programming recipes", Kateryna Trofimenko
Chapter 5 IoT Design methodologies
[PPT] _ Unit 2 _ 9.0 _ Domain Specific IoT _Home Automation.pdf
Chapter-5.pdf
The Future of AI-Based Test Automation
apidays LIVE Helsinki & North - Ideas around automating API Management by Mat...
Pa2 session 3
System Proposal(Personal Information & Leave Management System)
1-Software Construction and Development.pptx
Deploy 22 microservices from scratch in 30 mins with GitOps
Epicor Kinetic REST API Services Overview.pptx
Oracle Identity Manager Basics
FIWARE IoT Introduction 1
Software Configuration Management
Apple Watch and WatchKit - A Technical Overview
Ad

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Big Data Technologies - Introduction.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Big Data Technologies - Introduction.pptx
cuic standard and advanced reporting.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Monthly Chronicles - July 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Encapsulation_ Review paper, used for researhc scholars
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Ad

App staterestoration

  • 1. App State Restoration G. Abhisek iOS Engineer at OLA
  • 2. What are we gonna discuss? • What is State Restoration? • How does it help us? • How does it work internally? • How to integrate?
  • 3. What is App State Restoration? • Restore Behaviour and Appearance • Restore applications Semantic State
  • 4. What are we looking at?
  • 5. How does it help us? Only the strongest will survive
  • 6. Let us INTEGRATE …. !! • App Delegate • View Controllers • Save Data & Restore Data
  • 7. App Delegate • Enable State Restoration
  • 8. View Controllers • Provide with Restoration Identifier • Confirm to UIStateRestoring Protocol • Provide a Restoration Class (Optional) • Confirm to UIViewControllerRestoration Protocol (Optional) • Encode and Decode relevant Data
  • 9. • If RestorationIdentifier is not set, UIKit skips restoration for the view controller & subsequent controllers in hierarchy • Storyboard handles providing restoration class and reference to controller for restoration • If implemented without storyboard, provide restoration id, restoration class and controllers instance.
  • 12. What to save? What not to save? • Data necessary to recreate the view controller • Primary key of records • UI states e.g. Slider value, Button Selection • Its not user defaults nor data • Saved state can be lost • If data is a preference, don’t store it in state restoration archive • Don’t convert to data and encode
  • 13. Control Flow App Launches Load initial UI First App initialisation Does your app supports state restoration ? Get the ViewControllers Decode saved objects Finish App restoration Finish App Initialisation Run App NO YES UIKit appDelegate: applicationWillFinishLaunching: appDelegate: shouldRestoreApplicationState: viewController: withRestorationIdentifierPath viewController: decodeRestorableState appDelegate: didDecodeRestorableState
  • 14. Testing State Restoration • RestorationArchiveTool • StateRestorationDebugLogging.mobileconfig • StateRestorationDeveloperMode.mobileconfig
  • 15. What we discussed? • What is State Restoration? • What are its benefits? • How to integrate within App? • Do’s and Don’ts • Control Flow