Skip to content

Commit

Permalink
[chore] #157 햅틱 피드백 수정 및 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeKim98 committed Dec 2, 2024
1 parent e47c781 commit 3febcd5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Projects/App/Sources/MainTab/MainTabFeatureView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ private extension MainTabView {
}
.padding(.horizontal, 28)
.onTapGesture {
UIImpactFeedbackGenerator(style: .rigid).impactOccurred()
UIImpactFeedbackGenerator(style: .light)
.impactOccurred()
store.send(.binding(.set(\.selectedTab, tab)))
}
}
Expand Down
16 changes: 16 additions & 0 deletions Projects/DSKit/Sources/Components/PokitLinkPopup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public struct PokitLinkPopup: View {
}
second += 1
}
.onAppear(perform: feedback)
}

private var popup: some View {
Expand Down Expand Up @@ -103,6 +104,21 @@ public struct PokitLinkPopup: View {
}
}

private func feedback() {
switch type {
case .link, .text, .warning:
UINotificationFeedbackGenerator()
.notificationOccurred(.warning)
case .success:
UINotificationFeedbackGenerator()
.notificationOccurred(.success)
case .error:
UINotificationFeedbackGenerator()
.notificationOccurred(.error)
case .none: break
}
}

private var backgroundColor: Color {
switch type {
case .link, .text:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Created by 김도형 on 11/17/24.

import Foundation
import SwiftUI

import ComposableArchitecture
import Domain
Expand Down Expand Up @@ -118,6 +118,8 @@ private extension ContentCardFeature {
guard let isFavorite = state.content.isFavorite else {
return .none
}
UIImpactFeedbackGenerator(style: .light)
.impactOccurred()
return isFavorite
? .send(.async(.즐겨찾기_취소_API))
: .send(.async(.즐겨찾기_API))
Expand Down

0 comments on commit 3febcd5

Please sign in to comment.