Skip to content

Commit

Permalink
Bump to swift 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eonist committed Nov 19, 2024
1 parent e241094 commit 21d22b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// swift-tools-version:5.9
// swift-tools-version:6.0
import PackageDescription

let package = Package(
name: "PageControllerView",
platforms: [
.macOS(.v14) // macOS 14 and later
.macOS(.v15) // macOS 14 and later
],
products: [
.library(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extension PageControllerView.Coordinator {
* - identifier: page id
* - Returns: current page
*/
@MainActor // ⚠️️ Needed for Swift 6.0
public func pageController(_ pageController: NSPageController, viewControllerForIdentifier identifier: NSPageController.ObjectIdentifier) -> NSViewController {
// Swift.print("viewControllerForIdentifier \(identifier)")
let rootView: some View = AnyView( // Wraps the provided view in a type-erasing AnyView to allow for heterogeneous view types
Expand All @@ -99,6 +100,7 @@ extension PageControllerView.Coordinator {
* - Fixme: ⚠️️ We can add callback here to update `PageIndicator` (or use WillStartLiveTransition, if we want more instant UX etc)
* - Parameter pageController: The pagecontroller that the live transition ended in
*/
@MainActor // ⚠️️ Needed for Swift 6.0
public func pageControllerDidEndLiveTransition(_ pageController: NSPageController) {
pageController.completeTransition() // Hide the transition view used for animation and show the selectedViewController.view. Generally, this is called during pageControllerDidEndLiveTransition: in the delegate when the new contents of view is ready to be displayed.
parent.$currentPage.wrappedValue = pageController.selectedIndex // update binding
Expand Down

0 comments on commit 21d22b7

Please sign in to comment.