Segmented control to toggle through multiple tableviews

前端 未结 3 2208
我寻月下人不归
我寻月下人不归 2021-02-10 23:48

What I’m basically trying to is to implement the control segment/tableview as in Mailbox (see it around 2:00: http://www.youtube.com/watch?v=FG-h8pDXfoE&feature=youtu.be&

相关标签:
3条回答
  • 2021-02-10 23:54

    See SBSegmentedViewController. I wrote it for exactly what you're trying to do.

    0 讨论(0)
  • 2021-02-11 00:02

    It really depends how different each of these table views is. If they are quite similar, it's probably easiest to just share the delegate and data source and have some conditional code.

    In fact you can just have a single table view, but have different cells / configuration depending on your current context. Could be as simple as having adding some conditions to

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
    

    Another approach would be to use view controller containment. You would create a UITableViewController for each and then have parent view controller with segmented control which swaps child view controller accordingly.

    As for the animation and performance, I can't really see any problem. You can get the animations without much effort if you use NSFetchedResultsController, see an example here: https://developer.apple.com/library/ios/documentation/CoreData/Reference/NSFetchedResultsControllerDelegate_Protocol/Reference/Reference.html.

    0 讨论(0)
  • 2021-02-11 00:11

    Take a look at this pod: https://github.com/xmartlabs/XLMailBoxContainer. It makes the UI animation among the view controllers. These view controller can extend UITableViewController or any other view controller.

    UITableViewCell swipe animation can be accomplished using https://github.com/alikaragoz/MCSwipeTableViewCell.

    I hope this could help you!

    0 讨论(0)
提交回复
热议问题