Post

Replies

Boosts

Views

Activity

Comment on Seque is not working
I use the actionGoal in the data model as a section: // Table View Sections              func numberOfSections(in tableView: UITableView) -> Int {         return result?.data3.count ?? 0                          }         func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {             return result?.data3[section].actionGoal // Table View              func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {         if let result = result {             return result.data3[section].actions.count         }             return 0 }         func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {             let action = result?.data3[indexPath.section].actions[indexPath.row]             let cell = ActionTableView.dequeueReusableCell(withIdentifier: "ActionCell", for: indexPath) as! ActionTableCell                 cell.ActionTitle.text = action?.actionTitle                 cell.ActionImage.image = UIImage(named: action!.actionImage)                   return cell And the I am doing the segue: // This code is for the transfer to the next page                  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {                          index = 0                                      performSegue(withIdentifier: "showDetail", sender: self)        }         override func prepare(for segue: UIStoryboardSegue, sender: Any?) {             if let destination = segue.destination as? ActionDetailViewController {                 destination.action = result?.data3[index].actions[(tableView.indexPathForSelectedRow?.row)!]
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’22
Comment on UI Stepper implementation - start counting over
I added the following code: let initialValue = Int(counterTF.text ?? "0") ?? 0, but it is incrementing now.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Comment on Seque is not working
You are a rockstar!
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’22
Comment on Seque is not working
I use the actionGoal in the data model as a section: // Table View Sections              func numberOfSections(in tableView: UITableView) -> Int {         return result?.data3.count ?? 0                          }         func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {             return result?.data3[section].actionGoal // Table View              func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {         if let result = result {             return result.data3[section].actions.count         }             return 0 }         func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {             let action = result?.data3[indexPath.section].actions[indexPath.row]             let cell = ActionTableView.dequeueReusableCell(withIdentifier: "ActionCell", for: indexPath) as! ActionTableCell                 cell.ActionTitle.text = action?.actionTitle                 cell.ActionImage.image = UIImage(named: action!.actionImage)                   return cell And the I am doing the segue: // This code is for the transfer to the next page                  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {                          index = 0                                      performSegue(withIdentifier: "showDetail", sender: self)        }         override func prepare(for segue: UIStoryboardSegue, sender: Any?) {             if let destination = segue.destination as? ActionDetailViewController {                 destination.action = result?.data3[index].actions[(tableView.indexPathForSelectedRow?.row)!]
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’22
Comment on Seque is not working
Thank you so much. It worked. The segue is working, but the first row in the second section is showing the detail of the first row of the first section.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’22