Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 184.108.40.206 release ready!
Owner and Founder. Opencart
Closure is an important part of the swift language, it has the various use & implementation in swift, here I will provide the one use where you can use to communicate between two-controller.
There is a scenario where we will perform some operation on 2nd controller & get their data in the previous controller for this we can use protocol for this, but we can use closure for this
and reduced the unwanted code & improve the readability.
For more usability & implementation you can read this:
ViewController1 -> ViewController2 .
Notes: Here we have used 2 controllers, the user will go from viewcontroller1 to viewcontroller2 here it will perform some operation & get back with data to viewcontroller1
Here, actually we need some data from “PinAddressController” that will return through “LocationData” Object so we just return this data to caller controller as input param in a Closure.
When the user will click on the done button then we will dismiss the controller or you can pop back to the previous controller after that return the data.
This controller will present the viewcontroller2 or above the controller.
When you will click on getDatataFromOtherController button then it will present the destination controller & after done the second controller which is already on above you will
get the data in “userData”
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.