rock Nroll
rock Nroll

Reputation: 63

Should I use TableView only for multiple rows pages?

I'm creating some kind of a list app and I have two pages where

  1. Is for presenting a list of items (this i will use a TableView for sure) and
  2. For presenting one item of that previous page list, and that page will only present one item each time.

Now, in that 2nd view I want to use that functionality of a TableView row where you can swipe to delete the item, or other options I can insert in this gesture.

Should I use TableView so it will be easy to get this functionality or should I just use a regular ViewController?

thanks

Upvotes: 0

Views: 47

Answers (1)

radiovisual
radiovisual

Reputation: 6468

It is possible to use a UITableView in both of your two views, however, it might not be intuitive for the user to recognize that the "swipe to delete" feature is available if you are using a UITableView with only one row. A UITableView with only one row could feel like an fairly empty UIViewController, which doesn't scream "swipe me, I might be interactive!" So you may benefit by making the "delete" feature more obvious if it is a really important feature (creating a "Delete" button, or adding some type of "tooltip-style" tutorial on first view). If the feature is of secondary importance, then "hiding" it in a "swipe to delete" function that your users may not find is tolerable.

That being said, it's just as easy to build your own "Swipe to Delete" function into a regular UIView, using a UISwipeGestureRecognizer. So if a swipe feature is important to you, it's easy to achieve the same "swipe to delete" feature in either scenario.

It's important that you design a great user experience, so use which ever approach makes the most sense to facilitate your app's feature set. In this example, you will get similar results using both a UITableView or a UIViewController. If it were me, I would opt for the UIViewController option, since you have more flexibility with the design.

Hope this helps.

Upvotes: 1

Related Questions