mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
小修改
This commit is contained in:
parent
60fce59253
commit
b36199f21b
@ -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")
|
||||||
|
|||||||
@ -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(()),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user