Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var options = ["Solstice", "Equinox", "Enable Snapshot"]
- public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return options.count
- }
- public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: "CustomCell", for: indexPath) as! CustomCell
- let switchView = UISwitch(frame: CGRect.zero)
- cell.addSubview(switchView)
- cell.accessoryView = switchView
- cell.nameLabel.text = options[indexPath.row]
- return cell
- }
Add Comment
Please, Sign In to add comment