Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Jun 25, 2024
1 parent 56ef033 commit 0736019
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
11 changes: 5 additions & 6 deletions iOSClient/Scan document/NCScan+CollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ import NextcloudKit
extension NCScan: UICollectionViewDataSource {

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
if imagesDestination.isEmpty {
save.isEnabled = false
} else {
save.isEnabled = true
}
return collectionView == collectionViewSource ? itemsSource.count : imagesDestination.count
}

Expand Down Expand Up @@ -195,11 +200,5 @@ extension NCScan: UICollectionViewDropDelegate {

func collectionView(_ collectionView: UICollectionView, dropSessionDidEnd session: UIDropSession) {
collectionViewDestination.reloadData()
// Save button
if imagesDestination.isEmpty {
save.isEnabled = false
} else {
save.isEnabled = true
}
}
}
20 changes: 0 additions & 20 deletions iOSClient/Scan document/NCScan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ class NCScan: UIViewController, NCScanCellCellDelegate {
imagesDestination.append(image)
itemsDestination.append(fileName)
}
// Save button
if imagesDestination.isEmpty {
save.isEnabled = false
} else {
save.isEnabled = true
}

collectionViewDestination.reloadData()
}

Expand Down Expand Up @@ -207,13 +200,6 @@ class NCScan: UIViewController, NCScanCellCellDelegate {
itemsSource = itemsSource.sorted()

collectionViewSource.reloadData()

// Save button
if imagesDestination.isEmpty {
save.isEnabled = false
} else {
save.isEnabled = true
}
}

func filter(image: UIImage) -> UIImage? {
Expand Down Expand Up @@ -324,12 +310,6 @@ class NCScan: UIViewController, NCScanCellCellDelegate {
func delete(with imageIndex: Int, sender: Any) {
imagesDestination.remove(at: imageIndex)
itemsDestination.remove(at: imageIndex)
// Save button
if imagesDestination.isEmpty {
save.isEnabled = false
} else {
save.isEnabled = true
}
collectionViewDestination.reloadData()
}

Expand Down

0 comments on commit 0736019

Please sign in to comment.