1

First post. I'm still reading the iOS Human Interface Guidelines and haven't come across this scenario, yet. When displaying multiple columns in a table, what is the appropriate indicator to the user that they can change the column used for sorting?

Michael Mangold
  • 1,741
  • 3
  • 18
  • 32

2 Answers2

4

Well, the UITableView is a one-column table. So, you can usually not change the sorting. I'd recommend reading the Table View Programming Guide. It says right at the beginning:

A table view has only one column and allows vertical scrolling only. It consists of rows in sections. [...]

Björn Landmesser
  • 953
  • 10
  • 26
  • 2
    +1 one thing I don't understand is why Apple wrote a UITableView class and not named it "UIListView". –  Jun 21 '11 at 19:51
  • 1
    Maybe the better way to think about this is to consider the iPod/Music app. Instead of offering a sort option per se, it uses a tab view to offer table views sorted by different properties. – Alex Jun 21 '11 at 19:57
  • Thanks for the replies. In my anticipated scenario, I expect to display two columns of SQLite data and allow the user to sort by either column. – Michael Mangold Jun 21 '11 at 21:19
  • @Michael: An awful hack that sometimes works is to put two tableViews side by side. The awful part is synchronizing their scrolling. – PengOne Jun 22 '11 at 03:23
  • 1
    @PengOne Or create a custom cell/view for the cell that draws both columns, and alter how the data is sorted based on which is selected. Not sure if that'd work, but it sounds like it's not as much of a hack and not as awful. –  Jun 22 '11 at 03:41
2

I have the same challenge. I'm showing a single list of customers, each having a unique number and a descriptive name. I've added a segmented control to the middle of my toolbar that allows the user to sort by name or number. enter image description here

Andrew
  • 11,894
  • 12
  • 69
  • 85