eric.mitchell
eric.mitchell

Reputation: 8855

Cache UIViewController for presentation/pushing

Is it possible/practical/beneficial to cache UIViewControllers at the startup of an app so that when they need to be presented (or pushed by a UINavigationController), the memory does not have to be allocated and they are already ready? Thanks

Upvotes: 0

Views: 527

Answers (1)

rob mayoff
rob mayoff

Reputation: 385860

Sure it's possible. You can do it in your application delegate's application:didFinishLaunchingWithOptions: method.

It's probably not particularly beneficial, though. If these things take a while to load, you're forcing the user to endure a long wait at app launch time. You're also loading view controllers before you even know if the user will need to see them.

Upvotes: 1

Related Questions