Skip to content

Commit 5378ca9

Browse files
authored
Merge pull request #39 from mtj0928/swift6
Support Swift 6
2 parents 541e71d + 406e08d commit 5378ca9

16 files changed

+75
-59
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"originHash" : "03685eda65c15da75dbc8741acf2f1e3229945f0308344acd05d8ef6aba454d9",
3+
"pins" : [
4+
{
5+
"identity" : "splash",
6+
"kind" : "remoteSourceControl",
7+
"location" : "https://github.com/JohnSundell/Splash",
8+
"state" : {
9+
"revision" : "7f4df436eb78fe64fe2c32c58006e9949fa28ad8",
10+
"version" : "0.16.0"
11+
}
12+
},
13+
{
14+
"identity" : "swift-docc-plugin",
15+
"kind" : "remoteSourceControl",
16+
"location" : "https://github.com/apple/swift-docc-plugin",
17+
"state" : {
18+
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
19+
"version" : "1.3.0"
20+
}
21+
},
22+
{
23+
"identity" : "swift-docc-symbolkit",
24+
"kind" : "remoteSourceControl",
25+
"location" : "https://github.com/apple/swift-docc-symbolkit",
26+
"state" : {
27+
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
28+
"version" : "1.0.0"
29+
}
30+
},
31+
{
32+
"identity" : "swift-syntax",
33+
"kind" : "remoteSourceControl",
34+
"location" : "https://github.com/apple/swift-syntax.git",
35+
"state" : {
36+
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
37+
"version" : "509.1.1"
38+
}
39+
}
40+
],
41+
"version" : 3
42+
}

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/apple/swift-syntax.git",
3434
"state" : {
35-
"revision" : "67c5007099d9ffdd292f421f81f4efe5ee42963e",
36-
"version" : "509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-07-10-a"
35+
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
36+
"version" : "509.1.1"
3737
}
3838
}
3939
],

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
![Slides](https://user-images.githubusercontent.com/12427733/190956930-ea9ce4d0-0a19-4bb3-b43b-28dd2d73374a.png)
1212

1313
## Requirements
14-
- Xcode 15+
15-
- Swift 5.9
14+
- Swift 6.0
1615

1716
## Documents
1817
First, see the [Tutorial for SlideKit](https://mtj0928.github.io/SlideKit/tutorials/meet-slidekit).

SlideKitDemo-iOS/SlideKitDemo-iOS.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
PRODUCT_BUNDLE_IDENTIFIER = "net.matsuji.SlideKitDemo-iOS";
319319
PRODUCT_NAME = "$(TARGET_NAME)";
320320
SWIFT_EMIT_LOC_STRINGS = YES;
321-
SWIFT_VERSION = 5.0;
321+
SWIFT_VERSION = 6.0;
322322
TARGETED_DEVICE_FAMILY = "1,2";
323323
};
324324
name = Debug;
@@ -347,7 +347,7 @@
347347
PRODUCT_BUNDLE_IDENTIFIER = "net.matsuji.SlideKitDemo-iOS";
348348
PRODUCT_NAME = "$(TARGET_NAME)";
349349
SWIFT_EMIT_LOC_STRINGS = YES;
350-
SWIFT_VERSION = 5.0;
350+
SWIFT_VERSION = 6.0;
351351
TARGETED_DEVICE_FAMILY = "1,2";
352352
};
353353
name = Release;

SlideKitDemo-macOS/SlideKitDemo-macOS.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
PRODUCT_BUNDLE_IDENTIFIER = "net.matsuji.SlideKitDemo-macOS";
317317
PRODUCT_NAME = "$(TARGET_NAME)";
318318
SWIFT_EMIT_LOC_STRINGS = YES;
319-
SWIFT_VERSION = 5.0;
319+
SWIFT_VERSION = 6.0;
320320
};
321321
name = Debug;
322322
};
@@ -345,7 +345,7 @@
345345
PRODUCT_BUNDLE_IDENTIFIER = "net.matsuji.SlideKitDemo-macOS";
346346
PRODUCT_NAME = "$(TARGET_NAME)";
347347
SWIFT_EMIT_LOC_STRINGS = YES;
348-
SWIFT_VERSION = 5.0;
348+
SWIFT_VERSION = 6.0;
349349
};
350350
name = Release;
351351
};

SlideKitDemo-macOS/SlideKitDemo-macOS/SlideConfiguration.swift

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
//
2-
// SlideConfiguration.swift
3-
//
4-
// Created by Junnosuke Matsumoto on 2022/08/26.
5-
//
6-
71
import SwiftUI
82
import SlideKit
93

