1. Swift realizes split line completion
Swift is a big step forward, as long as you set tableview.separatorinset = Uiedgeinsets.zero to complete the split line,
2, OC realization of Split-line completion
In OC, we have to implement the Uitableviewdelegate two agent method to get the desired effect. The OC Implementation code is as follows
-(void) viewdidlayoutsubviews
{
if ([Self.tableview respondstoselector: @selector (setseparatorinset:)]) {
[Self.tableview Setseparatorinset:uiedgeinsetsmake (0,0,0,0)];
}
if ([Self.tableview respondstoselector: @selector (setlayoutmargins:)]) {
[Self.tableview Setlayoutmargins:uiedgeinsetsmake (0,0,0,0)];
}
}
-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell
Forrowatindexpath: (Nsindexpath *) Indexpath
{
if ([Cell respondstoselector: @selector (setseparatorinset:)]) {
[Cell Setseparatorinset:uiedgeinsetszero];
}
if ([Cell respondstoselector: @selector (setlayoutmargins:)]) {
[Cell Setlayoutmargins:uiedgeinsetszero];
}
}
Swift a code complement TableView split line