Answer the question
In order to leave comments, you need to log in
How to update view with passed data?
There is a tabBar with two tabs. On the first tab view with a list of users. When you click on the user, a second tab opens with a view on which the user's card. I pass user'a to that controller and do profileView.viewDidLoad(). Then I track the behavior and this is what happens:
Readу to send ----- User ID: 7
viewDidLoad ----- User ID: 7
viewDidLoad ----- User ID: 7
viewDidLoad ----- User ID: 1
viewWillAppear ----- User ID: 1
Answer the question
In order to leave comments, you need to log in
You don't need to use viewDidLoad to update at all. This is a life cycle method.
Describe what view you want to update - a table, just a view, a bar? For which event - what is the trigger? Write it in the question, after I will add the answer.
UPD:
Do you click on the first tabbar to open the second one?) This is not done. Looks like you're a total beginner... Check out UI design guidelines . There are literally 10 pages with pictures, there is a separate section about TabBar. I have a video about tab bar icons.
To update a collection , you need to use reloadData , performBatch , or apply depending on how you set the dataSource. You are a beginner, most likely everything will work through reloadData.
To update just view - use triggers. Delegates, notifications. Set text/image by event.
Ivan, you're right, I'm just learning. And here in the task it is said that when you click on a user in one tab, a second tab opens in which the user profile. But it's all in one tabbar. Therefore, I do not see another solution how to update the view
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question