Skip to content

Commit

Permalink
小修改
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Apr 1, 2024
1 parent 60fce59 commit b36199f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Controller/SoundsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class SoundsViewController: BaseViewController<SoundsViewModel> {
}
return cell
}

} titleForHeaderInSection: { dataSource, section in
return dataSource[section].model
} canEditRowAtIndexPath: { dataSource, indexPath in
Expand Down Expand Up @@ -176,7 +175,7 @@ extension SoundsViewController: UIDocumentPickerDelegate {
let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: types)
documentPicker.delegate = self
documentPicker.allowsMultipleSelection = false
documentPicker.modalPresentationStyle = .formSheet
documentPicker.modalPresentationStyle = .pageSheet
self.present(documentPicker, animated: true, completion: nil)
} else {
self.showSnackbar(text: "Requires iOS 14")
Expand Down
5 changes: 3 additions & 2 deletions Controller/SoundsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class SoundsViewModel: ViewModel, ViewModelType {
var soundSelected: Driver<SoundItem>
/// 铃声导入
var importSound: Driver<URL>
/// 删除铃声
var soundDeleted: Driver<SoundItem>
}

Expand All @@ -48,7 +49,7 @@ class SoundsViewModel: ViewModel, ViewModelType {
var pickerFile: Driver<Void>
}

/// 将铃声URL转换成 SoundItem
/// 将铃声 URL 转换成 SoundItem
func getSounds(urls: [URL]) -> [SoundItem] {
let urls = urls.sorted { u1, u2 -> Bool in
u1.lastPathComponent.localizedStandardCompare(u2.lastPathComponent) == ComparisonResult.orderedAscending
Expand Down Expand Up @@ -92,7 +93,7 @@ class SoundsViewModel: ViewModel, ViewModelType {
self.dependencies.soundFileStorage.deleteSound(url: model.model.url)
}).disposed(by: rx.disposeBag)

// 铃声列表有更新
// 铃声列表有更新
let soundsListUpdated = Observable.merge(
// 刚进页面
Observable.just(()),
Expand Down

0 comments on commit b36199f

Please sign in to comment.