feat: add some haptic feedbacks for setting scene

This commit is contained in:
CMK 2021-07-23 19:40:41 +08:00
parent fff4f0a204
commit ca930047d4
1 changed files with 5 additions and 2 deletions

View File

@ -358,10 +358,11 @@ 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:
// do nothing feedbackGenerator.impactOccurred()
break
case .notification: case .notification:
// do nothing // do nothing
break break
@ -369,6 +370,7 @@ extension SettingsViewController: UITableViewDelegate {
// do nothing // do nothing
break break
case .boringZone(let link), .spicyZone(let link): case .boringZone(let link), .spicyZone(let link):
feedbackGenerator.impactOccurred()
switch link { switch link {
case .accountSettings: case .accountSettings:
guard let box = context.authenticationService.activeMastodonAuthenticationBox.value, guard let box = context.authenticationService.activeMastodonAuthenticationBox.value,
@ -399,6 +401,7 @@ extension SettingsViewController: UITableViewDelegate {
} }
.store(in: &disposeBag) .store(in: &disposeBag)
case .signOut: case .signOut:
feedbackGenerator.impactOccurred()
alertToSignout() alertToSignout()
} }
} }