Commit 6e29f815 authored by Soomin Lee's avatar Soomin Lee

VLCEditController: Create resetCellat helper

parent a5921e53
......@@ -36,6 +36,17 @@ class VLCEditController: NSObject {
}
}
// MARK: - Helpers
private extension VLCEditController {
private func resetCell(at indexPath: IndexPath) {
if let cell = collectionView.cellForItem(at: indexPath) as? VLCMediaViewEditCell {
cell.checkView.isEnabled = false
}
collectionView.reloadData()
}
}
extension VLCEditController: VLCEditControllerDataSource {
func toolbarNeedsUpdate(editing: Bool) {
editToolbar.isHidden = !editing
......@@ -77,10 +88,7 @@ extension VLCEditController: VLCEditToolbarDelegate {
guard let alertController = alertController,
let textField = alertController.textFields?.first else { return }
media.updateTitle(textField.text)
if let cell = self?.collectionView.cellForItem(at: indexPath) as? VLCMediaViewEditCell {
cell.checkView.isEnabled = false
}
self?.collectionView.reloadData()
self?.resetCell(at: indexPath)
}
alertController.addAction(cancelButton)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment