开发者

UINavigationController+UITableView: Design pattern: perform three actions

开发者 https://www.devze.com 2023-01-07 22:10 出处:网络
I have a UINavigationController and a UITableView. I want the user to be able to: Add a new row. Move back to the previous UIViewController.

I have a UINavigationController and a UITableView.

I want the user to be able to:

  1. Add a new row.
  2. Move back to the previous UIViewController. These two actions开发者_StackOverflow中文版 are supported by the following design pattern:

    [[Back]    Title   [+]]
    

However if I also want the user to be able to edit the list, how then do I do this? There is no position for the Edit button. Unless I replace the [+] symbol with an Edit button:

[[Back]    Title   [Edit]]

When the edit button is clicked this becomes:

[Done]  Title    [+]
--------------------
(-) Row name     (=)
(-) Row name 2   (=)

Is this a valid solution?


Perhaps take an example from the built-in Contacts app? You could add a footer row to your sections that has the plus icon and will add a new row when tapped:

[Back]  Title [Edit/Done]
(-) Row 1     (=)
(-) Row 2     (=)
(+) Add a row
0

精彩评论

暂无评论...
验证码 换一张
取 消