0
나는 GitHub 레포의 애니메이션을 수행하는 커스텀 액션을 만들고있다. 다음은 TableView
이 VC의 내 코드입니다 :내 tableView 셀에서 사용자 지정 동작을 수행하려면 어떻게해야합니까?
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
}
override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
var done1=UITableViewRowAction(style: .normal, title: "done", handler: UITableViewRowAction!, indexPath: indexPath){
CustomCell.makeanimate(CustomCell)
}
return(done1)
}
을 여기 CustomClass
의 코드입니다 :
func makeanimate() {
self.checkTest.setOn(true, animated: true)
}
내가
done1
을 누를 때
makeanimate
를 호출 할
하지만 내가 말하는 오류가 인스턴스 멤버 유형에 'makeanimate'의 사용은 'customCell'나는 makeanimate
생각
어떻게하면됩니까? –
"editActionsForRowAt"메서드에서 indexPath 값을 사용하고자하는 셀에 대한 참조를 얻은 다음 다음과 같이 makeanimate를 호출합니다. cell.makeanimate (CustomCell) – Fahim
'let cell = tableView.dequeueReusableCell (withIdentifier : "CustomCellID")로! CustomCell cell.makeanimate (CustomCell)'? –