Skip to content

Commit

Permalink
[#84] toggle .onChange 액션 추가
Browse files Browse the repository at this point in the history
버전이슈 해결 필요
  • Loading branch information
CJiu01 committed Feb 7, 2025
1 parent 90e0ed7 commit e83f104
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ struct ItemModel: View {
.onChanged { _ in isPressed = true }
.onEnded { _ in
isPressed = false
action()
switch rightItem {
case .none:
action()
case .toggle(let isPushAuthorizationEnabled):
return
}
}
)

Expand All @@ -75,6 +80,12 @@ struct ItemModel: View {
.tint(YDSColor.buttonPoint)
.frame(height: 48)
// TODO: onChange 액션 추가
.onChange(of: isPushAuthorizationEnabled) {
action()
}
// .onReceive(isPushAuthorizationEnabled.projectedValue) { newValue in
// action()
// }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct SettingView: View {
),
action: {
// TODO: onChange 호출시 액션 전달
listItemTapped(.toggleAuthorization(isPushAuthorizationEnabled))
}
)
])
Expand Down

0 comments on commit e83f104

Please sign in to comment.