Skip to content

Commit

Permalink
Merge pull request #6 from dafurman/concreteNamedViewConformance
Browse files Browse the repository at this point in the history
Make _ConcreteNamedView conform to NamedView
  • Loading branch information
dafurman authored May 8, 2024
2 parents d8fa37b + d5184db commit 393aaf3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Sources/AddPreviews/NamedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extension NamedView {
public var body: some View { AnyView(view) }
}

public struct _ConcreteNamedView {
public struct _ConcreteNamedView: NamedView {
public let name: String
public let view: any View

Expand Down
2 changes: 1 addition & 1 deletion Sources/AddPreviewsMacros/AddPreviewsMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension AddPreviews: ExtensionMacro {

private func iteratorNextDeclaration(viewProperties: [ViewProperty]) -> DeclSyntax {
var decl = """
mutating func next() -> NamedView? {
mutating func next() -> (any NamedView)? {
defer { iterator += 1 }
return switch iterator {
Expand Down
12 changes: 6 additions & 6 deletions Tests/AddPreviewsTests/AddPreviewsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class AddPreviewsTests: XCTestCase {
private var iterator = 0
mutating func next() -> NamedView? {
mutating func next() -> (any NamedView)? {
defer {
iterator += 1
}
Expand Down Expand Up @@ -116,7 +116,7 @@ final class AddPreviewsTests: XCTestCase {
private var iterator = 0
mutating func next() -> NamedView? {
mutating func next() -> (any NamedView)? {
defer {
iterator += 1
}
Expand Down Expand Up @@ -213,7 +213,7 @@ final class AddPreviewsTests: XCTestCase {
private var iterator = 0
mutating func next() -> NamedView? {
mutating func next() -> (any NamedView)? {
defer {
iterator += 1
}
Expand Down Expand Up @@ -375,7 +375,7 @@ final class AddPreviewsTests: XCTestCase {
private var iterator = 0
mutating func next() -> NamedView? {
mutating func next() -> (any NamedView)? {
defer {
iterator += 1
}
Expand Down Expand Up @@ -431,7 +431,7 @@ final class AddPreviewsTests: XCTestCase {
private var iterator = 0
mutating func next() -> NamedView? {
mutating func next() -> (any NamedView)? {
defer {
iterator += 1
}
Expand Down Expand Up @@ -487,7 +487,7 @@ final class AddPreviewsTests: XCTestCase {
private var iterator = 0
mutating func next() -> NamedView? {
mutating func next() -> (any NamedView)? {
defer {
iterator += 1
}
Expand Down

0 comments on commit 393aaf3

Please sign in to comment.