Skip to content

Commit

Permalink
refactor #87: 햅틱 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
enebin committed Sep 3, 2023
1 parent 8f2488f commit 63c0c27
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public class HapticManager {
generator.impactOccurred()
}

/// 붕
public func boong() {
let generator = UIImpactFeedbackGenerator(style: .soft)
generator.prepare()
generator.impactOccurred()
}

/// 패턴 재생(패턴은 추후 협의 후 개발해서 추가)
public func playHapticPattern() {
do {
Expand Down
2 changes: 1 addition & 1 deletion Projects/Features/Sources/Onboarding/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public struct OnboardingView: View {
.foregroundColor(.black)
}
.onTapGesture {
HapticManager.shared.tok()
HapticManager.shared.boong()
viewStore.send(.nextButtonDidTap)
}
.padding(Padding.insets(leading: 16, trailing: 16))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public struct RegistrationView: View {

// 다음 페이지로 넘어가기 위한 Button
Button(action: {
HapticManager.shared.boong()
viewStore.send(
.finishRegister(
nickname: viewStore.nicknameTextFieldString,
Expand Down
3 changes: 3 additions & 0 deletions Projects/Features/Sources/SignIn/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import AuthenticationServices
import Core
import ComposableArchitecture
import DSKit
import SwiftUI
Expand Down Expand Up @@ -52,6 +53,7 @@ public struct SignInView: View {
var body: some View {
Button(action: {
store.send(.signInWithKakao)
HapticManager.shared.boong()
}) {
Image("kakao_login")
.resizable()
Expand All @@ -68,6 +70,7 @@ public struct SignInView: View {
var body: some View {
SignInWithAppleButton(
onRequest: { request in
HapticManager.shared.boong()
request.requestedScopes = [.fullName, .email]
},
onCompletion: { completion in
Expand Down

0 comments on commit 63c0c27

Please sign in to comment.