From 011878432382000612e8b8568ca62c3e5ec19d2d Mon Sep 17 00:00:00 2001 From: rrbox <87851278+rrbox@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:28:29 +0900 Subject: [PATCH] =?UTF-8?q?[update]=20SKLabelNode,=20SKShapeNode=20?= =?UTF-8?q?=E3=81=AE=E3=82=B5=E3=83=96=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E3=81=97=E3=81=A6=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88?= =?UTF-8?q?.=20SKSpriteNode=20=E5=90=8C=E6=A7=98=E3=81=AB,=20=E3=82=B5?= =?UTF-8?q?=E3=83=96=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=AB=E5=AF=BE=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=82=82=20extension=20=E3=81=8C=E9=81=A9=E7=94=A8?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/SKNodeBuilder/LabelBuilder.swift | 2 +- Sources/SKNodeBuilder/ShapeBuilder.swift | 2 +- Tests/SKNodeBuilderTests/SubclassTests.swift | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Sources/SKNodeBuilder/LabelBuilder.swift b/Sources/SKNodeBuilder/LabelBuilder.swift index ffaf6e0..70eaf64 100644 --- a/Sources/SKNodeBuilder/LabelBuilder.swift +++ b/Sources/SKNodeBuilder/LabelBuilder.swift @@ -25,7 +25,7 @@ public extension LabelBuilder { } -public extension BuilderProtocol where Body == SKLabelNode { +public extension BuilderProtocol where Body: SKLabelNode { @discardableResult func text(_ value: String?) -> Self { self.node.text = value diff --git a/Sources/SKNodeBuilder/ShapeBuilder.swift b/Sources/SKNodeBuilder/ShapeBuilder.swift index 92e5d2e..727ef1d 100644 --- a/Sources/SKNodeBuilder/ShapeBuilder.swift +++ b/Sources/SKNodeBuilder/ShapeBuilder.swift @@ -57,7 +57,7 @@ public extension ShapeBuilder { } -public extension BuilderProtocol where Body == SKShapeNode { +public extension BuilderProtocol where Body: SKShapeNode { func path(_ value: CGPath) -> Self { self.node.path = value diff --git a/Tests/SKNodeBuilderTests/SubclassTests.swift b/Tests/SKNodeBuilderTests/SubclassTests.swift index 963129d..eae33f2 100644 --- a/Tests/SKNodeBuilderTests/SubclassTests.swift +++ b/Tests/SKNodeBuilderTests/SubclassTests.swift @@ -23,8 +23,14 @@ class ShapeNode: SKShapeNode { final class SubclassTests: XCTestCase { func testSubclass() { - let builder = Builder() + _ = Builder() .size(CGSize(width: 32, height: 32)) + + _ = Builder() + .fillColor(.red) + + _ = Builder() + .text("test") } - + }