[ad_1]
Make two separate arrays of your knowledge one for Scheduled Shoots and the Different for Accomplished Shoots
Keep a Boolean Var to modify between them
var scheduledShoots: [YourModel] = [...]
var completedShoots: [YourModel] = [...]
var isScheduledShootSelected = true
Then in your desk view strategies do that
func tableView(_ tableView: UITableView, numberOfRowsInSection part: Int) -> Int {
return isScheduledShootSelected ? scheduledShoots.rely : completedShoots.rely
}
additionally in your cellForRowAt test on isScheduledShootSelected and populate respective knowledge
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if isScheduledShootSelected {
//Populate scheduledShoots array knowledge
} else {
//Populate completedShoots array knowledge
}
return yourCell
}
Now in your Motion Strategies
@IBAction func scheduledShootPressed() {
isScheduledShootSelected = true
tableView.reloadData()
}
@IBAction func completedShootPressed() {
isScheduledShootSelected = false
tableView.reloadData()
}
[ad_2]
