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
Patch
  • Loading branch information
muukii committed Nov 12, 2024
commit c65da74fc993faa070262c788ce0b43451297bbf
4 changes: 2 additions & 2 deletions Sources/SwiftUIHosting/SwiftUIHostingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ open class SwiftUIHostingView<Content: View>: UIView {
_ function: StaticString = #function,
_ line: UInt = #line,
configuration: SwiftUIHostingConfiguration = .init(),
@ViewBuilder content: () -> Content
@ViewBuilder content: @MainActor () -> Content
) {

self.configuration = configuration
Expand Down Expand Up @@ -180,7 +180,7 @@ open class AnySwiftUIHostingView: SwiftUIHostingView<AnyView> {
_ function: StaticString = #function,
_ line: UInt = #line,
configuration: SwiftUIHostingConfiguration = .init(),
@ViewBuilder content: () -> AnyViewContent
@ViewBuilder content: @MainActor () -> AnyViewContent
) {
super.init(
name,
Expand Down
6 changes: 3 additions & 3 deletions Sources/SwiftUIHosting/SwiftUIHostingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ open class SwiftUIHostingViewController<Content: View>: UIViewController {
_ function: StaticString = #function,
_ line: UInt = #line,
configuration: SwiftUIHostingConfiguration = .init(),
@ViewBuilder content: @escaping (Self) -> Content
@ViewBuilder content: @escaping @MainActor (UIViewController) -> Content
) {

self.configuration = configuration
self.content = { content(unsafeDowncast($0, to: Self.self)) }
self.content = content

self.name = name
self.file = file
Expand Down Expand Up @@ -72,7 +72,7 @@ open class AnySwiftUIHostingViewController: SwiftUIHostingViewController<AnyView
_ function: StaticString = #function,
_ line: UInt = #line,
configuration: SwiftUIHostingConfiguration = .init(),
@ViewBuilder content: @escaping (UIViewController) -> AnyViewContent
@ViewBuilder content: @escaping @MainActor (UIViewController) -> AnyViewContent
) {
super.init(
name,
Expand Down