Skip to content

Commit

Permalink
Merge pull request #158 from LifePoop/153-cheering_fix
Browse files Browse the repository at this point in the history
힘주기 요청 시 진동 제거하고 햅틱효과로 수정
  • Loading branch information
junu0516 authored Nov 6, 2023
2 parents 0e7733a + eb4933e commit 25cd6f5
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 Lifepoo. All rights reserved.
//

import AVFoundation
import UIKit

import RxCocoa
Expand Down Expand Up @@ -93,8 +92,8 @@ public final class FriendStoolStoryViewController: LifePoopViewController, ViewT
.disposed(by: disposeBag)

cheeringButton.rx.tap
.do(onNext: { _ in
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
.do(onNext: { [weak self] _ in
self?.activateHapticEffect()
})
.bind(to: input.cheeringButtonDidTap)
.disposed(by: disposeBag)
Expand Down Expand Up @@ -214,4 +213,10 @@ public final class FriendStoolStoryViewController: LifePoopViewController, ViewT
viewModel?.input.screenDidTap.accept(.right)
}
}

private func activateHapticEffect() {
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.prepare()
generator.impactOccurred()
}
}

0 comments on commit 25cd6f5

Please sign in to comment.