Top Banner
These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring application state on iOS Session 222 Gordie Freedman UIKit iOS Developer What’s New in State Restoration
220

What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

May 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

These are confidential sessions—please refrain from streaming, blogging, or taking pictures

Saving and restoring application state on iOS

Session 222Gordie FreedmanUIKit iOS Developer

What’s New in State Restoration

Page 2: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application State Restoration

Page 3: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Agenda

Page 4: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Agenda

• Feature highlights

Page 5: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Agenda

• Feature highlights•What’s new in iOS 7

Page 6: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Agenda

• Feature highlights•What’s new in iOS 7• Security/background operation

Page 7: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Agenda

• Feature highlights•What’s new in iOS 7• Security/background operation• Tools

Page 8: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Is State Restoration?

Page 9: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Is State Restoration?

• Preserve app state

Page 10: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Is State Restoration?

• Preserve app state• Restart is like resuming from the background

Page 11: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Is State Restoration?

• Preserve app state• Restart is like resuming from the background• Based on what the user is doing

Page 12: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DemoImage Viewer: implicit restoration

Page 13: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Page 14: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Navigation Controller

Page 15: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Navigation Controller

Page 16: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Navigation Controller

Page 17: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Navigation Controller

Page 18: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller

Page 19: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller

Page 20: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller

Image

Page 21: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller

Image

Title

Page 22: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

Image

Title

Page 23: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

Page 24: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Save

Page 25: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Image Controller Save

Page 26: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Image Controller Save

Page 27: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Image Controller Save

Page 28: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Image Controller Save

DataSource Image ID

Page 29: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Image Controller Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

DataSource Image ID[coder encodeObject:imageID forKey:imageIDKey];

Page 30: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Image Controller Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Page 31: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

Image Controller Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

[coder encodeBool:showingBars forKey:showingBarsKey];

Page 32: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Structure

Image ViewCollection View

Navigation Controller

Collection View Controller

Image View Controller

Page 33: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Structure

Image ViewCollection View

Navigation Controller

Collection View Controller

Image View Controller

Restoration Identifiers

Page 34: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Restoring State

Page 35: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Delegate Launch

Page 36: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Delegate Launch- (BOOL)application:(UIApplication *)application

willFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Page 37: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore

Page 38: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore

Page 39: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

Page 40: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DataSource Image ID

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

Page 41: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DataSource Image ID

imageID = [coder decodeObjectForKey: imageIDKey];

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

Page 42: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

Page 43: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

showingBars = [coder decodeBoolForKey: showingBarsKey];

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

Page 44: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Is That All?

Page 45: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Is That All?

•Navigation stack

Page 46: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Is That All?

•Navigation stack• Collection View scroll

Page 47: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Is That All?

•Navigation stack• Collection View scroll

• Selected Cell

Page 48: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Is That All?

•Navigation stack• Collection View scroll

• Selected Cell

• Image Transformation

Page 49: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Structure

Image ViewCollection View

Navigation Controller

Collection View Controller

Image View Controller

Restoration Identifiers

Page 50: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

New in iOS 7

Page 51: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What’s New?

Page 52: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What’s New?

• Support for Generalized Objects

Page 53: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What’s New?

• Support for Generalized Objects• Easier to apply state

Page 54: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What’s New?

• Support for Generalized Objects• Easier to apply state• Improvements to snapshot handling

Page 55: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What’s New?

• Support for Generalized Objects• Easier to apply state• Improvements to snapshot handling• Enhancements

Page 56: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Generalized Objects

Page 57: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Generalized Objects

Page 58: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DataSource

Generalized Objects

Page 59: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DataSource

Generalized Objects

Page 60: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DataSource

Generalized Objects

Shared Filter

Page 61: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Example Application Structure

Image ViewCollection View

Navigation Controller

Image View Controller

Collection View Controller

Page 62: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Example Application Structure

DataSource

Image ViewCollection View

Navigation Controller

Image View Controller

Collection View Controller

DataSource

Page 63: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Example Application Structure

DataSource

Image ViewCollection View

Navigation Controller

Image View Controller

Collection View Controller

DataSource

Page 64: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Example Application Structure

DataSourcePresent

Filter Inspector

Image ViewCollection View

Navigation Controller

Image View Controller

Collection View Controller

DataSource

Page 65: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Example Application Structure

DataSource

Sepia Filter

PresentFilter Inspector

Image ViewCollection View

Navigation Controller

Image View Controller

Collection View Controller

DataSource

Page 66: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Example Application Structure

DataSource

Sepia Filter

Blur Filter

PresentFilter Inspector

Image ViewCollection View

Navigation Controller

Image View Controller

Collection View Controller

DataSource

Page 67: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Example Application Structure

DataSource

Sepia Filter

Blur Filter

PresentFilter Inspector

Image ViewCollection View

Navigation Controller

Image View Controller

Collection View Controller

DataSource

Page 68: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Registering Objects

Page 69: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Registering Objects

•UIApplication class method

Page 70: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Registering Objects

•UIApplication class method- registerObjectForStateRestoration:restorationIdentifier:

Page 71: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Registering Objects

•UIApplication class method- registerObjectForStateRestoration:restorationIdentifier:

id<UIStateRestoring> object

Page 72: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Registering Objects

•UIApplication class method- registerObjectForStateRestoration:restorationIdentifier:

id<UIStateRestoring> objectNSString *restorationIdentifier

Page 73: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIStateRestoring Protocol

Page 74: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIStateRestoring Protocol

• encode/decode methods

Page 75: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIStateRestoring Protocol

• encode/decode methods• restorationParent property

Page 76: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIStateRestoring Protocol

• encode/decode methods• restorationParent property• objectRestorationClass property

Page 77: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

Example Application Structure

DataSourcePresent

Image ViewCollection View

Navigation Controller

Collection View Controller

Image View Controller Filter Inspector

Page 78: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

Example Application Structure

DataSourcePresent

Image ViewCollection View

Navigation Controller

Collection View Controller

Image View Controller Filter Inspector

Page 79: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIObjectRestoration Protocol

Page 80: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIObjectRestoration Protocol

+ objectWithRestorationIdentifierPath:coder:

Page 81: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIObjectRestoration Protocol

+ objectWithRestorationIdentifierPath:coder:NSArray *identifierComponents

Page 82: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIObjectRestoration Protocol

+ objectWithRestorationIdentifierPath:coder:NSArray *identifierComponentsNSCoder *coder (NSKeyedUnarchiver)

Page 83: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

UIObjectRestoration Protocol

+ objectWithRestorationIdentifierPath:coder:NSArray *identifierComponentsNSCoder *coder (NSKeyedUnarchiver)Returns id<UIStateRestoring>

Page 84: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Delegate Launch

Page 85: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Delegate Launch

DataSource

Page 86: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Delegate Launch- (BOOL)application:(UIApplication *)application

willFinishLaunchingWithOptions:(NSDictionary *)launchOptions// ...[UIApplication registerObjectForStateRestoration:self.dataSource restorationIdentifier:@"DataSource"];

// ...

DataSource

Page 87: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

Page 88: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

DataSource

Page 89: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Image View Controller- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

DataSource

Page 90: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Save

Page 91: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Save

Page 92: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Save

DataSource

Page 93: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder

[coder encodeObject:dataSource forKey:dataSourceKey];

DataSource

Page 94: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

Page 95: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

DataSource

Page 96: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

DataSource

Page 97: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Image Controller Restore- (void) decodeRestorableStateWithCoder:(NSCoder *)coder

dataSource = [coder decodeObjectForKey: dataSourceKey];

DataSource

Page 98: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DemoImage Viewer: filters

Page 99: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Page 100: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Page 101: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

What Was Restored?

Page 102: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

What Was Restored?

Page 103: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

What Was Restored?

EnabledIntensity

EnabledIntensity

Page 104: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

What Was Restored?

EnabledIntensity

EnabledIntensity

Page 105: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Filter Inspector- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

Page 106: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Filter Inspector- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

Sepia Filter

Page 107: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Segue to Filter Inspector- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

Sepia Filter

Page 108: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Filter Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder;

Page 109: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Filter Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder;

Page 110: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Filter Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder;

Page 111: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Filter Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder;

Sepia Filter

Page 112: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Filter Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder;

Sepia Filter

Enabled Intensity

Page 113: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Filter Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder;

Sepia Filter

Enabled Intensity

Page 114: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Filter Save- (void) encodeRestorableStateWithCoder:(NSCoder *)coder;

Sepia Filter

Enabled Intensity

Filter Object is shared

Page 115: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters• Save specific Filter info

Page 116: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters• Save specific Filter infoCall registerObjectForStateRestoration

Page 117: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters• Save specific Filter infoCall registerObjectForStateRestorationSet objectRestorationClass property

