iOS Lesson 4 Segued Screen only shows details of first cell #30
-
When clicking a cell in the table view controller, the segued screen would only show the details of the first cell, despite the clicked cell being the second or third cell. https://user-images.githubusercontent.com/75611248/128792782-9cf5bfdc-f230-4c58-920c-9741f213649b.mov |
Beta Was this translation helpful? Give feedback.
Answered by
granwyntan
Aug 10, 2021
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ndgsghdj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So in your TableViewController.swift, have a variable to store the index, then in the
didSelectRowAt() function
, modify the index to beindexPath
.Then, you'll need to modify the index accordingly in your
prepare(for segue:, sender:)
override function.update the text below
// Send data here
to modify theindex
variable in your DetailViewController.swift, which is now with the value of 0Don't worry if you're still confused you can listen in next lesson as we'll be going through.