Skip to content
Open
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
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.6
// swift-tools-version: 6.0

import PackageDescription

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftTUI/Debug/log.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public func log(_ item: Any, terminator: String = "\n") {
print(item, terminator: terminator, to: &logStream)
}

var logStream = LogStream()
nonisolated(unsafe) var logStream = LogStream()

struct LogStream: TextOutputStream {
func write(_ string: String) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftTUI/Drawing/Edges.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct Edges: OptionSet {
public struct Edges: OptionSet, Sendable {
public let rawValue: UInt8

public init(rawValue: UInt8) {
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftTUI/RunLoop/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
import AppKit
#endif

public class Application {
public class Application: @unchecked Sendable {
private let node: Node
private let window: Window
private let control: Control
Expand Down Expand Up @@ -51,7 +51,7 @@ public class Application {
#endif
}

public func start() {
@MainActor public func start() {
setInputMode()
updateWindowSize()
control.layout(size: window.layer.frame.size)
Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftTUI/Views/Modifiers/OnAppear.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Foundation

public extension View {
func onAppear(_ action: @escaping () -> Void) -> some View {
func onAppear(_ action: @escaping @Sendable () -> Void) -> some View {
return OnAppear(content: self, action: action)
}
}

private struct OnAppear<Content: View>: View, PrimitiveView, ModifierView {
let content: Content
let action: () -> Void
let action: @Sendable () -> Void

static var size: Int? { Content.size }

Expand All @@ -29,10 +29,10 @@ private struct OnAppear<Content: View>: View, PrimitiveView, ModifierView {
}

private class OnAppearControl: Control {
var action: () -> Void
var action: @Sendable () -> Void
var didAppear = false

init(action: @escaping () -> Void) {
init(action: @escaping @Sendable () -> Void) {
self.action = action
}

Expand Down
6 changes: 3 additions & 3 deletions Sources/SwiftTUI/Views/Stacks/Alignment.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import Foundation

public enum VerticalAlignment {
public enum VerticalAlignment: Sendable {
case top
case center
case bottom
}

public enum HorizontalAlignment {
public enum HorizontalAlignment: Sendable {
case leading
case center
case trailing
}

public struct Alignment {
public struct Alignment: Sendable {
public var horizontalAlignment: HorizontalAlignment
public var verticalAlignment: VerticalAlignment

Expand Down