Page 118: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters

Page 119: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters

Page 120: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters

Page 121: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters• Save specific Filter info

Sepia Filter

Page 122: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Blur Filter

Sepia Filter

Saving State

• Register Filters with State Restoration• Save references to Filters• Save specific Filter info

Sepia Filter

Enabled Intensity

Page 123: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

• Recreate Filters as needed• Restore references to Filters• Restore Filter info•Apply Filters

Restoring State

Page 124: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

• Recreate Filters as needed• Restore references to Filters• Restore Filter info•Apply Filters

Restoring State

objectWithRestorationIdentifierPath

Page 125: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

• Recreate Filters as needed• Restore references to Filters• Restore Filter info•Apply Filters

Restoring State

objectWithRestorationIdentifierPath

Page 126: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

• Recreate Filters as needed• Restore references to Filters

Restoring State

Page 127: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

• Recreate Filters as needed• Restore references to Filters

Restoring State

Page 128: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

• Recreate Filters as needed• Restore references to Filters

Restoring State

Page 129: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

• Recreate Filters as needed• Restore references to Filters• Restore Filter info

Restoring State

Sepia Filter

Page 130: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

• Recreate Filters as needed• Restore references to Filters• Restore Filter info

Restoring State

Sepia Filter

Enabled Intensity

Page 131: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Sepia Filter

Blur Filter

• Recreate Filters as needed• Restore references to Filters• Restore Filter info•Apply Filters

Restoring State

Sepia Filter

Enabled Intensity

Page 132: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Applying Filter State

Page 133: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Applying Filter State

Page 134: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Applying Filter State

Sepia Filter

Enabled Intensity

Page 135: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Applying Filter State

Sepia Filter

Enabled Intensity

Page 136: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Applying Restored State

Page 137: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Applying Restored State

•New method for ViewControllers and UIStateRestoring

Page 138: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Applying Restored State

•New method for ViewControllers and UIStateRestoring- (void) applicationFinishedRestoringState;

