samedi 14 janvier 2017

Reuse same view in list and detail ViewController

I have common List-Detail app. TableView for displaying the index of Items and detail ViewController showing single item with more details.

List:

+-----------------+
|                 |
|     IMAGE 1     |
|                 |
+-----------------+
|button1  button2 |
|=================|
|                 |
|     IMAGE 2     |
|                 |
+-----------------+
|button1  button2 |
|=================|
|        .        |
|        .        |
|        .        |


Detail:
+-----------------+
|                 |
|     IMAGE 1     |
|                 |
+-----------------+
| some text       |
+-----------------+
|button1  button2 |  <= same actions/handlers as in list
|=================|

Both have a button bar with multiple buttons (like, save, etc). How to reuse the logic of this button bar?

Aucun commentaire:

Enregistrer un commentaire