forked from zelo72/mastodon-ios
feat: add some haptic feedbacks for setting scene
This commit is contained in:
parent
fff4f0a204
commit
ca930047d4
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue