objective c - What is a strategy for saving completion handlers when using State Restoration on iOS? -


i'm implementing state restoration in app allow app return right after app has been purged os.

encoding , decoding necessary variables (such text user has typed in text field) straightforward, however, how save completion handler blocks set on variable?

for instance, take apple's uialertcontroller. create uialertactions, when created have parameter handler fires when tapped. handler: ((uialertaction) -> void)?

if apple, , wanted restore uialertcontroller presented, how restore handler? contains unpredictable slew of variables being used in scope, can't imaging can use nscoder's encodeobject method.

is there accepted strategy this? or way whatsoever?

yes, know delegation option, blocks being used more , more lately, , above apple using them. ability capture surrounding variable context important , delegation doesn't provide.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -