In my app, being developed by Swift and XCode 6, I have to query a database and according to that answer then I'll modify and show some UI widgets which, in my case, are three colored buttons whose I have to change their text which consists in a number. These buttons indicate the number of tasks assigned to an user and they have different colors according to the tasks' priority.
So, shall I query the database in viewDidLoad() function and then change the buttons' text in viewWillAppear according to the answer? Is that right?