Skip to content

Commit

Permalink
Merge pull request #7371 from woocommerce/xcode-14-workarounds
Browse files Browse the repository at this point in the history
Make the app compatible with Xcode 14
  • Loading branch information
crazytonyli authored Sep 14, 2022
2 parents 9f3a741 + 0405e14 commit 92915ef
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ common_params:
repo: "woocommerce/woocommerce-ios/"
# Common environment values to use with the `env` key.
- &common_env
IMAGE_ID: xcode-13.4.1
IMAGE_ID: xcode-14

# This is the default pipeline – it will build and test the app
steps:
Expand Down Expand Up @@ -68,7 +68,7 @@ steps:
# UI Tests
#################
- label: "🔬 UI Tests (iPhone)"
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 11'
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 14'
depends_on: "build"
env: *common_env
plugins: *common_plugins
Expand Down
9 changes: 9 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,14 @@ post_install do |installer|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'ALPHA=1']
end
end

# Fix a code signing issue in Xcode 14 beta.
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270
# ====================================
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY'] = ''
end
end
# rubocop:enable Style/CombinableLoops
end
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,6 @@ SPEC CHECKSUMS:
ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba

PODFILE CHECKSUM: 0b413ca49ed0793630b6cffce7d1dabbaf0d2886
PODFILE CHECKSUM: 3e746ecbe69d5cf22e0377beba8d803003558dd6

COCOAPODS: 1.11.2
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@ final class HubMenuViewController: UIHostingController<HubMenu> {
func showPaymentsMenu() {
show(InPersonPaymentsMenuViewController(), sender: self)
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

// We want to hide navigation bar *only* on HubMenu screen. But on iOS 16, the `navigationBarHidden(true)`
// modifier on `HubMenu` view hides the navigation bar for the whole navigation stack.
// Here we manually hide or show navigation bar when entering or leaving the HubMenu screen.
if #available(iOS 16.0, *) {
self.navigationController?.setNavigationBarHidden(true, animated: animated)
}
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)

if #available(iOS 16.0, *) {
self.navigationController?.setNavigationBarHidden(false, animated: animated)
}
}
}

private extension HubMenuViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ struct ShippingLineDetails: View {
symbol: nil,
keyboardType: .default)
.accessibilityIdentifier("add-shipping-name-field")
.onTapGesture {
focusAmountInput = false
}
}
.padding(.horizontal, insets: safeAreaInsets)
.addingTopAndBottomDividers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,11 @@ final class StoreStatsPeriodViewModelTests: XCTestCase {
viewModel.selectedIntervalIndex = 0

// Then
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"])
if #available(iOS 16.0, *) {
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3 at 1:00 AM"])
} else {
XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"])
}
}

func test_timeRangeBarViewModel_for_thisWeek_is_emitted_twice_after_order_and_visitor_stats_updated_and_selecting_interval() {
Expand Down

0 comments on commit 92915ef

Please sign in to comment.