From 600856f3c84bc9b42fa748062fb40e1e9071c7f7 Mon Sep 17 00:00:00 2001 From: Nathan Tannar Date: Mon, 2 Dec 2024 10:12:19 -0800 Subject: [PATCH] 1.9.2 --- Example/Example.xcodeproj/project.pbxproj | 7 +++++++ Example/Example/ViewStyleExamples.swift | 6 ++++++ Sources/EngineMacros/StyledView.swift | 8 ++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 143b570..cd25092 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 38ECF3472926D25400A7973C /* Engine in Frameworks */ = {isa = PBXBuildFile; productRef = 38ECF3462926D25400A7973C /* Engine */; }; 38ECF34F292848B200A7973C /* UserInterfaceIdiomExamples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38ECF34E292848B200A7973C /* UserInterfaceIdiomExamples.swift */; }; 38F3B4A92BA566F000374669 /* StyleContextExamples.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38F3B4A82BA566F000374669 /* StyleContextExamples.swift */; }; + 38F8DFAA2CFE2BB400705B02 /* EngineMacros in Frameworks */ = {isa = PBXBuildFile; productRef = 38F8DFA92CFE2BB400705B02 /* EngineMacros */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -44,6 +45,7 @@ buildActionMask = 2147483647; files = ( 38ECF3472926D25400A7973C /* Engine in Frameworks */, + 38F8DFAA2CFE2BB400705B02 /* EngineMacros in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -128,6 +130,7 @@ name = Example; packageProductDependencies = ( 38ECF3462926D25400A7973C /* Engine */, + 38F8DFA92CFE2BB400705B02 /* EngineMacros */, ); productName = Example; productReference = 385C289329209E5C00E0A600 /* Example.app */; @@ -431,6 +434,10 @@ isa = XCSwiftPackageProductDependency; productName = Engine; }; + 38F8DFA92CFE2BB400705B02 /* EngineMacros */ = { + isa = XCSwiftPackageProductDependency; + productName = EngineMacros; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 385C288B29209E5C00E0A600 /* Project object */; diff --git a/Example/Example/ViewStyleExamples.swift b/Example/Example/ViewStyleExamples.swift index 5b3e0ea..d2c921c 100644 --- a/Example/Example/ViewStyleExamples.swift +++ b/Example/Example/ViewStyleExamples.swift @@ -171,6 +171,12 @@ struct ViewStyleExamples: View { Text("@ViewStyle") .font(.headline) + _LabeledView { + Text("Content") + } content: { + Text("Label") + } + _LabeledView { Text("Content") } content: { diff --git a/Sources/EngineMacros/StyledView.swift b/Sources/EngineMacros/StyledView.swift index bdc4355..70ff384 100644 --- a/Sources/EngineMacros/StyledView.swift +++ b/Sources/EngineMacros/StyledView.swift @@ -98,20 +98,20 @@ public macro StyledView() = #externalMacro(module: "EngineMacrosCore", type: "St /// A protocol intended to be used with the ``@StyledView`` macro define a /// ``ViewStyle`` and all it's related components. @MainActor @preconcurrency -public protocol StyledView: PrimitiveView, DynamicProperty { +public protocol StyledView: View, DynamicProperty { associatedtype _Body: View @ViewBuilder @MainActor @preconcurrency var _body: _Body { get } } extension StyledView { - public static func makeView( + public static func _makeView( view: _GraphValue, inputs: _ViewInputs ) -> _ViewOutputs { _Body._makeView(view: view[\._body], inputs: inputs) } - public static func makeViewList( + public static func _makeViewList( view: _GraphValue, inputs: _ViewListInputs ) -> _ViewListOutputs { @@ -119,7 +119,7 @@ extension StyledView { } @available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) - public static func viewListCount( + public static func _viewListCount( inputs: _ViewListCountInputs ) -> Int? { _Body._viewListCount(inputs: inputs)