Skip to content

Build for Catalyst #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2025
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
38 changes: 38 additions & 0 deletions .github/workflows/build-test-and-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,44 @@ jobs:
xcodebuild: true
xcodebuild-device-type: ${{ matrix.device-type }}

uikit-catalyst:
runs-on: macos-14
steps:
- name: Force Xcode 15.4
run: sudo xcode-select -switch /Applications/Xcode_15.4.app

- name: Swift version
run: swift --version

- name: Install xcbeautify
run: brew install xcbeautify

- uses: actions/checkout@v3

- name: Build
run: |
set -uxo pipefail
buildtarget () {
# Use the same derived data path as DocC compilation so that we don't duplicate work.
xcodebuild -derivedDataPath /tmp/data -skipMacroValidation -scheme "$1" -destination "variant=Mac Catalyst,arch=arm64,platform=macOS" build | xcbeautify --renderer github-actions
}

buildtarget SwiftCrossUI
buildtarget UIKitBackend

cd Examples

buildtarget CounterExample
buildtarget GreetingGeneratorExample
buildtarget NavigationExample
buildtarget StressTestExample
buildtarget NotesExample
buildtarget PathsExample
buildtarget ControlsExample
buildtarget RandomNumberGeneratorExample
# TODO test whether this works on Catalyst
# buildtarget SplitExample

windows:
runs-on: windows-latest
defaults:
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/UIKitBackend/UIKitBackend+Picker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final class UITableViewPicker: WrapperWidget<UITableView>, Picker, UITableViewDe
extension UIKitBackend {
public func createPicker() -> Widget {
#if targetEnvironment(macCatalyst)
if UIDevice.current.userInterfaceIdiom == .mac {
if #available(macCatalyst 14, *), UIDevice.current.userInterfaceIdiom == .mac {
return UITableViewPicker()
} else {
return UIPickerViewPicker()
Expand Down
Loading