[Resolved] What does "Single Instance" do/mean?


#1

What does “Single Instance” do/mean?

image


#2

@justincrabbe Help me out here. What’s the context here? What element is this referencing, a TableView?


#3

This setting seems to be on every page in the app and I’m trying to understand what it does.


#4

Ah yes. So it will make a single instance of the page. So if you recreate the page later in the apps workflow, it will use the same page in the stack every time and not create a brand new page. So if there were views set or text added from the user for instance, if it’s the same instance, that same page would be used and those user inputs would still be preserved.


#5

How does one “recreate” a page in a workflow?
Are you implying that if this isn’t checked and I do a Go to page action a new instance of the page is created on the stack?


#6

That’s correct. Think of Go to pages as “Push Segues” in a native iOS aspect. You are technically moving forward/deeper into a workflow by creating that ViewController (Page) again. Pages are not inherently Single Instances (singletons) unless specified. By checking that box, you are setting up a single instance that will be reused. Now if you Go Back, you are completing an “Unwind Segue” which removes the page you’re currently on from memory and moves back to the already created Page on the stack instead.


#7

Ok makes sense now. Thanks for the clarification.