4+
@MainActor
105
struct SlideConfiguration {
116

127
/// Edit the slide size.

Sources/SlideKit/EnvironmentValues/EnvironmentValues+ExternalDisplayManager.swift.swift

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// EnvironmentValues+ExternalDisplayManager.swift
3-
//
4-
//
5-
// Created by Junnosuke Matsumoto on 2022/08/24.
6-
//
7-
81
#if os(iOS)
92
import SwiftUI
103

Sources/SlideKit/EnvironmentValues/EnvironmentValues+ObservableObjectContainer.swift

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// EnvironmentValues+ObservableObjectContainer.swift
3-
//
4-
//
5-
// Created by Junnosuke Matsumoto on 2022/08/23.
6-
//
7-
81
import SwiftUI
92

103
public enum ObservableObjectContainerKey: EnvironmentKey {

Sources/SlideKit/ExternalDisplayManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SwiftUI
1010
import UIKit
1111

1212
@available(iOS 15.0, *)
13-
public class ExternalDisplayManager: ObservableObject {
13+
@MainActor public final class ExternalDisplayManager: ObservableObject {
1414

1515
@Published
1616
public private(set) var externalDisplayMode = ExternalDisplayMode.presentation

Sources/SlideKit/ObservableObjectContainer.swift

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
//
2-
// ObservableObjectContainer.swift
3-
//
4-
//
5-
// Created by Junnosuke Matsumoto on 2022/08/23.
6-
//
7-
81
import SwiftUI
92

10-
public class ObservableObjectContainer {
3+
@MainActor
4+
public final class ObservableObjectContainer: Sendable {
115

126
private var container: [ObjectKey: Any] = [:]
137

14-
public init() {}
8+
nonisolated public init() {}
159

1610
public func resolve<Object: ObservableObject>(_ factory: () -> Object) -> Object {
1711
let objectKey = ObjectKey(objectType: Object.self)

Sources/SlideKit/PhaseWrapper.swift

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Combine
99
import SwiftUI
1010

1111
@propertyWrapper
12+
@MainActor
1213
public struct PhaseWrapper<State: PhasedState>: DynamicProperty {
1314

1415
@Environment(\.slideIndexController)
@@ -42,6 +43,7 @@ public struct PhaseWrapper<State: PhasedState>: DynamicProperty {
4243
}
4344
}
4445

46+
@MainActor
4547
@propertyWrapper
4648
public struct SharedObject<Object: ObservableObject>: DynamicProperty {
4749

Sources/SlideKit/SlideComponents/HeaderSlide/HeaderSlideStyle.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ extension View {
2424
}
2525
}
2626

27-
public protocol HeaderSlideStyle {
27+
@MainActor
28+
public protocol HeaderSlideStyle: Sendable {
2829
associatedtype Body : View
2930

3031
@ViewBuilder func makeBody(configuration: Self.Configuration) -> Self.Body
@@ -33,7 +34,7 @@ public protocol HeaderSlideStyle {
3334
}
3435

3536
extension HeaderSlideStyle where Self == DefaultHeaderSlideStyle {
36-
public static var `default`: some HeaderSlideStyle {
37+
public nonisolated static var `default`: some HeaderSlideStyle {
3738
DefaultHeaderSlideStyle()
3839
}
3940
}
@@ -65,11 +66,11 @@ public struct HeaderSlideStyleConfiguration {
6566
public var content: HeaderSlideStyleConfiguration.Content
6667
}
6768

68-
struct AnyHeaderSlideStyle: HeaderSlideStyle {
69-
private let converter: (Configuration) -> AnyView
69+
struct AnyHeaderSlideStyle: HeaderSlideStyle, Sendable {
70+
private let converter: @MainActor (Configuration) -> AnyView
7071

71-
init(style: some HeaderSlideStyle) {
72-
converter = { configuration in
72+
nonisolated init(style: some HeaderSlideStyle) {
73+
converter = { @MainActor configuration in
7374
AnyView(style.makeBody(configuration: configuration))
7475
}
7576
}

Sources/SlideKit/SlideComponents/Index/SlideIndex.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ extension EnvironmentValues {
3131
}
3232
}
3333

34-
public protocol IndexStyle {
34+
@MainActor
35+
public protocol IndexStyle: Sendable {
3536
typealias Configuration = IndexConfiguration
3637
associatedtype Body : View
3738

Sources/SlideKit/SlideComponents/Item/ItemStyle.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
import SwiftUI
99

10-
public protocol ItemStyle {
10+
@MainActor
11+
public protocol ItemStyle: Sendable {
1112
associatedtype Body : View
1213

1314
@ViewBuilder func makeBody(configuration: Self.Configuration) -> Self.Body
@@ -53,10 +54,10 @@ public struct ItemConfiguration {
5354
}
5455
}
5556

56-
struct AnyItemStyle: ItemStyle {
57-
private let converter: (Configuration) -> AnyView
57+
struct AnyItemStyle: ItemStyle, Sendable {
58+
private let converter: @MainActor (Configuration) -> AnyView
5859

59-
init(style: some ItemStyle) {
60+
nonisolated init(style: some ItemStyle) {
6061
converter = { configuration in
6162
AnyView(style.makeBody(configuration: configuration))
6263
}
@@ -103,7 +104,7 @@ public struct DefaultItemStyle: ItemStyle {
103104
}
104105

105106
extension ItemStyle where Self == DefaultItemStyle {
106-
public static var `default`: DefaultItemStyle {
107+
public nonisolated static var `default`: DefaultItemStyle {
107108
DefaultItemStyle()
108109
}
109110
}

Sources/SlideKit/SlideIndexController.swift

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
//
2-
// SlideIndexController.swift
3-
//
4-
//
5-
// Created by Junnosuke Matsumoto on 2022/08/23.
6-
//
7-
81
import Foundation
92

10-
public class SlideIndexController: ObservableObject {
3+
/// A controller managing the current slide index.
4+
@MainActor
5+
public final class SlideIndexController: ObservableObject {
116

127
@Published
138
public private(set) var currentIndex: Int

0 commit comments

Comments
 (0)