Skip to content

Commit f150f76

Browse files
authored
Merge pull request #34 from maiyama18/fix/crash-on-viewcontroller-debug-item
Fix crash / runtime warning on ViewControllerDebugItem
2 parents e20a266 + 8212cd1 commit f150f76

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/DebugMenu/Plugin/DebugMenu/ViewControllerDebugItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ public struct ViewControllerDebugItem<T: UIViewController>: DebugItem {
99
public init(
1010
title: String? = nil,
1111
presentationMode: PresentationMode = .push,
12-
builder: @escaping ((T.Type) -> T) = { $0.init() }
12+
builder: @escaping @MainActor (T.Type) -> T = { $0.init() }
1313
) {
1414
debugItemTitle = title ?? String(describing: T.self)
1515
action = .didSelect { controller in
16-
let viewController = builder(T.self)
16+
let viewController = await builder(T.self)
1717
switch presentationMode {
1818
case .present:
1919
await controller.present(viewController, animated: true)

0 commit comments

Comments
 (0)