Link: http://stackoverflow.com/a/29821638
Overide
willSelectRowAtIndexPath, return nil2). Hidden seperator
setting at viewDidLoad()
tableView.separatorStyle = UITableViewCellSeparatorStyle.None
3).Height for custom cell
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat
{
switch (cell) {
case ("abc"): // cell's height
return 180
default:
return UITableViewAutomaticDimension // return other cell's height
}
}
4). Execute after reloadData()
Link: http://stackoverflow.com/a/18812830
extension UITableView {
func reloadData(completion: ()->()) {
UIView.animateWithDuration(0, animations: { self.reloadData() })
{ _ in completion() }
}
}
...somewhere later...
tableView.reloadData {
println("done")
}
Objective-C:
[UIView animateWithDuration:0 animations:^{
[myTableView reloadData];
} completion:^(BOOL finished) {
//Do something after that...
}];
Continue ...
0 nhận xét:
Đăng nhận xét