I need to save the state of my UITableViewCell (specifically, the offset of an embedded table view). Is prepareForReuse
a good place to do this? If it were a UIViewController, I would look into viewWillDisappear
, but obviously that's not an option here.
I'm thinking I need to save the state whenever the cell gets marked for reuse (taken "off" the table view). I'm trying to think of some weird case where a cell would be taken off the table view, not have prepareForReuse
called, and then be put back on the UITableView (thereby skipping my saving code).
Thanks!
Edit For More Info
I've created a Pulse Reader like interface. Illustration here: When Do You Need To Reset the view.frame Property After a Transformation iOS
I need to save the location of the embedded, horizontal table views so that as a user scrolls a horizontal table view out of view (by scrolling the vertical table view) and then scrolls that horizontal table view back into view (again, by scrolling the vertical table view) that the horizontal table view is in the same position as the user left it. That is, if they are looking at cell 15 of row 1, then scroll to row 20, then back to row 1, I want cell 15 to be right where they left it.