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

CoreBluetooth and State Preservation & Restoration when peripheral needs special ACK

I'm working with a Bluetooth peripheral that after connecting to it there is a ACK back and forth before it actually can send me the data that I need. The flow is like this: Discover the peripheral Connect to the peripheral Discover services and…
72lions
  • 630
  • 2
  • 7
  • 12
0
votes
1 answer

How to present a loading spinner during State Restoration whilst waiting for CoreData/Network requests?

I already asked about state restoration and CoreData 4 years ago here State preservation and restoration strategies with Core Data objects in a UIManagedDocument In the end my App does what I described and state restores URIRepresentations for any…
jimbobuk
  • 1,143
  • 9
  • 22
0
votes
1 answer

UIAppearance bug during state restoration

Update Matt rightly pointed out that my original project had an error with state restoration. However, even after it is removed, I am able to reproduce an issue as long as I am using a table view inside a navigation controller and trying to set…
Andriy Gordiychuk
  • 5,818
  • 1
  • 20
  • 52
0
votes
2 answers

Restore Google Cloud project

i'm unable to restore the pended project for deletion on google cloud. this projects was shared with me before to manage it from my other account which i forgot the owner id i was use for this project. i have received the message today from google…
0
votes
1 answer

State Restoration and Managed Objects Crashing

I have been unable to find any information myself that was helpful to this topic, and I am somewhat new and self taught so apologies for any ignorance. I am making a contacts style app that allows you to record visits made with a specific person. I…
0
votes
1 answer

CoreBluetooth re-subscribe to characteristic while reconnecting

In my app, I am able to successfully connect to a BLE peripheral and subscribe to a characteristic, so that the app gets notified whenever there is a change in the characteristic value. But the app is not notified upon changes in characteristic…
0
votes
0 answers

Restore UICollectionViewCell

I've assigned restorationIdentifier to subclass of UICollectionViewCell When app moves to background encodeRestorableState(with coder: NSCoder) got called, but when app restores decodeRestorableState(with coder: NSCoder) is not called. I've tried to…
abagmut
  • 731
  • 1
  • 6
  • 22
0
votes
0 answers

How can I restore coreBluetooth state from a viewController?

I'm trying restore state from my viewController that implements core bluetooth. I’m trying the restore posted in this question: coreBluetooth question , but this is added into appDelegate instead of a viewController. So the code added in…
user3745888
  • 5,443
  • 14
  • 43
  • 85
0
votes
1 answer

Unrecognized selector sent to class (singleton)

I have found a few related topics on this question, but I don't understand how the solutions presented there are applicable to a singleton class. When my app starts up, I call gamestate.shardInstance() in applicationDidBecomeActive but it…
Aleksandr
  • 444
  • 3
  • 10
0
votes
2 answers

BLE Restoration/Preservation unexpected effect

I have implemented restoration functionality for CoreBluetooth and it works fine, except one thing - after a week (+/- - not sure for 100%) in the background, without opening, app terminated and not restored anymore on any BLE-based events (tested…
hbk
  • 9,872
  • 9
  • 82
  • 110
0
votes
0 answers

Is there any way to manually discard app's saved state in iOS?

I want to get clarified or possibly get a solution to a problem that I am facing in terms of restoring state goes. I successfully restore app' state on launch. I restore a view controller and other view controllers in hierarchy that was saved to…
badhanganesh
  • 3,211
  • 2
  • 17
  • 34
0
votes
1 answer

Implement state restoration for an app that has been built already

I want some advice on how to properly take on implementing state preservation and restoration for an app that has been build already, having lot of view controllers and complex hierarchy. What are the things to be kept in mind when trying to…
badhanganesh
  • 3,211
  • 2
  • 17
  • 34
0
votes
1 answer

Xcode 8.1 UIDataSourceModelAssociation broken?

I am trying to implement state restoration on a Core Data project (Swift) and am having problems with implementing the UIDataSourceModelAssociation protocol on the data source for a UITableView in a split view controller, which is a wrapper class…
Joanna Carter
  • 163
  • 2
  • 7
0
votes
1 answer

How to programmatically terminate NSApp without encoding window state?

All OS X application that support NSWindowRestoration can be closed by selecting the menu entry "Quit and Close All Windows" (Option-Command Q). This disables the state restoration and the next time you open the app all windows will be in their…
Klaas
  • 20,950
  • 10
  • 88
  • 98
0
votes
1 answer

restoring a modal view controller

Modal view controller's delegate is (null) with attempting to restore it

The method is not being called... + (UIViewController *)viewControllerWithRestorationIdentifierPath:(NSArray *)identifierComponents after defining a…
1 2 3
8 9