Apologies beforehand if this already has an answer but I wasn't able to find the answer that I was looking for.
I have been stuck on the best way to approach passing data from the UIView to the UIViewController. Let's suppose I have this form data with information the user has filled out. The data exists in the view via the individual UITextFields. How should I pass these information to the controller to perform validation and to create a post request with this data?
Does it make sense to do this via a closure? Like the following:
@objc func submitFormData() {
// call function passed via the view controller
}
What is the best practises for passing data between the view and the controller? For your information, I am not using StoryBoard and I am creating everything programmatically.
Answers would be greatly appreciated, thanks!