From 2e50059ad1b6049ec2df493e389c41438cec2b11 Mon Sep 17 00:00:00 2001 From: DingSoung <> Date: Fri, 10 Jul 2020 11:05:26 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0Playground=20?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Package.swift | 4 ++-- Playground.playground/Contents.swift | 26 +++++++++++++++++++++ Playground.playground/contents.xcplayground | 4 ++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Playground.playground/Contents.swift create mode 100644 Playground.playground/contents.xcplayground diff --git a/.gitignore b/.gitignore index bf158efc..eea230b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_STORE +*.xcodeproj /buck-cache/ /buck-out/ diff --git a/Package.swift b/Package.swift index 3aaa86be..11700f8f 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( products: [ .library( name: "YogaKit", - type: .static, + //type: .dynamic, targets: ["YogaKit"] ) ], @@ -22,7 +22,7 @@ let package = Package( .target( name: "YogaKit", path: "yoga", - exclude: [], + //exclude: [], sources: ["./"], publicHeadersPath: "include", cSettings: [ diff --git a/Playground.playground/Contents.swift b/Playground.playground/Contents.swift new file mode 100644 index 00000000..71440e08 --- /dev/null +++ b/Playground.playground/Contents.swift @@ -0,0 +1,26 @@ +//: A UIKit based Playground for presenting user interface + +import UIKit +import PlaygroundSupport +import YogaKit + +let globalConfig: YGConfigRef = YGConfigNew() +var node:YGNodeRef = YGNodeNewWithConfig(globalConfig) + + +class MyViewController : UIViewController { + override func loadView() { + let view = UIView() + view.backgroundColor = .white + + let label = UILabel() + label.frame = CGRect(x: 150, y: 200, width: 200, height: 20) + label.text = "Hello World!" + label.textColor = .black + + view.addSubview(label) + self.view = view + } +} +// Present the view controller in the Live View window +PlaygroundPage.current.liveView = MyViewController() diff --git a/Playground.playground/contents.xcplayground b/Playground.playground/contents.xcplayground new file mode 100644 index 00000000..3b151081 --- /dev/null +++ b/Playground.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file