Using callback closure(block) passing data back in iOS
2 min readOct 3, 2020
This topic is a classical issue in iOS development, and its solution is various as other example already shown. In this example I’ll show another daily common use one: passing data using closure by adapting delegate pattern example on this page into callback closure!
one thing this method is superior to delegate pattern is instead of split the setting up code in two different place( look at delegate example on this page, prepareForSegue ,userDidEnterInformation ) rather gathering them together( only in prepareForSegue, I’ll show it )