Frage

This is a question on an iPad app that I am currently working on. I have a UIViewController with 2 UItableViews. One UItableview will display a list of accounts and based on selections from this list of accounts, we display details on the other UItableview. This has been setup and works perfectly.

Now the new requirement is to have the users swipe the detail UItableview either left or right and the details view should display the details from list of accounts basically as if somebody touched the next row in the list accounts tableview. I have setup 2 swipegestures for handling this - one for right gesture and another one for the left gesture. This is where I am stuck as I am unable to determine or pass the indexpath of the next row or section from the list accounts tableview.

Any ideas on how to go about doing this?

War es hilfreich?

Lösung

The UIVIewController knows about the two views. So it can query the master view for the selection. And it can tell the master view to change that selection.

But the detail view can't know about the master view. And it can't know about it's controller. So you use the data-source approach for the detail view to get the selection from the controller. And the delegate approach for the detail view to inform the controller when the user has swiped to another account page.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top