Skip to content

Commit 563affc

Browse files
committed
fix: iOS 17부터 적용되는 onChange(of:)의 클로저 파라미터 수정
1 parent e932a00 commit 563affc

5 files changed

Lines changed: 5 additions & 7 deletions

File tree

DevLog/App/RootView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct RootView: View {
5050
} message: {
5151
Text(viewModel.state.alertMessage)
5252
}
53-
.onChange(of: viewModel.state.isFirstLaunch) { newValue in
53+
.onChange(of: viewModel.state.isFirstLaunch) { _, newValue in
5454
if newValue {
5555
viewModel.send(.setFirstLaunch(false))
5656
viewModel.send(.signOutAuto)

DevLog/UI/Common/Component/Toast.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private struct ToastOverlayView<Label: View>: View {
5151
)
5252
.offset(y: yOffset)
5353
.opacity(opacityValue)
54-
.onChange(of: isPresented) { newValue in
54+
.onChange(of: isPresented) { _, newValue in
5555
if newValue {
5656
resetForNewPresentation()
5757
presentAnimated()

DevLog/UI/Home/TodoEditorView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private struct TagEditor<Content: View>: View {
245245
sheetHeight += tagsHeight + (tagsHeight == 0 ? 0 : spacing)
246246
}
247247
}
248-
.onChange(of: tags) { newTags in
248+
.onChange(of: tags) { _, newTags in
249249
DispatchQueue.main.async {
250250
tagsHeight = geometry.size.height
251251
sheetHeight = fieldHeight + tagsHeight + (newTags.isEmpty ? 0 : spacing)

DevLog/UI/Profile/ProfileView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ struct ProfileView: View {
105105
.onAppear {
106106
viewModel.send(.onAppear)
107107
}
108-
.onChange(of: focusedOnStatusMessageTextField) { newValue in
108+
.onChange(of: focusedOnStatusMessageTextField) { _, newValue in
109109
withAnimation {
110110
viewModel.send(.updateStatusTextFieldFocus(newValue))
111111
}

DevLog/UI/Search/SearchView.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct SearchView: View {
4141
viewModel.send(.setSearching(true))
4242
}
4343
}
44-
.onChange(of: viewModel.state.isSearching) { isSearching in
44+
.onChange(of: viewModel.state.isSearching) { _, isSearching in
4545
if !isSearching {
4646
dismiss()
4747
}
@@ -54,8 +54,6 @@ struct SearchView: View {
5454
} message: {
5555
Text(viewModel.state.alertMessage)
5656
}
57-
// TODO: iOS 16에서 introspect 모듈을 사용하여 .searchable의 isPresented를 관리한다
58-
// .introspect(.searchField, on: iOS(.v16)) { searchBar in }
5957
}
6058
}
6159

0 commit comments

Comments
 (0)