How to add image in UITableViewRowAction?

前端 未结 6 987
囚心锁ツ
囚心锁ツ 2020-11-30 05:58

I\'m trying to add image in UITableView Swipe style. I tried with Emoji text & its working fine

func tableView(_ tableView: UITableView, edi         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 06:55

    func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
    
        let write = UITableViewRowAction(style: .default, title: "\u{1F58A}") { action, index in
            print("edit button tapped")
        }
    
        return [write]
    }
    

    try this used unicode instead icon. this will work

提交回复
热议问题