Answer the question
In order to leave comments, you need to log in
What is the best way to pass data between ViewControllers?
Good day everyone. I started trying to create applications for apple technology, and from the lack of information on the topic, questions arose regarding the "normality" of the methods used.
The task itself: to make an application for iOS using several ViewControllers on one storyboard. The first form contains a list of users, the second displays information about a specific user. The transition to the second screen occurs after pressing the button.
How I implemented it: I pulled out the button on the form, right-clicked the arrow on the second form and selected "show", and passed the data to the second form in the prepareForSegue function, checking the name of the segue (suddenly you need to add a transition to another form). Is this how the implementation of transitions was intended or is there some more "official" way?
I tried to connect a button press to a function where I manually created the desired controller and added it to the navigationController stack, but Xcode gives a warning, like you are acting somehow wrong.
Actually, how do you implement such functionality in your applications?
UPDATE
Here, the comrades said that it is better to do this through a button, but now the question is: what exactly does Xcode not like and how to remove this warning (if it needs to be removed at all)?
Answer the question
In order to leave comments, you need to log in
added it to navigationController stack
AuthorizationVC *authVC = [AuthorizationVC new];
// передаем необходимые данные контроллеру
//...
// Показываем его выезжающим снизу
[self presentViewController:[authVC rk_vcToNavController] animated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:nil];
+5 kopecks. If you work alone - do as you like, if in a team - through singleton, so as not to understand set and get.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question