I'm new in ios/swft and faced with problem showing separator in table view. I've spent already few days tried out almost all suggestions none of them works for me. I'm inserting cells dynamically and in this case separator disappears. Below the code I'm using.
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
let tableData = ["One","Two","Three"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
tableView.delegate = self
tableView.dataSource = self
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tableData.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell")!
cell.textLabel?.text = tableData[indexPath.row]
return cell
}
}
On a storyboard it is simple tableview on a view, nothing special.
This is really annoying me, please help to fix it.
It turned out that issue is only on the simulator, not on an actual device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With