Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update User Selection Logic to Compare IDs Instead of Names in SelectUserTableViewController #35

Open
banghuazhao opened this issue Sep 12, 2024 · 0 comments

Comments

@banghuazhao
Copy link

banghuazhao commented Sep 12, 2024

In Chapter 12: Creating a Simple iPhone App, Part 1, it is recommended to compare user IDs in SelectUserTableViewController instead of name, as name may not be unique and could result in multiple users being selected.

The provided Swift code comparison can then be updated as follows:

    if user.id == selectedUser.id {
      cell.accessoryType = .checkmark
    } else {
      cell.accessoryType = .none
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant