Skip to content

Commit

Permalink
Add ViewBuilder attributes to scenario initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1028 committed May 20, 2024
1 parent ddaf1ee commit 348bcad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 2 additions & 6 deletions Sources/Playbook/SwiftUISupport/ScenarioSwiftUI.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if canImport(SwiftUI) && canImport(Combine)

import SwiftUI

@available(iOS 13.0, *)
Expand All @@ -17,7 +15,7 @@ public extension Scenario {
layout: ScenarioLayout,
file: StaticString = #file,
line: UInt = #line,
content: @escaping (ScenarioContext) -> Content
@ViewBuilder content: @escaping (ScenarioContext) -> Content
) {
self.init(name, layout: layout, file: file, line: line) { context in
let content = content(context).transaction { transaction in
Expand All @@ -44,7 +42,7 @@ public extension Scenario {
layout: ScenarioLayout,
file: StaticString = #file,
line: UInt = #line,
content: @escaping () -> Content
@ViewBuilder content: @escaping () -> Content
) {
self.init(
name,
Expand All @@ -55,5 +53,3 @@ public extension Scenario {
)
}
}

#endif
4 changes: 0 additions & 4 deletions Tests/ScenarioSwiftUITests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if canImport(SwiftUI) && canImport(Combine)

import SwiftUI
import Playbook
import XCTest
Expand All @@ -21,5 +19,3 @@ final class ScenarioSwiftUITests: XCTestCase {
XCTAssertEqual(scenario.line, 10)
}
}

#endif

0 comments on commit 348bcad

Please sign in to comment.