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
8 changes: 7 additions & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Swift
uses: SwiftyLab/setup-swift@latest

- name: Build
run: swift build -v

- name: Run tests
run: swift test -v
1 change: 1 addition & 0 deletions ExampleApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public struct ContentView: View {
}
}

@MainActor
private func pushScreenAction() {
router.navigate(to: .example("Hello World!"))
}
Expand Down
6 changes: 5 additions & 1 deletion ExampleApp/ExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public struct ExampleView: View {
@State private var sheetRoute: SheetRoute? = nil
private let title: String

@MainActor
public init(title: String) {
self.title = title
}
Expand All @@ -21,6 +22,7 @@ public struct ExampleView: View {
.sheet(item: $sheetRoute)
}

@MainActor
private func pushScreenAction() {
router.navigate(to: .lastExample)
}
Expand All @@ -39,7 +41,7 @@ public struct SheetExampleView: View {
}

public var body: some View {
if #available(iOS 17.0, *) {
if #available(iOS 17.0, macOS 14.0, *) {
VStack(spacing: 40) {
Button("Push Screen", action: pushScreenAction)

Expand Down Expand Up @@ -69,12 +71,14 @@ public struct AnotherExampleView: View {
public struct LastExampleView: View {
@Router private var router: [TestRoute] = []

@MainActor
public init() {}

public var body: some View {
Button("Navigate to Root", action: navigateToRootAction)
}

@MainActor
private func navigateToRootAction() {
router.navigateToRoot()
}
Expand Down
4 changes: 2 additions & 2 deletions ExampleApp/TestRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public enum SheetRoute: Routable {
}
}

extension SheetRoute: @preconcurrency Identifiable {
public var id: Self { self }
extension SheetRoute: Identifiable {
public nonisolated var id: Self { self }
}

public enum AnotherRoute: Routable {
Expand Down