You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does anybody know to achieve this effect with Bond?
I managed to get the swipe delete action working as following (based on another great post in the list from another user).
1) create an extension:
extension ReactiveExtensions where Base: UITableView {
var commitItemForRowAt: SafeSignal {
return dataSource.signal(for: #selector(UITableViewDataSource.tableView(_:commit:forRowAt:))) { (subject: PassthroughSubject, _: UITableView, editingStyle: Int, indexPath: IndexPath) in
subject.send(indexPath)
}
}
}
2) add the following two code segments to the view controller:
self.tableWithSetsView.reactive.dataSource.feed(property: Property(true), to: #selector(UITableViewDataSource.tableView(_:canEditRowAt:)), map: { (value: Bool, _: UITableView, indexPath: IndexPath) -> Bool in
print("Edit mode selection at : %d", indexPath.row)
return value
})
self.tableWithSetsView.reactive.commitItemForRowAt.observeNext { index in
print("Delete button requesting deletion confirmation at %d !", index.row)
self.deleteSet(exerciseId: self.exerciseVM?.id ?? "", setId: self.exerciseVM?.sets[index.row].id.value ?? "")
}
The binding is pretty straightforward itself. Everything works fine except the look is not exactly right. Here is the binding code:
exerciseVM.setsBond.bind(to: tableWithSetsView, rowAnimation: .fade) { dataSource, indexPath, tableView in
let cell = tableView.dequeueReusableCell(withIdentifier: SetDurationTableViewCell.identifier, for: indexPath) as! SetDurationTableViewCell
if let exerciseSet = dataSource[indexPath.item] as? SetDurationVM {
cell.setup(setVM: exerciseSet)
cell.delegate = self
return cell
} else {
return UITableViewCell()
}
}
The big question:
What do I need to add to customise the look of the delete swipe action. I am in particular interested in changing the delete action backgroundColor and potentially the title.
The text was updated successfully, but these errors were encountered:
Hi all
I love Bond but I am struggling to use it for my UITableView.
I used to customise the delete action as following without the Bond framework:
Does anybody know to achieve this effect with Bond?
I managed to get the swipe delete action working as following (based on another great post in the list from another user).
1) create an extension:
2) add the following two code segments to the view controller:
The binding is pretty straightforward itself. Everything works fine except the look is not exactly right. Here is the binding code:
The big question:
What do I need to add to customise the look of the delete swipe action. I am in particular interested in changing the delete action backgroundColor and potentially the title.
The text was updated successfully, but these errors were encountered: