Skip to content

Commit

Permalink
[FEAT] #33 - folder deleting attached
Browse files Browse the repository at this point in the history
  • Loading branch information
seongmin221 committed Jan 8, 2024
1 parent 74a7687 commit 733279a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class StorageCollectionViewHeader: UICollectionReusableView {
return self.changeNameButton.rx.tap.asDriver()
}

var deleteFolderButtonTrigger: Driver<Void> {
var showBottomSheetTrigger: Driver<Void> {
return self.deleteFolderButton.rx.tap.asDriver()
}

Expand Down
18 changes: 0 additions & 18 deletions EasyVel/Presentation/Scrap/Storage/View/StoragePostView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,6 @@ extension StoragePostView {
}
}

//extension NewStoragePostView {
//
// func configureCollectionView(with title: String) {
// self.collectionView.collectionViewLayout = createLayout()
// self.collectionView.register(
// StorageCollectionViewHeader.self,
// forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,
// withReuseIdentifier: StorageCollectionViewHeader.reuseIdentifier
// )
// }
//}

//extension NewStoragePostView {
// func showEmptyView() {
// self.emptyImageView.isHidden = false
// }
//}

extension StoragePostView {

func createLayout() -> UICollectionViewLayout {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ final class StorageViewController: BaseViewController {

// MARK: - Setting

override func render() {}

override func configUI() {}

private func bind() {
self.storageView.backButton.rx.tap
.subscribe(onNext: {
Expand Down Expand Up @@ -134,6 +130,11 @@ final class StorageViewController: BaseViewController {
.drive(with: self) { owner, folderName in
owner.showChageFolderNameAlert(folderName: folderName)
}.disposed(by: self.disposeBag)

header.showBottomSheetTrigger
.drive(with: self) { owner, _ in
owner.storageView.showDeleteFolderBottomSheet()
}.disposed(by: self.disposeBag)
}

private func bindNavigation() {
Expand Down Expand Up @@ -244,5 +245,6 @@ extension StorageViewController {
extension StorageViewController: FolderViewControllerDelegate {
func folderVCDismiss(newFolderName: String) {
self.storageView.updateTitle(to: newFolderName)
self.viewModel.updateFolderName(to: newFolderName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,9 @@ extension StorageViewModel {
return self.realm.deleteFolder(folderName: name)
}
}

extension StorageViewModel {
func updateFolderName(to name: String) {
self.folderName = name
}
}

0 comments on commit 733279a

Please sign in to comment.