小修改

This commit is contained in:
Fin 2024-04-01 17:41:47 +08:00
parent 60fce59253
commit b36199f21b
2 changed files with 4 additions and 4 deletions

View File

@ -60,7 +60,6 @@ class SoundsViewController: BaseViewController<SoundsViewModel> {
} }
return cell return cell
} }
} titleForHeaderInSection: { dataSource, section in } titleForHeaderInSection: { dataSource, section in
return dataSource[section].model return dataSource[section].model
} canEditRowAtIndexPath: { dataSource, indexPath in } canEditRowAtIndexPath: { dataSource, indexPath in
@ -176,7 +175,7 @@ extension SoundsViewController: UIDocumentPickerDelegate {
let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: types) let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: types)
documentPicker.delegate = self documentPicker.delegate = self
documentPicker.allowsMultipleSelection = false documentPicker.allowsMultipleSelection = false
documentPicker.modalPresentationStyle = .formSheet documentPicker.modalPresentationStyle = .pageSheet
self.present(documentPicker, animated: true, completion: nil) self.present(documentPicker, animated: true, completion: nil)
} else { } else {
self.showSnackbar(text: "Requires iOS 14") self.showSnackbar(text: "Requires iOS 14")

View File

@ -34,6 +34,7 @@ class SoundsViewModel: ViewModel, ViewModelType {
var soundSelected: Driver<SoundItem> var soundSelected: Driver<SoundItem>
/// ///
var importSound: Driver<URL> var importSound: Driver<URL>
///
var soundDeleted: Driver<SoundItem> var soundDeleted: Driver<SoundItem>
} }
@ -48,7 +49,7 @@ class SoundsViewModel: ViewModel, ViewModelType {
var pickerFile: Driver<Void> var pickerFile: Driver<Void>
} }
/// URL SoundItem /// URL SoundItem
func getSounds(urls: [URL]) -> [SoundItem] { func getSounds(urls: [URL]) -> [SoundItem] {
let urls = urls.sorted { u1, u2 -> Bool in let urls = urls.sorted { u1, u2 -> Bool in
u1.lastPathComponent.localizedStandardCompare(u2.lastPathComponent) == ComparisonResult.orderedAscending u1.lastPathComponent.localizedStandardCompare(u2.lastPathComponent) == ComparisonResult.orderedAscending
@ -92,7 +93,7 @@ class SoundsViewModel: ViewModel, ViewModelType {
self.dependencies.soundFileStorage.deleteSound(url: model.model.url) self.dependencies.soundFileStorage.deleteSound(url: model.model.url)
}).disposed(by: rx.disposeBag) }).disposed(by: rx.disposeBag)
// //
let soundsListUpdated = Observable.merge( let soundsListUpdated = Observable.merge(
// //
Observable.just(()), Observable.just(()),