Swift Simple Summary TableViewToday to summarize a very simple question, really say out of shame, but because I write the SWIFT project always found that xib can not be loaded, and more than once, so a simple summary!One: Simple use of the cache pool1. Set the ID of the cell in the storyboard 2. In the controller's cell, you can use the ID directly to create a
1 override func TableView (Tableview:uitableview, Cellforrowatindexpath Indexpath:nsindexpath) UITableViewCell {2as ! UITableViewCell34 "icocos----------iOS"5 6 return cell7 }
two: Using a custom class implementation1. You need to register a cell first and set an ID (you can also set the global constants ahead of Time) 2. In the Controller cell, you can directly use the custom cell and ID to implement the cell display.
1 override func TableView (Tableview:uitableview, Cellforrowatindexpath Indexpath:nsindexpath) UITableViewCell {2as ! Icocostableviewcell34 " icocos----------iOS"56 return cell 7 }
Three: Using a custom class +xib implementationthe xib corresponds to the cell.1. Define a marker for the cell in Xib 2. Define a global constant ID (mentioned earlier) in the control and need to be the same as the ID in Xib 3. Register a NIB (XIB) using the defined ID 4. Finally agreed to display the cell data within the control
1 override func TableView (Tableview:uitableview, Cellforrowatindexpath Indexpath:nsindexpath) UITableViewCell {2as ! Icocostableviewcell34 " icocos----------iOS"56 return cell 7 }
iOS Development--ui Advanced Swift Chapter &swift Simple Summary TableView