diff --git a/.gitignore b/.gitignore index c4a6bf0f..eea230b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .DS_STORE +*.xcodeproj + /buck-cache/ /buck-out/ /.buckconfig.local @@ -7,6 +9,8 @@ /gentest/test.html .buckversion +.build/ + # Jekyll /.sass-cache/ /_site/ diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..11700f8f --- /dev/null +++ b/Package.swift @@ -0,0 +1,38 @@ +// swift-tools-version:5.0 + +import PackageDescription + +let package = Package( + name: "YogaKit", + platforms: [ + .macOS(.v10_10), + .iOS(.v8), + .tvOS(.v9), + .watchOS(.v2) + ], + products: [ + .library( + name: "YogaKit", + //type: .dynamic, + targets: ["YogaKit"] + ) + ], + dependencies: [], + targets: [ + .target( + name: "YogaKit", + path: "yoga", + //exclude: [], + sources: ["./"], + publicHeadersPath: "include", + cSettings: [ + .headerSearchPath("./") + ] + ) + ], + swiftLanguageVersions: [ + .version("5") + ], + cLanguageStandard: .gnu11, + cxxLanguageStandard: .gnucxx14 +) 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 diff --git a/yoga/event/event.h b/yoga/event/event.h index 309dacb5..0ec2ce96 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include "../YGEnums.h" struct YGConfig; struct YGNode; diff --git a/yoga/include/public-header.h b/yoga/include/public-header.h new file mode 100644 index 00000000..f76b0ce2 --- /dev/null +++ b/yoga/include/public-header.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +@import Foundation; + +#include "../Yoga.h" +#include "../YGMacros.h" +#include "../YGValue.h" +#include "../YGEnums.h"