Skip to content

Commit 15e4a27

Browse files
committed
Merge branch 'trunk' into backlog/WOOMOB-1017-cash-payment-changes
# Conflicts: # WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift
2 parents 7c576c0 + 58c6ebd commit 15e4a27

File tree

27 files changed

+54
-48
lines changed

27 files changed

+54
-48
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [***] Increased app's minimum deployment target to iOS17 [https://github.com/woocommerce/woocommerce-ios/pull/16003]
1313
- [*] Jetpack setup: Native experience for the connection step [https://github.com/woocommerce/woocommerce-ios/pull/15983]
1414
- [*] 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]
15+
- [internal] Address deprecated view modifiers usage following iOS17 API updates [https://github.com/woocommerce/woocommerce-ios/pull/16002]
1516
- [*] Add "POS" label in Most recent orders in My store dashboard [https://github.com/woocommerce/woocommerce-ios/pull/16006]
1617
- [*] Order details: Always show shipping labels section if order is eligible for label creation. [https://github.com/woocommerce/woocommerce-ios/pull/16010]
1718
- [*] Order details: Remove print buttons from shipment details [https://github.com/woocommerce/woocommerce-ios/pull/16012]

WooCommerce/Classes/POS/Presentation/Barcode Scanner Setup/PointOfSaleBarcodeScannerSetup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private struct AnimatedTransitionContainer<Content: View, ID: Equatable>: View {
170170
.onAppear {
171171
updateSize(to: proxy.size.height)
172172
}
173-
.onChange(of: proxy.size) { newSize in
173+
.onChange(of: proxy.size) { _, newSize in
174174
updateSize(to: newSize.height)
175175
}
176176
}
@@ -182,7 +182,7 @@ private struct AnimatedTransitionContainer<Content: View, ID: Equatable>: View {
182182
.onAppear {
183183
hasAppeared = true
184184
}
185-
.onChange(of: contentID) { newID in
185+
.onChange(of: contentID) { _, newID in
186186
guard newID != previousID else { return }
187187

188188
if hasAppeared {

WooCommerce/Classes/POS/Presentation/CartView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ private struct CartScrollViewContent: View {
301301
.onAppear {
302302
updateItemImageVisibility(cartListWidth: geometry.size.width)
303303
}
304-
.onChange(of: geometry.size.width) {
305-
updateItemImageVisibility(cartListWidth: $0)
304+
.onChange(of: geometry.size.width) { _, newValue in
305+
updateItemImageVisibility(cartListWidth: newValue)
306306
}
307-
.onChange(of: dynamicTypeSize) {
308-
updateItemImageVisibility(dynamicTypeSize: $0, cartListWidth: geometry.size.width)
307+
.onChange(of: dynamicTypeSize) { _, newValue in
308+
updateItemImageVisibility(dynamicTypeSize: newValue, cartListWidth: geometry.size.width)
309309
}
310310
})
311311
.onPreferenceChange(ScrollOffSetPreferenceKey.self) { position in
@@ -328,7 +328,7 @@ private struct CartScrollViewContent: View {
328328
scrollViewHeight = height
329329
}
330330
.coordinateSpace(name: Constants.scrollViewCoordinateSpaceIdentifier)
331-
.onChange(of: posModel.cart.purchasableItems.first?.id) { itemToScrollTo in
331+
.onChange(of: posModel.cart.purchasableItems.first?.id) { _, itemToScrollTo in
332332
if posModel.orderStage == .building {
333333
withAnimation {
334334
proxy.scrollTo(itemToScrollTo)
@@ -428,7 +428,7 @@ private struct PurchasableItemsCartSection: View {
428428
.transition(.opacity)
429429
.accessibilityFocused($accessibilityFocusedItem, equals: cartItem.id)
430430
}
431-
.onChange(of: posModel.cart.accessibilityFocusedItemID) { itemID in
431+
.onChange(of: posModel.cart.accessibilityFocusedItemID) { _, itemID in
432432
if let itemID = itemID {
433433
Task { @MainActor in
434434
accessibilityFocusedItem = itemID

WooCommerce/Classes/POS/Presentation/Infinite Scroll/InfiniteScrollView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct InfiniteScrollView<Content: View>: View {
2828
.background(
2929
GeometryReader { proxy in
3030
Color.clear
31-
.onChange(of: proxy.frame(in: .named(Constants.scrollViewNamespace)).maxY) { maxY in
31+
.onChange(of: proxy.frame(in: .named(Constants.scrollViewNamespace)).maxY) { _, maxY in
3232
let contentHeight = proxy.size.height
3333
let scrollPosition = contentHeight - maxY
3434

WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ struct PointOfSaleCollectCashView: View {
105105
.frame(minHeight: geometry.size.height)
106106
.animation(.easeInOut, value: errorMessage)
107107
.animation(.easeInOut, value: changeDueMessage != nil)
108-
.onChange(of: textFieldAmountInput) { _, _ in
108+
.onChange(of: textFieldAmountInput) {
109109
errorMessage = nil
110110
}
111111
.onReceive(Publishers.keyboardFrame) {

WooCommerce/Classes/POS/Presentation/Reusable Views/POSModalViewModifier.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct POSModalViewModifier<Item: Identifiable & Equatable, ModalContent: View>:
8181

8282
func body(content: Content) -> some View {
8383
content
84-
.onChange(of: item) { newItem in
84+
.onChange(of: item) { _, newItem in
8585
// Don't show a modal if a full screen overlay is presented on top
8686
guard !coverManager.isPresented else { return }
8787

@@ -111,7 +111,7 @@ struct POSModalViewModifierForBool<ModalContent: View>: ViewModifier {
111111

112112
func body(content: Content) -> some View {
113113
content
114-
.onChange(of: isPresented) { newValue in
114+
.onChange(of: isPresented) { _, newValue in
115115
// Don't show a modal if a full screen overlay is presented on top
116116
guard !coverManager.isPresented else { return }
117117

@@ -182,7 +182,7 @@ struct POSInteractiveDismissModifier: ViewModifier {
182182

183183
func body(content: Content) -> some View {
184184
content
185-
.onChange(of: disabled) { newValue in
185+
.onChange(of: disabled) { _, newValue in
186186
modalManager.setInteractiveDismissal(!newValue)
187187
}
188188
.onAppear {

WooCommerce/Classes/POS/Presentation/Reusable Views/POSSendReceiptView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct POSSendReceiptView: View {
7979
.padding(.bottom, keyboardFrame.height)
8080
}
8181
.animation(.easeInOut, value: errorMessage)
82-
.onChange(of: textFieldInput) { _ in
82+
.onChange(of: textFieldInput) {
8383
errorMessage = nil
8484
}
8585
.onReceive(Publishers.keyboardFrame) {

WooCommerce/Classes/POS/Presentation/Reusable Views/POSSheet.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct POSSheetViewModifier<SheetContent: View>: ViewModifier {
5151
func body(content: Content) -> some View {
5252
content
5353
.sheet(isPresented: sheetIsPresented, onDismiss: onDismiss, content: sheetContent)
54-
.onChange(of: isPresented) { newValue in
54+
.onChange(of: isPresented) { _, newValue in
5555
if newValue {
5656
sheetManager.registerSheetPresented(id: sheetId)
5757
} else {
@@ -83,7 +83,7 @@ struct POSSheetViewModifierForItem<Item: Identifiable & Equatable, SheetContent:
8383
func body(content: Content) -> some View {
8484
content
8585
.sheet(item: sheetItem, onDismiss: onDismiss, content: sheetContent)
86-
.onChange(of: sheetItem.wrappedValue) { newItem in
86+
.onChange(of: sheetItem.wrappedValue) { _, newItem in
8787
let newValue = newItem != nil
8888
if newValue {
8989
sheetManager.registerSheetPresented(id: sheetId)

WooCommerce/Classes/POS/Presentation/TotalsView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ struct TotalsView: View {
7878
.onAppear {
7979
isShowingTotalsFields = shouldShowTotalsFields
8080
}
81-
.onChange(of: shouldShowTotalsFields, perform: hideTotalsFieldsWithDelay)
81+
.onChange(of: shouldShowTotalsFields) {
82+
hideTotalsFieldsWithDelay(shouldShowTotalsFields)
83+
}
8284
.geometryGroup()
8385
}
8486

WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct POSIneligibleView: View {
9797
.onAppear {
9898
ServiceLocator.analytics.track(event: .PointOfSaleIneligibleUI.ineligibleUIShown(reason: reason))
9999
}
100-
.onChange(of: reason) { newReason in
100+
.onChange(of: reason) { _, newReason in
101101
ServiceLocator.analytics.track(event: .PointOfSaleIneligibleUI.ineligibleUIShown(reason: newReason))
102102
}
103103
}

0 commit comments

Comments
 (0)