feat: add haptic feedback for settings
This commit is contained in:
parent
afb79fb870
commit
581f0ba060
|
@ -358,11 +358,10 @@ extension SettingsViewController: UITableViewDelegate {
|
||||||
guard let dataSource = viewModel.dataSource else { return }
|
guard let dataSource = viewModel.dataSource else { return }
|
||||||
guard let item = dataSource.itemIdentifier(for: indexPath) else { return }
|
guard let item = dataSource.itemIdentifier(for: indexPath) else { return }
|
||||||
|
|
||||||
let feedbackGenerator = UIImpactFeedbackGenerator(style: .light)
|
|
||||||
|
|
||||||
switch item {
|
switch item {
|
||||||
case .appearance:
|
case .appearance:
|
||||||
feedbackGenerator.impactOccurred()
|
// do nothing
|
||||||
|
break
|
||||||
case .notification:
|
case .notification:
|
||||||
// do nothing
|
// do nothing
|
||||||
break
|
break
|
||||||
|
@ -370,6 +369,7 @@ extension SettingsViewController: UITableViewDelegate {
|
||||||
// do nothing
|
// do nothing
|
||||||
break
|
break
|
||||||
case .boringZone(let link), .spicyZone(let link):
|
case .boringZone(let link), .spicyZone(let link):
|
||||||
|
let feedbackGenerator = UIImpactFeedbackGenerator(style: .light)
|
||||||
feedbackGenerator.impactOccurred()
|
feedbackGenerator.impactOccurred()
|
||||||
switch link {
|
switch link {
|
||||||
case .accountSettings:
|
case .accountSettings:
|
||||||
|
@ -447,7 +447,8 @@ extension SettingsViewController: SettingsAppearanceTableViewCellDelegate {
|
||||||
setting.update(appearanceRaw: appearanceMode.rawValue)
|
setting.update(appearanceRaw: appearanceMode.rawValue)
|
||||||
}
|
}
|
||||||
.sink { _ in
|
.sink { _ in
|
||||||
// do nothing
|
let feedbackGenerator = UIImpactFeedbackGenerator(style: .light)
|
||||||
|
feedbackGenerator.impactOccurred()
|
||||||
}.store(in: &disposeBag)
|
}.store(in: &disposeBag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue