Skip to content

Commit 92915ef

Browse files
authored
Merge pull request #7371 from woocommerce/xcode-14-workarounds
Make the app compatible with Xcode 14
2 parents 9f3a741 + 0405e14 commit 92915ef

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

.buildkite/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ common_params:
88
repo: "woocommerce/woocommerce-ios/"
99
# Common environment values to use with the `env` key.
1010
- &common_env
11-
IMAGE_ID: xcode-13.4.1
11+
IMAGE_ID: xcode-14
1212

1313
# This is the default pipeline – it will build and test the app
1414
steps:
@@ -68,7 +68,7 @@ steps:
6868
# UI Tests
6969
#################
7070
- label: "🔬 UI Tests (iPhone)"
71-
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 11'
71+
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 14'
7272
depends_on: "build"
7373
env: *common_env
7474
plugins: *common_plugins

Podfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,5 +360,14 @@ post_install do |installer|
360360
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'ALPHA=1']
361361
end
362362
end
363+
364+
# Fix a code signing issue in Xcode 14 beta.
365+
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270
366+
# ====================================
367+
installer.pods_project.targets.each do |target|
368+
target.build_configurations.each do |config|
369+
config.build_settings['CODE_SIGN_IDENTITY'] = ''
370+
end
371+
end
363372
# rubocop:enable Style/CombinableLoops
364373
end

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,6 @@ SPEC CHECKSUMS:
179179
ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a
180180
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
181181

182-
PODFILE CHECKSUM: 0b413ca49ed0793630b6cffce7d1dabbaf0d2886
182+
PODFILE CHECKSUM: 3e746ecbe69d5cf22e0377beba8d803003558dd6
183183

184184
COCOAPODS: 1.11.2

WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewController.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ final class HubMenuViewController: UIHostingController<HubMenu> {
3131
func showPaymentsMenu() {
3232
show(InPersonPaymentsMenuViewController(), sender: self)
3333
}
34+
35+
override func viewWillAppear(_ animated: Bool) {
36+
super.viewWillAppear(animated)
37+
38+
// We want to hide navigation bar *only* on HubMenu screen. But on iOS 16, the `navigationBarHidden(true)`
39+
// modifier on `HubMenu` view hides the navigation bar for the whole navigation stack.
40+
// Here we manually hide or show navigation bar when entering or leaving the HubMenu screen.
41+
if #available(iOS 16.0, *) {
42+
self.navigationController?.setNavigationBarHidden(true, animated: animated)
43+
}
44+
}
45+
46+
override func viewWillDisappear(_ animated: Bool) {
47+
super.viewWillDisappear(animated)
48+
49+
if #available(iOS 16.0, *) {
50+
self.navigationController?.setNavigationBarHidden(false, animated: animated)
51+
}
52+
}
3453
}
3554

3655
private extension HubMenuViewController {

WooCommerce/Classes/ViewRelated/Orders/Order Creation/PaymentSection/ShippingLineDetails.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ struct ShippingLineDetails: View {
5252
symbol: nil,
5353
keyboardType: .default)
5454
.accessibilityIdentifier("add-shipping-name-field")
55+
.onTapGesture {
56+
focusAmountInput = false
57+
}
5558
}
5659
.padding(.horizontal, insets: safeAreaInsets)
5760
.addingTopAndBottomDividers()

WooCommerce/WooCommerceTests/ViewRelated/Dashboard/Stats V4/StoreStatsPeriodViewModelTests.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,11 @@ final class StoreStatsPeriodViewModelTests: XCTestCase {
341341
viewModel.selectedIntervalIndex = 0
342342

343343
// Then
344-
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"])
344+
if #available(iOS 16.0, *) {
345+
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3 at 1:00 AM"])
346+
} else {
347+
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"])
348+
}
345349
}
346350

347351
func test_timeRangeBarViewModel_for_thisWeek_is_emitted_twice_after_order_and_visitor_stats_updated_and_selecting_interval() {

0 commit comments

Comments
 (0)