Questions tagged [state-restoration]

On iOS, State Preservation and Restoration can be used to save and reload app state to make app termination appear like a temporary interruption. When an apps state is restored, the app returns the user to the last point of use so that the user can continue with whatever task was in progress.

iOS Programming Guide - State Preservation and Restoration:

The state preservation system in UIKit provides a simple but flexible infrastructure for preserving and restoring the state of your app’s view controllers and views. The job of the infrastructure is to drive the preservation and restoration processes at the appropriate times. To do that, UIKit needs help from your app. Only you understand the content of your app, and so only you can write the code needed to save and restore that content. And when you update your app’s UI, only you know how to map older preserved content to the newer objects in your interface.

126 questions
0
votes
1 answer

Debugging and state restoration concerns of WatchOS WCSession sendMessage waking killed iPhone app

I'm trying to add simple WatchOS 2.0 functionality to my app to allow simple actions to be triggered on the watch and have an effect in my main app on the iPhone. All of this hinges by sending messages from the watch using WCSession's sendMessage…
jimbobuk
  • 1,143
  • 9
  • 22
0
votes
1 answer

weak reference delegate not restored

The AddCityViewController is restored with its corresponding textfields. The 'Cancel' and 'Save' buttons contain calls to the delegate. The modal view controller is being restored, but the "Save" and "Cancel" buttons are not activating the delegate…
0
votes
1 answer

Provide default value for restorationIdentifier

I want to override the restorationIdentifier variable so all view controllers inheriting from MyViewController have the restorationIdentifier set to their class names. However, it seems like Swift will not allow me doing this. The var I want to…
Rafa de King
  • 37,274
  • 22
  • 102
  • 134
0
votes
1 answer

A better way to restore segued iOS UIViewControllers

I have a UITableViewController which displays a list of options. Tapping each option navigates to another view controller using a segue The following code is needed to restore the app's state. But is there a cleaner way? I've included code to handle…
Carl
  • 2,696
  • 1
  • 28
  • 44
0
votes
0 answers

iOS8 State Preservation and Restoration is not working

My app has two view controllers, first one is a tableview controller that show all the lists been created, second tableview controller used to show the detail of the list be selected or create a new list and it's been embed in a navigation…
yuying
  • 109
  • 9
0
votes
0 answers

How do I set a variable of a View Controller during restoration?

In View Controller X, I am using prepareForSegue() to set a variable of a View Controller Y. override func prepareForSegue(segue:UIStoryboardSegue, sender:AnyObject) { if (segue.identifier == "mySegue") { let vc =…
Carl
  • 2,696
  • 1
  • 28
  • 44
0
votes
0 answers

Hard work to deal with state restoration in iOS

How to deal with "Warning: Unable to create restoration in progress marker file." I have assigned the Restoration Ids to my view controllers in main story board. I have also assigned Restoration Id to the view controllers created by code. For…
0
votes
3 answers

iPhone 6+ state restoration with tab bar in master split view

I have a problem with supporting state restoration in iPhone 6+. Here's my hierarchy: Problem is when state restoration happens in Portrait orientation and then, at later point, state decoding attempt is made while in Landscape…
mixtly87
  • 1,445
  • 15
  • 26
0
votes
1 answer

encoding either an int or NSInteger for state restoration

I am implementing state restoration in my app. The windows are restored fine, so now I am trying to encode certain properties of a view controller related to an index used to preserve the state of the view of the view controller. I have: @property…
0
votes
1 answer

Delete data saved during state preservation and restoration

My app has a bunch of state preserved and restored to at various times and I'd like to give to the user the option of clearing everything. Is it possible to programmatically clear all of preserved data?
Willam Hill
  • 1,532
  • 1
  • 16
  • 27
0
votes
1 answer

Is there any way to opt out of Core Bluetooth state restoration?

Do someone know how to opt out of CB state restoration once the CBCentralManager has already been instantiated with a restoration identifier? Basically I want to turn CB state restoration off again depending on some conditions (= I don't want to use…
Buju
  • 1,506
  • 2
  • 16
  • 26
0
votes
1 answer

How to restore subview of view controller using state restoration

I am using state restoration to restore previous views and data for my app.When a button is clicked in first view controller I am to pushing second view control.In this case I am able to restore second view controller data.But if I add second View…
0
votes
0 answers

State preservation and restoration in ios 7 with xcode 5

I am trying to implement the state preservation and restoration mechanism in my app for that I implemented the following two methods in appDelegate also given the restoration id to each of my viewController in storyboard, the problem I am facing…
0
votes
0 answers

One value out of many not restoring as it should

I have a handful of elements in one of my view controllers for which I have set up restoration so that values are saved when navigating between views and also when the program is terminated. All of the values are saving as desired, with the one…
C_Dub
  • 67
  • 11
0
votes
1 answer

Using NSCoder for restoration between views (viewWillAppear / viewWillDisappear)

I am wondering if there is a way to maintain user input when navigating back and forth to my main menu using the UINavigationBar back arrow using NSCoder. I am currently using NSCoder to maintain this data during background/terminate/restart and…
1 2 3
8
9