-
Notifications
You must be signed in to change notification settings - Fork 912
/
RootViewController.swift
38 lines (22 loc) · 982 Bytes
/
RootViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import UIKit
// how to get separator to run from edge to edge
class RootViewController: UITableViewController {
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 20
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier:"Cell", for: indexPath)
cell.textLabel!.text = "Test"
// must set all three of these:
print(cell.separatorInset)
cell.separatorInset = .zero
// NO! they fixed this too
// cell.layoutMargins = .zero
// NO! They fixed this!!!!! No need for this trick any longer
//cell.preservesSuperviewLayoutMargins = false
// let cell2 = UITableViewCell()
// print(cell2.separatorInset)
//print(cell.separatorInset)
return cell
}
}