Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

23.3
-----

- [internal] Address deprecated view modifiers usage following iOS17 API updates [https://github.com/woocommerce/woocommerce-ios/pull/16080]

23.2
-----
Expand All @@ -18,7 +18,6 @@
- [***] 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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ struct JetpackSetupView: View {
.renderedIf(viewModel.setupFailed)
})
.padding()
.onChange(of: viewModel.shouldPresentWebView) { shouldPresent in
.onChange(of: viewModel.shouldPresentWebView) { _, shouldPresent in
if shouldPresent {
webViewPresentationHandler()
}
Expand Down
8 changes: 4 additions & 4 deletions WooCommerce/Classes/View Modifiers/View+Measurements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension View {
.onAppear {
callback(proxy.size.height)
}
.onChange(of: proxy.size.height) { newHeight in
.onChange(of: proxy.size.height) { _, newHeight in
callback(newHeight)
}
}
Expand All @@ -32,7 +32,7 @@ extension View {
.onAppear {
callback(proxy.size.width)
}
.onChange(of: proxy.size.width) { newWidth in
.onChange(of: proxy.size.width) { _, newWidth in
callback(newWidth)
}
}
Expand All @@ -48,10 +48,10 @@ extension View {
.onAppear {
callback(proxy.frame(in: .global))
}
.onChange(of: proxy.size.height) { newHeight in
.onChange(of: proxy.size.height) { _, newHeight in
callback(proxy.frame(in: .global))
}
.onChange(of: proxy.frame(in: .global)) { newHeight in
.onChange(of: proxy.frame(in: .global)) { _, newHeight in
callback(proxy.frame(in: .global))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct AccountCreationForm: View {
}
.background(Color(uiColor: .systemBackground))
}
.onChange(of: viewModel.shouldTransitionToPasswordField) { shouldTransition in
.onChange(of: viewModel.shouldTransitionToPasswordField) { _, shouldTransition in
if shouldTransition {
withAnimation {
viewModel.transitionToPasswordField()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct BlazeAddParameterView: View {
.frame(width: Layout.keyWidth, alignment: .leading)
TextField(Localization.keyLabel, text: $viewModel.key)
}
.onChange(of: viewModel.key) { _ in
.onChange(of: viewModel.key) { _, _ in
viewModel.validateInputs()
}

Expand All @@ -31,7 +31,7 @@ struct BlazeAddParameterView: View {
.frame(width: Layout.keyWidth, alignment: .leading)
TextField(Localization.valueLabel, text: $viewModel.value)
}
.onChange(of: viewModel.value) { _ in
.onChange(of: viewModel.value) { _, _ in
viewModel.validateInputs()
}
} footer: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ struct BlazeCampaignCreationForm: View {
isShowingCampaignObjectivePicker = false
}
}
.onChange(of: viewModel.error) { newValue in
.onChange(of: viewModel.error) { _, newValue in
isShowingAISuggestionsErrorAlert = newValue == .failedToLoadAISuggestions
}
.alert(Localization.AISuggestionsErrorAlert.fetchingAISuggestions, isPresented: $isShowingAISuggestionsErrorAlert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ struct WooAddCustomPackageView: View {
.padding(.horizontal)
.frame(minHeight: geometry.size.height)
.frame(width: geometry.size.width)
.onChange(of: viewModel.showSaveTemplate) { newValue in
.onChange(of: viewModel.showSaveTemplate) { _, newValue in
packageTemplateNameFieldFocused = newValue
}
.onChange(of: packageTemplateNameFieldFocused) { focused in
.onChange(of: packageTemplateNameFieldFocused) { _, focused in
if focused {
// More info about why small delay is added:
// - https://github.com/woocommerce/woocommerce-ios/pull/14086#discussion_r1806036901
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct WooShippingEditAddressView: View {
}
}
.padding()
.onChange(of: focusedField) { newField in
.onChange(of: focusedField) { _, newField in
if let previousFocusedField {
viewModel.validate(previousFocusedField)
}
Expand Down Expand Up @@ -262,7 +262,7 @@ struct WooShippingEditAddressView: View {
TextField(Localization.title(for: field.type), text: $field.value, prompt: Text(field.required ? "" : Localization.optional))
.keyboardType(keyboardType)
.focused($focused, equals: field.type)
.onChange(of: field.value) { _ in
.onChange(of: field.value) {
field.clearError()
}
.padding()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct ProductDetailPreviewView: View {
.onDisappear {
viewModel.onViewDisappear()
}
.onChange(of: viewModel.errorState) { newValue in
.onChange(of: viewModel.errorState) { _, newValue in
isShowingErrorAlert = newValue != .none
}
.alert(viewModel.errorState.errorMessage, isPresented: $isShowingErrorAlert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ private extension ProductCreationAIStartingInfoView {
.padding(insets: Layout.messageContentInsets)
.focused($editorIsFocused)
// Scrolls to the "TextField" view with a smooth animation while typing.
.onChange(of: viewModel.features) { _ in
.onChange(of: viewModel.features) { _, _ in
scrollToTextField(using: proxy)
}
// Scrolls to the "TextField" view with a smooth animation when the editor is focused in a small screen.
.onChange(of: editorIsFocused) { isFocused in
.onChange(of: editorIsFocused) { _, isFocused in
if isFocused {
scrollToTextField(using: proxy)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ struct ProductCreationAIPromptProgressBar: View {
.onAppear(perform: {
viewModel.updateText(to: text)
})
.onChange(of: text, perform: { newText in
.onChange(of: text) { _, newText in
viewModel.updateText(to: newText)
})
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ struct FormattableAmountTextField: View {
ZStack(alignment: .center) {
// Hidden input text field
TextField("", text: $viewModel.textFieldAmountText)
.onChange(of: viewModel.textFieldAmountText, perform: viewModel.updateAmount)
.onChange(of: viewModel.textFieldAmountText) { _, newValue in
viewModel.updateAmount(newValue)
}
.focused()
.focused($focusAmountInput)
.keyboardType(viewModel.allowNegativeNumber ? .numbersAndPunctuation : .decimalPad)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ struct TopTabView<Content: View>: View {
scrollFocusTab(in: scrollViewProxy, at: index)
}
}
.onChange(of: geometry.size) { newSize in
.onChange(of: geometry.size) { _, newSize in
/// Support dynamic type size change
if index < tabWidths.count {
tabWidths[index] = newSize.width
Expand All @@ -194,11 +194,11 @@ struct TopTabView<Content: View>: View {
.offset(x: underlineOffset),
alignment: .bottomLeading
)
.onChange(of: selectedTab, perform: { newSelectedTab in
.onChange(of: selectedTab) { _, newSelectedTab in
withAnimation {
selectTab(in: scrollViewProxy, at: newSelectedTab)
}
})
}
.coordinateSpace(name: Constants.tabsHorizontalStackNameSpace)
}
.padding(.horizontal, tabsContainerHorizontalPadding)
Expand Down Expand Up @@ -235,7 +235,7 @@ struct TopTabView<Content: View>: View {
.onAppear {
contentSize = contentGeometry.size
}
.onChange(of: contentGeometry.size) { newSize in
.onChange(of: contentGeometry.size) { _, newSize in
contentSize = newSize
}
})
Expand Down