LoginSignup
3
2

More than 5 years have passed since last update.

Swift UITableViewCell 特定のセルだけ線を消す

Posted at

Swift UITableViewCell 特定のセルだけ線を消す

separatorInsetの調整
https://developer.apple.com/documentation/uikit/uitableview/1614851-separatorinset

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCell(withIdentifier: R.reuseIdentifier.Cell, for: indexPath)!
    cell.separatorInset = UIEdgeInsets(top: 0, left: self.view.bounds.width, bottom: 0, right: 0)
    return cell
}
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2