Page 139: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) decodeRestorableStateWithCoder:(NSCoder *)coder {    // Restore state    [self updateImage];    }

Image Controller Restore

Page 140: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) decodeRestorableStateWithCoder:(NSCoder *)coder {    // Restore state    [self updateImage];    }

Image Controller Restore

- (void) decodeRestorableStateWithCoder:(NSCoder *)coder {    // Restore state    [self updateImage];    }

Page 141: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

- (void) decodeRestorableStateWithCoder:(NSCoder *)coder {    // Restore state    [self updateImage];    }

Image Controller Restore

- (void) decodeRestorableStateWithCoder:(NSCoder *)coder {    // Restore state    [self updateImage];    }

- (void) applicationFinishedRestoringState {    [self updateImage];    }

Page 142: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Object Lifecycle

Page 143: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

Page 144: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

Base Objects

Page 145: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

No Action RequiredBase Objects

Page 146: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

No Action RequiredBase Objects

Dynamic Objects

Page 147: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

No Action Required

Storyboard: No Action

Base Objects

Dynamic Objects

Page 148: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

No Action Required

Storyboard: No Action

Code

Base Objects

Dynamic Objects

Page 149: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

No Action Required

Storyboard: No Action

CodeRestoration Class

Base Objects

Dynamic Objects

Page 150: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Application Objects

No Action Required

Storyboard: No Action

Restoration ClassCode

Application Delegate

Base Objects

Dynamic Objects

Page 151: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DataSource

Base Objects

Navigation Controller

Page 152: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Storyboard Objects

Page 153: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

RestorationClass Objects

Sepia Filter

Blur Filter

Page 154: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

Page 155: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

Page 156: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch

Page 157: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch- (void)ignoreSnapshotOnNextApplicationLaunch;

Page 158: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch- (void)ignoreSnapshotOnNextApplicationLaunch;

•When to ignore snapshot- (void)ignoreSnapshotOnNextApplicationLaunch;

Page 159: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch- (void)ignoreSnapshotOnNextApplicationLaunch;

•When to ignore snapshot■ Network error presentation

- (void)ignoreSnapshotOnNextApplicationLaunch;

Page 160: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch- (void)ignoreSnapshotOnNextApplicationLaunch;

•When to ignore snapshot■ Network error presentation■ Things that can change dynamically

- (void)ignoreSnapshotOnNextApplicationLaunch;

Page 161: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch- (void)ignoreSnapshotOnNextApplicationLaunch;

•When to ignore snapshot■ Network error presentation■ Things that can change dynamically

• Implicit cases to ignore snapshot

- (void)ignoreSnapshotOnNextApplicationLaunch;

Page 162: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch- (void)ignoreSnapshotOnNextApplicationLaunch;

•When to ignore snapshot■ Network error presentation■ Things that can change dynamically

• Implicit cases to ignore snapshot■ No restoration identifier

- (void)ignoreSnapshotOnNextApplicationLaunch;

Page 163: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Snapshot Handling

•Using snapshot more aggressively on launch- (void)ignoreSnapshotOnNextApplicationLaunch;

•When to ignore snapshot■ Network error presentation■ Things that can change dynamically

• Implicit cases to ignore snapshot■ No restoration identifier■ Things Cocoa Touch doesn’t restore

- (void)ignoreSnapshotOnNextApplicationLaunch;

Page 164: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

DemoSnapshot cases

Page 165: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 166: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 167: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 168: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 169: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 170: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 171: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 172: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring
Page 173: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Enhancements

Page 174: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Enhancements

• System Version/Timestamp keys

Page 175: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Enhancements

• System Version/Timestamp keys• Improved UITableView support

Page 176: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Enhancements

• System Version/Timestamp keys• Improved UITableView support•UICollectionView support

Page 177: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Enhancements

• System Version/Timestamp keys• Improved UITableView support•UICollectionView support•Mail Activity Controller

Page 178: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Security Considerations

Page 179: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Security

Page 180: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Security

• State Restoration archive is data protected

Page 181: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Security

• State Restoration archive is data protected•Why protected?

Page 182: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Security

• State Restoration archive is data protected•Why protected?

■ Could leak via covert channel

Page 183: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Security

• State Restoration archive is data protected•Why protected?

■ Could leak via covert channel■ App could have protected data

Page 184: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Background Operation

Page 185: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Background Operation

Page 186: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Background Operation

Page 187: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Background Operation

Page 188: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Background OperationBe prepared for app to start up with changes to data

Page 189: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Testing/Diagnosis

Page 190: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Page 191: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Restoration class map is { SepiaFilter = ImageViewController;}Top Level---------UIApplicationStateRestorationBundleVersion........1.1UIApplicationStateRestorationTimestamp............2013-05-12 01:22:07 +0000UIApplicationStateRestorationSystemVersion...7...

Page 192: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Restoration class map is { SepiaFilter = ImageViewController;}Top Level---------UIApplicationStateRestorationBundleVersion........1.1UIApplicationStateRestorationTimestamp............2013-05-12 01:22:07 +0000UIApplicationStateRestorationSystemVersion...7...

Page 193: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Restoration class map is { SepiaFilter = ImageViewController;}Top Level---------UIApplicationStateRestorationBundleVersion........1.1UIApplicationStateRestorationTimestamp............2013-05-12 01:22:07 +0000UIApplicationStateRestorationSystemVersion...7...

Page 194: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Restoration class map is { SepiaFilter = ImageViewController;}Top Level---------UIApplicationStateRestorationBundleVersion........1.0UIApplicationStateRestorationTimestamp............2013-05-12 01:22:07 +0000UIApplicationStateRestorationSystemVersion...7...

Page 195: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Restoration class map is { SepiaFilter = ImageViewController;}Top Level---------UIApplicationStateRestorationBundleVersion........1.1UIApplicationStateRestorationTimestamp............2013-05-12 01:22:07 +0000UIApplicationStateRestorationSystemVersion...7...

Page 196: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Restoration class map is { SepiaFilter = ImageViewController;}Top Level---------UIApplicationStateRestorationBundleVersion........1.1UIApplicationStateRestorationTimestamp............2013-05-12 01:22:07 +0000UIApplicationStateRestorationSystemVersion...7...

Page 197: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

State Restoration Archive Tool

Restoration class map is { SepiaFilter = ImageViewController;}Top Level---------UIApplicationStateRestorationBundleVersion........1.1UIApplicationStateRestorationTimestamp............2013-05-12 01:22:07 +0000UIApplicationStateRestorationSystemVersion...7...

Page 198: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Archive Tool: Image View Controller

[View Controller] Class: ImageViewController

kDataSourceKey -> Object Identifier Proxy: DataSourcekImageFiltersKey -> { BlurFilter = Object Identifier Proxy: BlurFilter; ModifyFilter = Object Identifier Proxy: ModifyFilter;}kImageIdentifierKey -> 8993-455F-7D5C-2110

Page 199: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Archive Tool: Image View Controller

[View Controller] Class: ImageViewController

kDataSourceKey -> Object Identifier Proxy: DataSourcekImageFiltersKey -> { BlurFilter = Object Identifier Proxy: BlurFilter; ModifyFilter = Object Identifier Proxy: ModifyFilter;}kImageIdentifierKey -> 8993-455F-7D5C-2110

Page 200: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Archive Tool: Image View Controller

[View Controller] Class: ImageViewController

kDataSourceKey -> Object Identifier Proxy: DataSourcekImageFiltersKey -> { BlurFilter = Object Identifier Proxy: BlurFilter; ModifyFilter = Object Identifier Proxy: ModifyFilter;}kImageIdentifierKey -> 8993-455F-7D5C-2110

Page 201: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Archive Tool: Image View Controller

[View Controller]Class: ImageViewController

kDataSourceKey -> Object Identifier Proxy: DataSourcekImageFiltersKey -> { BlurFilter = Object Identifier Proxy: BlurFilter; ModifyFilter = Object Identifier Proxy: ModifyFilter;}kImageIdentifierKey -> 8993-455F-7D5C-2110

Page 202: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Archive Tool: Image View Controller

[View Controller]Class: ImageViewController

kDataSourceKey -> Object Identifier Proxy: DataSourcekImageFiltersKey -> { BlurFilter = Object Identifier Proxy: BlurFilter; ModifyFilter = Object Identifier Proxy: ModifyFilter;}kImageIdentifierKey -> 8993-455F-7D5C-2110

Storyboard: Main Bundle/MainStoryboardStoryboardIdentifier -> DetailView

Page 203: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Archive Tool: Image View Controller

[View Controller]Class: ImageViewController

kDataSourceKey -> Object Identifier Proxy: DataSourcekImageFiltersKey -> { BlurFilter = Object Identifier Proxy: BlurFilter; ModifyFilter = Object Identifier Proxy: ModifyFilter;}kImageIdentifierKey -> 8993-455F-7D5C-2110

Storyboard: Main Bundle/MainStoryboardStoryboardIdentifier -> DetailView

Page 204: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

[Restorable Object]Class: SepiaFilter

-----------------------------------------

ImageFilterActiveKey -> YESImageFilterIntensityKey -> 0.8485916

Sepia Filter

Archive Tool: Sepia Filter

Page 205: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

[Restorable Object]Class: SepiaFilter

-----------------------------------------

ImageFilterActiveKey -> YESImageFilterIntensityKey -> 0.8485916

Archive Tool: Sepia Filter

Sepia Filter

Enabled Intensity

Page 206: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Archive Tool: Sepia Filter

[Restorable Object]Class: SepiaFilter

-----------------------------------------

ImageFilterActiveKey -> YESImageFilterIntensityKey -> 0.8485916

Sepia Filter

Enabled Intensity

Page 207: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Profiles/Defaults

Page 208: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Profiles/Defaults

• Logging profile/default

Page 209: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Profiles/Defaults

• Logging profile/default■ Play by play saving/restoring

Page 210: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Profiles/Defaults

• Logging profile/default■ Play by play saving/restoring

•Developer Mode profile/default

Page 211: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Profiles/Defaults

• Logging profile/default■ Play by play saving/restoring

•Developer Mode profile/default■ Doesn’t delete archives on error/kill

Page 212: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Summary

Page 213: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Summary

• Recap

Page 214: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Summary

• Recap•New features

Page 215: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Summary

• Recap•New features• Security for Restoration Archives

Page 216: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Summary

• Recap•New features• Security for Restoration Archives• Background operation

Page 217: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Summary

• Recap•New features• Security for Restoration Archives• Background operation• Tools

Page 218: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

More Information

Jake BehrensApp Frameworks [email protected]

DocumentationiOS App Programming Guidehttp://developer.apple.com/

Apple Developer Forumshttp://devforums.apple.com

Page 219: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring

Labs

Cocoa Touch Lab Frameworks Lab BFriday 9:00AM

State Restoration Lab Frameworks Lab BThursday 4:30PM

Page 220: What’s New in State Restoration - Apple Developer · 2016-07-09 · These are confidential sessions—please refrain from streaming, blogging, or taking pictures Saving and restoring