diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index d70b59daa29..ba79fa8a780 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -11,6 +11,7 @@ - [***] Increased app's minimum deployment target to iOS17 [https://github.com/woocommerce/woocommerce-ios/pull/16003] - [*] Jetpack setup: Native experience for the connection step [https://github.com/woocommerce/woocommerce-ios/pull/15983] - [*] Payments: Updated the In-Person Payments `Learn More` redirection to display the correct page based on the selected payment provider [https://github.com/woocommerce/woocommerce-ios/pull/15998] +- [internal] Address deprecated view modifiers usage following iOS17 API updates [https://github.com/woocommerce/woocommerce-ios/pull/16002] - [*] Add "POS" label in Most recent orders in My store dashboard [https://github.com/woocommerce/woocommerce-ios/pull/16006] - [*] Order details: Always show shipping labels section if order is eligible for label creation. [https://github.com/woocommerce/woocommerce-ios/pull/16010] - [*] Order details: Remove print buttons from shipment details [https://github.com/woocommerce/woocommerce-ios/pull/16012] diff --git a/WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetup.swift b/WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetup.swift index f2b227e728b..01b9d95bd51 100644 --- a/WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetup.swift +++ b/WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetup.swift @@ -170,7 +170,7 @@ private struct AnimatedTransitionContainer: View { .onAppear { updateSize(to: proxy.size.height) } - .onChange(of: proxy.size) { newSize in + .onChange(of: proxy.size) { _, newSize in updateSize(to: newSize.height) } } @@ -182,7 +182,7 @@ private struct AnimatedTransitionContainer: View { .onAppear { hasAppeared = true } - .onChange(of: contentID) { newID in + .onChange(of: contentID) { _, newID in guard newID != previousID else { return } if hasAppeared { diff --git a/WooCommerce/Classes/POS/Presentation/CartView.swift b/WooCommerce/Classes/POS/Presentation/CartView.swift index 69470a80961..bfff4783e5c 100644 --- a/WooCommerce/Classes/POS/Presentation/CartView.swift +++ b/WooCommerce/Classes/POS/Presentation/CartView.swift @@ -301,11 +301,11 @@ private struct CartScrollViewContent: View { .onAppear { updateItemImageVisibility(cartListWidth: geometry.size.width) } - .onChange(of: geometry.size.width) { - updateItemImageVisibility(cartListWidth: $0) + .onChange(of: geometry.size.width) { _, newValue in + updateItemImageVisibility(cartListWidth: newValue) } - .onChange(of: dynamicTypeSize) { - updateItemImageVisibility(dynamicTypeSize: $0, cartListWidth: geometry.size.width) + .onChange(of: dynamicTypeSize) { _, newValue in + updateItemImageVisibility(dynamicTypeSize: newValue, cartListWidth: geometry.size.width) } }) .onPreferenceChange(ScrollOffSetPreferenceKey.self) { position in @@ -328,7 +328,7 @@ private struct CartScrollViewContent: View { scrollViewHeight = height } .coordinateSpace(name: Constants.scrollViewCoordinateSpaceIdentifier) - .onChange(of: posModel.cart.purchasableItems.first?.id) { itemToScrollTo in + .onChange(of: posModel.cart.purchasableItems.first?.id) { _, itemToScrollTo in if posModel.orderStage == .building { withAnimation { proxy.scrollTo(itemToScrollTo) @@ -428,7 +428,7 @@ private struct PurchasableItemsCartSection: View { .transition(.opacity) .accessibilityFocused($accessibilityFocusedItem, equals: cartItem.id) } - .onChange(of: posModel.cart.accessibilityFocusedItemID) { itemID in + .onChange(of: posModel.cart.accessibilityFocusedItemID) { _, itemID in if let itemID = itemID { Task { @MainActor in accessibilityFocusedItem = itemID diff --git a/WooCommerce/Classes/POS/Presentation/Infinite Scroll/InfiniteScrollView.swift b/WooCommerce/Classes/POS/Presentation/Infinite Scroll/InfiniteScrollView.swift index 3316ffd058d..c7c42cc924b 100644 --- a/WooCommerce/Classes/POS/Presentation/Infinite Scroll/InfiniteScrollView.swift +++ b/WooCommerce/Classes/POS/Presentation/Infinite Scroll/InfiniteScrollView.swift @@ -28,7 +28,7 @@ struct InfiniteScrollView: View { .background( GeometryReader { proxy in Color.clear - .onChange(of: proxy.frame(in: .named(Constants.scrollViewNamespace)).maxY) { maxY in + .onChange(of: proxy.frame(in: .named(Constants.scrollViewNamespace)).maxY) { _, maxY in let contentHeight = proxy.size.height let scrollPosition = contentHeight - maxY diff --git a/WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift b/WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift index 3a1fdf88c43..1c734428404 100644 --- a/WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift +++ b/WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift @@ -56,7 +56,7 @@ struct PointOfSaleCollectCashView: View { await submitCashAmount() } } - .onChange(of: textFieldViewModel.amount) { newValue in + .onChange(of: textFieldViewModel.amount) { _, newValue in textFieldAmountInput = newValue updateChangeDueMessage() } @@ -99,7 +99,7 @@ struct PointOfSaleCollectCashView: View { .frame(minHeight: geometry.size.height) .animation(.easeInOut, value: errorMessage) .animation(.easeInOut, value: changeDueMessage != nil) - .onChange(of: textFieldAmountInput) { _ in + .onChange(of: textFieldAmountInput) { errorMessage = nil } .onReceive(Publishers.keyboardFrame) { diff --git a/WooCommerce/Classes/POS/Presentation/Reusable Views/POSModalViewModifier.swift b/WooCommerce/Classes/POS/Presentation/Reusable Views/POSModalViewModifier.swift index a61e93ba06f..c4fc8b8b9c0 100644 --- a/WooCommerce/Classes/POS/Presentation/Reusable Views/POSModalViewModifier.swift +++ b/WooCommerce/Classes/POS/Presentation/Reusable Views/POSModalViewModifier.swift @@ -81,7 +81,7 @@ struct POSModalViewModifier: func body(content: Content) -> some View { content - .onChange(of: item) { newItem in + .onChange(of: item) { _, newItem in // Don't show a modal if a full screen overlay is presented on top guard !coverManager.isPresented else { return } @@ -111,7 +111,7 @@ struct POSModalViewModifierForBool: ViewModifier { func body(content: Content) -> some View { content - .onChange(of: isPresented) { newValue in + .onChange(of: isPresented) { _, newValue in // Don't show a modal if a full screen overlay is presented on top guard !coverManager.isPresented else { return } @@ -182,7 +182,7 @@ struct POSInteractiveDismissModifier: ViewModifier { func body(content: Content) -> some View { content - .onChange(of: disabled) { newValue in + .onChange(of: disabled) { _, newValue in modalManager.setInteractiveDismissal(!newValue) } .onAppear { diff --git a/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSendReceiptView.swift b/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSendReceiptView.swift index d4cd1918cd1..2b06fe75e1c 100644 --- a/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSendReceiptView.swift +++ b/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSendReceiptView.swift @@ -79,7 +79,7 @@ struct POSSendReceiptView: View { .padding(.bottom, keyboardFrame.height) } .animation(.easeInOut, value: errorMessage) - .onChange(of: textFieldInput) { _ in + .onChange(of: textFieldInput) { errorMessage = nil } .onReceive(Publishers.keyboardFrame) { diff --git a/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSheet.swift b/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSheet.swift index f0fcaa7a38b..adc39cd4124 100644 --- a/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSheet.swift +++ b/WooCommerce/Classes/POS/Presentation/Reusable Views/POSSheet.swift @@ -51,7 +51,7 @@ struct POSSheetViewModifier: ViewModifier { func body(content: Content) -> some View { content .sheet(isPresented: sheetIsPresented, onDismiss: onDismiss, content: sheetContent) - .onChange(of: isPresented) { newValue in + .onChange(of: isPresented) { _, newValue in if newValue { sheetManager.registerSheetPresented(id: sheetId) } else { @@ -83,7 +83,7 @@ struct POSSheetViewModifierForItem some View { content .sheet(item: sheetItem, onDismiss: onDismiss, content: sheetContent) - .onChange(of: sheetItem.wrappedValue) { newItem in + .onChange(of: sheetItem.wrappedValue) { _, newItem in let newValue = newItem != nil if newValue { sheetManager.registerSheetPresented(id: sheetId) diff --git a/WooCommerce/Classes/POS/Presentation/TotalsView.swift b/WooCommerce/Classes/POS/Presentation/TotalsView.swift index 51809590272..6183734ace0 100644 --- a/WooCommerce/Classes/POS/Presentation/TotalsView.swift +++ b/WooCommerce/Classes/POS/Presentation/TotalsView.swift @@ -78,7 +78,9 @@ struct TotalsView: View { .onAppear { isShowingTotalsFields = shouldShowTotalsFields } - .onChange(of: shouldShowTotalsFields, perform: hideTotalsFieldsWithDelay) + .onChange(of: shouldShowTotalsFields) { + hideTotalsFieldsWithDelay(shouldShowTotalsFields) + } .geometryGroup() } diff --git a/WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift b/WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift index fd263e06658..835d5dbeed9 100644 --- a/WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift +++ b/WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift @@ -97,7 +97,7 @@ struct POSIneligibleView: View { .onAppear { ServiceLocator.analytics.track(event: .PointOfSaleIneligibleUI.ineligibleUIShown(reason: reason)) } - .onChange(of: reason) { newReason in + .onChange(of: reason) { _, newReason in ServiceLocator.analytics.track(event: .PointOfSaleIneligibleUI.ineligibleUIShown(reason: newReason)) } } diff --git a/WooCommerce/Classes/View Modifiers/View+NoticesModifier.swift b/WooCommerce/Classes/View Modifiers/View+NoticesModifier.swift index b40e8b9fb0f..cba1d167975 100644 --- a/WooCommerce/Classes/View Modifiers/View+NoticesModifier.swift +++ b/WooCommerce/Classes/View Modifiers/View+NoticesModifier.swift @@ -120,7 +120,7 @@ struct NoticeModifier: ViewModifier { performClearNoticeTask() }) ) - .onChange(of: notice) { _ in + .onChange(of: notice) { provideHapticFeedbackIfNecessary(notice.feedbackType) dispatchClearNoticeTask() } diff --git a/WooCommerce/Classes/ViewRelated/Coupons/Add and Edit Coupons/CouponExpiryDateView.swift b/WooCommerce/Classes/ViewRelated/Coupons/Add and Edit Coupons/CouponExpiryDateView.swift index c39dbb6fa85..f991bff055e 100644 --- a/WooCommerce/Classes/ViewRelated/Coupons/Add and Edit Coupons/CouponExpiryDateView.swift +++ b/WooCommerce/Classes/ViewRelated/Coupons/Add and Edit Coupons/CouponExpiryDateView.swift @@ -18,7 +18,7 @@ struct CouponExpiryDateView: View { .environment(\.timeZone, timezone) .datePickerStyle(GraphicalDatePickerStyle()) .padding(.vertical, Constants.datePickerVerticalMargin) - .onChange(of: date) { _ in + .onChange(of: date) { isRemovalEnabled = true } VStack { diff --git a/WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldEditorView.swift b/WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldEditorView.swift index 14370f02b7f..ce473a5abda 100644 --- a/WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldEditorView.swift +++ b/WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldEditorView.swift @@ -62,7 +62,7 @@ struct CustomFieldEditorView: View { Text(Localization.editorPickerHTML).tag(true) } .pickerStyle(.segmented) - .onChange(of: showRichTextEditor) { newValue in + .onChange(of: showRichTextEditor) { _, newValue in viewModel.trackEditorPickerTapped(showRichTextEditor: newValue) } } diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/Tap to Pay Education/TapToPayEducationView.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/Tap to Pay Education/TapToPayEducationView.swift index 9e744120106..0423d14d464 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/Tap to Pay Education/TapToPayEducationView.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/Tap to Pay Education/TapToPayEducationView.swift @@ -58,7 +58,7 @@ struct TapToPayEducationView: View { } } .interactiveDismissDisabled(viewModel.isInteractiveDismissDisabled) - .onChange(of: viewModel.dismiss) { _ in + .onChange(of: viewModel.dismiss) { dismiss() } .onAppear { diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Help/SystemStatusReport/SystemStatusReportView.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Help/SystemStatusReport/SystemStatusReportView.swift index c204a61c7bd..0d9479fafd9 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Help/SystemStatusReport/SystemStatusReportView.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Help/SystemStatusReport/SystemStatusReportView.swift @@ -60,7 +60,7 @@ struct SystemStatusReportView: View { primaryButton: .default(Text(Localization.tryAgainButton), action: viewModel.fetchReport), secondaryButton: .default(Text(Localization.cancelButton), action: dismissAction)) } - .onChange(of: viewModel.errorFetchingReport) { newValue in + .onChange(of: viewModel.errorFetchingReport) { _, newValue in showingErrorAlert = newValue } .toolbar { diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/CustomAmounts/AddCustomAmountPercentageView.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/CustomAmounts/AddCustomAmountPercentageView.swift index 55789b2141d..09a516d97be 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/CustomAmounts/AddCustomAmountPercentageView.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/CustomAmounts/AddCustomAmountPercentageView.swift @@ -65,7 +65,9 @@ private extension AddCustomAmountPercentageView { text: $text, prompt: Text("0").foregroundColor(Color(.textSubtle)) ) - .onChange(of: text, perform: onChangeText) + .onChange(of: text) { + onChangeText(text) + } .focused() .focused($focusPercentageInput) .keyboardType(.decimalPad) diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/OrderForm.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/OrderForm.swift index 4ae3bfc7767..f2445a721a2 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/OrderForm.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/OrderForm.swift @@ -235,7 +235,7 @@ struct OrderForm: View { .onAppear { updateSelectionSyncApproach(for: presentationStyle) } - .onChange(of: horizontalSizeClass) { _ in + .onChange(of: horizontalSizeClass) { viewModel.saveInFlightOrderNotes() viewModel.saveInflightCustomerDetails() } diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/ProductsSection/DiscountLineDetailsView.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/ProductsSection/DiscountLineDetailsView.swift index 0708682ed24..a2a803af15b 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/ProductsSection/DiscountLineDetailsView.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/ProductsSection/DiscountLineDetailsView.swift @@ -64,7 +64,9 @@ private extension DiscountLineDetailsView { var body: some View { TextField(placeholder, text: $text) - .onChange(of: text, perform: onChangeText) + .onChange(of: text) { + onChangeText(text) + } .focused() .keyboardType(.numbersAndPunctuation) .frame(maxWidth: .infinity, minHeight: Layout.rowHeight) diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/FilterListSelector.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/FilterListSelector.swift index a9e9f48b2ac..3c3839efe6f 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/FilterListSelector.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/FilterListSelector.swift @@ -50,7 +50,7 @@ struct FilterListSelector: View { VStack(spacing: 0) { SearchHeader(text: $searchTerm, placeholder: viewModel.filterPlaceholder) .background(Color(.listForeground(modal: false))) - .onChange(of: searchTerm) { newValue in + .onChange(of: searchTerm) { _, newValue in viewModel.searchTerm = newValue } diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Receipts/ReceiptEmail/ReceiptEmailView.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Receipts/ReceiptEmail/ReceiptEmailView.swift index 3788b49a915..126d0bf9d2f 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Receipts/ReceiptEmail/ReceiptEmailView.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Receipts/ReceiptEmail/ReceiptEmailView.swift @@ -45,8 +45,8 @@ struct ReceiptEmailView: View { }) } } - .onChange(of: viewModel.state) { state in - if state == .success { + .onChange(of: viewModel.state) { _, newState in + if newState == .success { DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) { dismiss() } diff --git a/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductSelectorView.swift b/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductSelectorView.swift index b55681baa87..e2158be1849 100644 --- a/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductSelectorView.swift +++ b/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductSelectorView.swift @@ -169,9 +169,9 @@ struct ProductSelectorView: View { viewModel.onLoadTrigger.send() updateSyncApproach(for: horizontalSizeClass) } - .onChange(of: horizontalSizeClass, perform: { newSizeClass in + .onChange(of: horizontalSizeClass) { _, newSizeClass in updateSyncApproach(for: newSizeClass) - }) + } // On the order form, this is not connected; the OrderForm displays the notices. .notice($viewModel.notice, autoDismiss: false) .sheet(isPresented: $showingFilters) { @@ -319,7 +319,7 @@ private extension ProductSelectorView { .onAppear(perform: { adjustViewWidthIfNeeded(using: geometry.size.width) }) - .onChange(of: geometry.size.width) { newViewWidth in + .onChange(of: geometry.size.width) { _, newViewWidth in adjustViewWidthIfNeeded(using: newViewWidth) } } diff --git a/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductStepper.swift b/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductStepper.swift index c1581900a33..fc26f125e57 100644 --- a/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductStepper.swift +++ b/WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductStepper.swift @@ -49,7 +49,7 @@ struct ProductStepper: View { .multilineTextAlignment(.center) .fixedSize(horizontal: true, vertical: false) .focused($textFieldFocused) - .onChange(of: textFieldFocused) { newValue in + .onChange(of: textFieldFocused) { _, newValue in // We may have unsaved changes in the text field, if switching focus to another text field. if newValue == false { viewModel.resetEnteredQuantity() diff --git a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ExpandableBottomSheet.swift b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ExpandableBottomSheet.swift index 7366a6c5988..991f98b86cb 100644 --- a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ExpandableBottomSheet.swift +++ b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ExpandableBottomSheet.swift @@ -59,11 +59,11 @@ struct ExpandableBottomSheet: View wher } } .trackSize(size: $expandingContentSize) - .onChange(of: expandingContentSize, perform: { _ in + .onChange(of: expandingContentSize) { withAnimation { panelHeight = calculateHeight() } - }) + } } .scrollVerticallyIfNeeded() @@ -79,7 +79,7 @@ struct ExpandableBottomSheet: View wher // Always visible content alwaysVisibleContent() .trackSize(size: $fixedContentSize) - .onChange(of: fixedContentSize, perform: { [fixedContentSize] _ in + .onChange(of: fixedContentSize) { guard fixedContentSize.width > 0, fixedContentSize.height > 0 else { // No animation for initial load @@ -88,7 +88,7 @@ struct ExpandableBottomSheet: View wher withAnimation { panelHeight = calculateHeight() } - }) + } .contentShape(Rectangle()) .onTapGesture { withAnimation { @@ -104,8 +104,7 @@ struct ExpandableBottomSheet: View wher panelHeight = calculateHeight() } }) - .onChange(of: geometryProxy.size.height, - perform: { newValue in + .onChange(of: geometryProxy.size.height) { _, newValue in if !isDragging { DispatchQueue.main.async { withAnimation { @@ -113,16 +112,16 @@ struct ExpandableBottomSheet: View wher } } } - }) + } }) - .onChange(of: isExpanded, perform: { newValue in + .onChange(of: isExpanded) { _, newValue in onChangeOfExpansion?(newValue) DispatchQueue.main.async { withAnimation { panelHeight = calculateHeight() } } - }) + } .frame(maxWidth: .infinity, maxHeight: panelHeight, alignment: .bottom) .background(Color(.listForeground(modal: false)), ignoresSafeAreaEdges: .vertical) .cornerRadius(Layout.sheetCornerRadius) @@ -220,7 +219,7 @@ struct SizeTracker: ViewModifier { .onAppear { self.size = proxy.size } - .onChange(of: proxy.size) { newSize in + .onChange(of: proxy.size) { _, newSize in self.size = newSize } }) diff --git a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/FeedbackView.swift b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/FeedbackView.swift index 508ab25b62e..fd11b29f5c0 100644 --- a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/FeedbackView.swift +++ b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/FeedbackView.swift @@ -58,7 +58,7 @@ struct FeedbackView: View { configuration.backgroundColor .cornerRadius(Layout.cornerRadius) ) - .onChange(of: vote) { newValue in + .onChange(of: vote) { _, newValue in if let newValue { configuration.onVote(newValue) } diff --git a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ModalOverlay.swift b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ModalOverlay.swift index d625f96917b..443c974fbe7 100644 --- a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ModalOverlay.swift +++ b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/ModalOverlay.swift @@ -44,7 +44,7 @@ struct ModalOverlay: View { .animation(.easeInOut(duration: 0.25), value: internalIsPresented) } } - .onChange(of: isPresented) { newValue in + .onChange(of: isPresented) { _, newValue in withAnimation { internalIsPresented = newValue } diff --git a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/MultiSelectionList.swift b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/MultiSelectionList.swift index be9b6722d54..20c430d1db9 100644 --- a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/MultiSelectionList.swift +++ b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/MultiSelectionList.swift @@ -111,7 +111,7 @@ struct MultiSelectionList: View { } .listStyle(.grouped) } - .onChange(of: query) { value in + .onChange(of: query) { _, value in onQueryChanged?(value) } } diff --git a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/TitleAndTextFieldRow.swift b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/TitleAndTextFieldRow.swift index b2928bab9fa..cf932a8e814 100644 --- a/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/TitleAndTextFieldRow.swift +++ b/WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/TitleAndTextFieldRow.swift @@ -66,9 +66,9 @@ struct TitleAndTextFieldRow: View { HStack { TextField(placeholder, text: $text, onEditingChanged: onEditingChanged ?? { _ in }) .foregroundColor(contentColor) - .onChange(of: text, perform: { newValue in + .onChange(of: text) { _, newValue in text = formatText(newValue) - }) + } .onAppear { text = formatText(text) }