0

I have an interactive custom view controller transition based on a storyboard segue (push).

The target view controller takes some time to be loaded as it contains a table with a lot of data; moreover when I leave this vc and come back, I need the table to maintain its content offset and not to start each time from the first row.

In order to achieve these two points I need the target vc to be a kind of singleton, and not to be deallocated/reallocated every time.

Any suggestion?

Thanks, DAN

DAN
  • 919
  • 1
  • 6
  • 23

1 Answers1

2

Don't use a segue -- they always instantiate new view controllers. Create a property for the destination view controller in the controller that initiates the transition, and only instantiate it the first time you go to it. Push the new controller in code.

rdelmar
  • 103,982
  • 12
  • 207
  • 218