How do you load custom UITableViewCells from Xib files?

前端 未结 23 1736
抹茶落季
抹茶落季 2020-11-22 11:11

The question is simple: How do you load custom UITableViewCell from Xib files? Doing so allows you to use Interface Builder to design your cells. The answer app

23条回答
  •  孤街浪徒
    2020-11-22 11:20

    Check this - http://eppz.eu/blog/custom-uitableview-cell/ - really convenient way using a tiny class that ends up one line in controller implementation:

    -(UITableViewCell*)tableView:(UITableView*) tableView cellForRowAtIndexPath:(NSIndexPath*) indexPath
    {
        return [TCItemCell cellForTableView:tableView
                              atIndexPath:indexPath
                          withModelSource:self];
    }
    

    enter image description here

提交回复
热议问题