From 8608c9281641a9bc02eedd21f91b38605ba9852b Mon Sep 17 00:00:00 2001 From: vvveiii Date: Thu, 13 Aug 2020 21:44:57 +0800 Subject: [PATCH] [YogaKit] support macOS. --- YogaKit.podspec | 2 +- YogaKit/Source/UIView+Yoga.h | 1 - YogaKit/Source/UIView+Yoga.m | 70 +- YogaKit/Source/YGLayout.h | 7 + YogaKit/Source/YGLayout.m | 28 + YogaKit/YogaKitSample/Podfile | 6 + YogaKit/YogaKitSample/Podfile.lock | 4 +- .../YogaKitOSXSample/AppDelegate.h | 15 + .../YogaKitOSXSample/AppDelegate.m | 27 + .../AppIcon.appiconset/Contents.json | 58 ++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/Main.storyboard | 717 ++++++++++++++++++ .../YogaKitSample/YogaKitOSXSample/Info.plist | 36 + .../YogaKitOSXSample/ViewController.h | 15 + .../YogaKitOSXSample/ViewController.m | 68 ++ .../YogaKitOSXSample.entitlements | 10 + .../YogaKitOSXSample/dummy.swift | 1 + YogaKit/YogaKitSample/YogaKitOSXSample/main.m | 16 + .../YogaKitSample.xcodeproj/project.pbxproj | 217 ++++++ .../ViewControllers/BasicViewController.swift | 3 - .../YogaKitSample/YogaKitSample.entitlements | 10 + .../YogaKitTVSample/ViewController.m | 4 - 22 files changed, 1289 insertions(+), 32 deletions(-) create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.h create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.m create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/Contents.json create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/Base.lproj/Main.storyboard create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/Info.plist create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.h create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.m create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/YogaKitOSXSample.entitlements create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/dummy.swift create mode 100644 YogaKit/YogaKitSample/YogaKitOSXSample/main.m create mode 100644 YogaKit/YogaKitSample/YogaKitSample/YogaKitSample.entitlements diff --git a/YogaKit.podspec b/YogaKit.podspec index 43dd3c01..22c51232 100644 --- a/YogaKit.podspec +++ b/YogaKit.podspec @@ -19,7 +19,7 @@ podspec = Pod::Spec.new do |spec| :tag => "1.18.0", } - spec.platforms = { :ios => "8.0", :tvos => "9.0" } + spec.platforms = { :ios => "8.0", :osx => "10.9", :tvos => "9.0" } spec.module_name = 'YogaKit' spec.dependency 'Yoga', '~> 1.14.1' # Fixes the bug related the xcode 11 not able to find swift related frameworks. diff --git a/YogaKit/Source/UIView+Yoga.h b/YogaKit/Source/UIView+Yoga.h index fb730c38..94d5fa72 100644 --- a/YogaKit/Source/UIView+Yoga.h +++ b/YogaKit/Source/UIView+Yoga.h @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -#import #import "YGLayout.h" NS_ASSUME_NONNULL_BEGIN diff --git a/YogaKit/Source/UIView+Yoga.m b/YogaKit/Source/UIView+Yoga.m index e6c16352..3efd2722 100644 --- a/YogaKit/Source/UIView+Yoga.m +++ b/YogaKit/Source/UIView+Yoga.m @@ -43,48 +43,76 @@ static void YogaSwizzleInstanceMethod(Class cls, SEL originalSelector, SEL swizz @implementation UIView (YogaKitAutoApplyLayout) + (void)load { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - YogaSwizzleInstanceMethod(self, @selector(initWithFrame:), @selector(_yoga_initWithFrame:)); - YogaSwizzleInstanceMethod(self, @selector(setFrame:), @selector(_yoga_setFrame:)); - YogaSwizzleInstanceMethod(self, @selector(setBounds:), @selector(_yoga_setBounds:)); - }); + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + YogaSwizzleInstanceMethod(self, @selector(initWithFrame:), @selector(_yoga_initWithFrame:)); + YogaSwizzleInstanceMethod(self, @selector(setFrame:), @selector(_yoga_setFrame:)); + YogaSwizzleInstanceMethod(self, @selector(setBounds:), @selector(_yoga_setBounds:)); +#if TARGET_OS_OSX + YogaSwizzleInstanceMethod(self, @selector(setFrameSize:), @selector(_yoga_setFrameSize:)); + YogaSwizzleInstanceMethod(self, @selector(setBoundsSize:), @selector(_yoga_setBoundsSize:)); +#endif + }); } - (CGSize)_yoga_boundsSize { - NSValue *value = (NSValue *)objc_getAssociatedObject(self, kYGBoundsSizeAssociatedKey); + NSValue *value = (NSValue *)objc_getAssociatedObject(self, kYGBoundsSizeAssociatedKey); - return value ? value.CGSizeValue : CGSizeMake(YGUndefined, YGUndefined); + return value ? +#if TARGET_OS_OSX + value.sizeValue +#else + value.CGSizeValue +#endif + : CGSizeMake(YGUndefined, YGUndefined); } - (void)set_yoga_boundsSize:(CGSize)size { - objc_setAssociatedObject(self, - kYGBoundsSizeAssociatedKey, - [NSValue valueWithCGSize:size], - OBJC_ASSOCIATION_RETAIN_NONATOMIC); + objc_setAssociatedObject(self, + kYGBoundsSizeAssociatedKey, +#if TARGET_OS_OSX + [NSValue valueWithSize:size] +#else + [NSValue valueWithCGSize:size] +#endif + , OBJC_ASSOCIATION_RETAIN_NONATOMIC); } - (instancetype)_yoga_initWithFrame:(CGRect)frame { - id _self = [self _yoga_initWithFrame:frame]; - if (_self) { - [self _yoga_applyLayout]; - } + id _self = [self _yoga_initWithFrame:frame]; + if (_self) { + [self _yoga_applyLayout]; + } - return _self; + return _self; } - (void)_yoga_setFrame:(CGRect)frame { - [self _yoga_setFrame:frame]; + [self _yoga_setFrame:frame]; - [self _yoga_applyLayout]; + [self _yoga_applyLayout]; } - (void)_yoga_setBounds:(CGRect)bounds { - [self _yoga_setBounds:bounds]; + [self _yoga_setBounds:bounds]; - [self _yoga_applyLayout]; + [self _yoga_applyLayout]; } +#if TARGET_OS_OSX +- (void)_yoga_setFrameSize:(NSSize)newSize { + [self _yoga_setFrameSize:newSize]; + + [self _yoga_applyLayout]; +} + +- (void)_yoga_setBoundsSize:(NSSize)newSize { + [self _yoga_setBoundsSize:newSize]; + + [self _yoga_applyLayout]; +} +#endif + - (void)_yoga_applyLayout { if (self.isYogaEnabled && self.yoga.isEnabled) { CGSize size = self.bounds.size; diff --git a/YogaKit/Source/YGLayout.h b/YogaKit/Source/YGLayout.h index 5a60f95e..2e13b024 100644 --- a/YogaKit/Source/YGLayout.h +++ b/YogaKit/Source/YGLayout.h @@ -5,7 +5,14 @@ * LICENSE file in the root directory of this source tree. */ +#import +#if TARGET_OS_OSX +#import +#define UIView NSView +#else #import +#endif + #import #import #import diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index fad988d5..0402152f 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -160,7 +160,11 @@ static CGFloat YGScaleFactor() { static CGFloat scale; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^() { +#if TARGET_OS_OSX + scale = [NSScreen mainScreen].backingScaleFactor; +#else scale = [UIScreen mainScreen].scale; +#endif }); return scale; @@ -388,10 +392,18 @@ static YGSize YGMeasureView( // // See https://github.com/facebook/yoga/issues/606 for more information. if (!view.yoga.isUIView || [view.subviews count] > 0) { +#if TARGET_OS_OSX + CGSize fittingSize = view.fittingSize; + sizeThatFits = (CGSize){ + .width = MIN(constrainedWidth, fittingSize.width), + .height = MIN(constrainedHeight, fittingSize.height) + }; +#else sizeThatFits = [view sizeThatFits:(CGSize){ .width = constrainedWidth, .height = constrainedHeight, }]; +#endif } return (YGSize){ @@ -513,12 +525,17 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) { topLeft.y + YGNodeLayoutGetHeight(node), }; +#if TARGET_OS_OSX + const CGPoint origin = preserveOrigin ? view.frame.origin : CGPointZero; +#else // use bounds/center and not frame if non-identity transform. const CGPoint origin = preserveOrigin ? (CGPoint) { .x = view.center.x - CGRectGetWidth(view.bounds) * 0.5, .y = view.center.y - CGRectGetHeight(view.bounds) * 0.5 } : CGPointZero; +#endif + CGRect frame = (CGRect){ .origin = { @@ -532,6 +549,16 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) { }, }; +#if TARGET_OS_OSX + if (!view.superview.isFlipped && view.superview.isYogaEnabled && view.superview.yoga.isEnabled) { + frame.origin.y = YGNodeLayoutGetHeight(view.superview.yoga.node) - CGRectGetMaxY(frame); + } + + view.frame = (CGRect) { + .origin = CGPointMake(YGRoundPixelValue(frame.origin.x), YGRoundPixelValue(frame.origin.y)), + .size = CGSizeMake(YGRoundPixelValue(frame.size.width), YGRoundPixelValue(frame.size.height)) + }; +#else view.bounds = (CGRect) { .origin = view.bounds.origin, .size = CGSizeMake(YGRoundPixelValue(CGRectGetWidth(frame)), YGRoundPixelValue(CGRectGetHeight(frame))) @@ -541,6 +568,7 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) { .x = YGRoundPixelValue(CGRectGetMinX(frame) + CGRectGetWidth(frame) * 0.5), .y = YGRoundPixelValue(CGRectGetMinY(frame) + CGRectGetHeight(frame) * 0.5) }; +#endif if (!yoga.isLeaf) { for (NSUInteger i = 0; i < view.subviews.count; i++) { diff --git a/YogaKit/YogaKitSample/Podfile b/YogaKit/YogaKitSample/Podfile index 5da19a24..86049996 100644 --- a/YogaKit/YogaKitSample/Podfile +++ b/YogaKit/YogaKitSample/Podfile @@ -18,4 +18,10 @@ target 'YogaKitTVSample' do platform :tvos, '9.0' pod 'Yoga', :path => '../../Yoga.podspec' pod 'YogaKit', :path => '../../YogaKit.podspec' +end + +target 'YogaKitOSXSample' do + platform :osx, '10.10' + pod 'Yoga', :path => '../../Yoga.podspec' + pod 'YogaKit', :path => '../../YogaKit.podspec' end \ No newline at end of file diff --git a/YogaKit/YogaKitSample/Podfile.lock b/YogaKit/YogaKitSample/Podfile.lock index dd3cbc0f..3fff787f 100644 --- a/YogaKit/YogaKitSample/Podfile.lock +++ b/YogaKit/YogaKitSample/Podfile.lock @@ -26,8 +26,8 @@ SPEC CHECKSUMS: IGListDiffKit: 665d6cf43ce726e676013db9c7d6c4294259b6b2 IGListKit: fd5a5d21935298f5849fa49d426843cff97b77c7 Yoga: d3d19e78d35f47f72da4bb51b1362311a3ab2a7c - YogaKit: 9876eab67794362a58e64dc9e7e24adadd374e75 + YogaKit: 30573590c8d1ecd5c3758efba7117ad9cb1c8508 -PODFILE CHECKSUM: 47eeddfbd971090a3aa5e26f13d982c79f3daf34 +PODFILE CHECKSUM: 74e6863ea92d9031f0d141ef224a84ab74846efa COCOAPODS: 1.9.3 diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.h b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.h new file mode 100644 index 00000000..510a4367 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.m b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.m new file mode 100644 index 00000000..432e97ca --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.m @@ -0,0 +1,27 @@ +// +// AppDelegate.m +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + + +@end diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/AppIcon.appiconset/Contents.json b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..3f00db43 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/Contents.json b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Base.lproj/Main.storyboard b/YogaKit/YogaKitSample/YogaKitOSXSample/Base.lproj/Main.storyboard new file mode 100644 index 00000000..bb2a5d88 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Info.plist b/YogaKit/YogaKitSample/YogaKitOSXSample/Info.plist new file mode 100644 index 00000000..78974b6a --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 facebook. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.h b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.h new file mode 100644 index 00000000..1f71695e --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.m b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.m new file mode 100644 index 00000000..3f9f685b --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.m @@ -0,0 +1,68 @@ +// +// ViewController.m +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import "ViewController.h" +@import YogaKit; + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + NSView *root = self.view; + root.wantsLayer = YES; + root.layer.backgroundColor = NSColor.whiteColor.CGColor; + [root configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignItems = YGAlignCenter; + layout.justifyContent = YGJustifyCenter; + }]; + + NSView *child1 = [[NSView alloc] init]; + child1.wantsLayer = YES; + child1.layer.backgroundColor = NSColor.blueColor.CGColor; + [child1 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.width = YGPointValue(100); + layout.height = YGPointValue(10); + layout.marginBottom = YGPointValue(25); + }]; + [root addSubview:child1]; + + NSView *child2 = [[NSView alloc] init]; + child2.wantsLayer = YES; + child2.layer.backgroundColor = NSColor.greenColor.CGColor; + [child2 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignSelf = YGAlignFlexEnd; + layout.width = YGPointValue(200); + layout.height = YGPointValue(200); + }]; + [root addSubview:child2]; + + NSView *child3 = [[NSView alloc] init]; + child3.wantsLayer = YES; + child3.layer.backgroundColor = NSColor.yellowColor.CGColor; + [child3 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignSelf = YGAlignFlexStart; + layout.width = YGPointValue(100); + layout.height = YGPointValue(100); + }]; + [root addSubview:child3]; +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/YogaKitOSXSample.entitlements b/YogaKit/YogaKitSample/YogaKitOSXSample/YogaKitOSXSample.entitlements new file mode 100644 index 00000000..f2ef3ae0 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/YogaKitOSXSample.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/dummy.swift b/YogaKit/YogaKitSample/YogaKitOSXSample/dummy.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/dummy.swift @@ -0,0 +1 @@ + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/main.m b/YogaKit/YogaKitSample/YogaKitOSXSample/main.m new file mode 100644 index 00000000..65e2f523 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/main.m @@ -0,0 +1,16 @@ +// +// main.m +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} diff --git a/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj b/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj index 383880d8..65cb68dd 100644 --- a/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj +++ b/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj @@ -12,6 +12,14 @@ 13687D871DF87D2400E7C260 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13687D861DF87D2400E7C260 /* Foundation.framework */; }; 151960FA24E5314C00F7BF06 /* YogaKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 151960F924E5314C00F7BF06 /* YogaKitTests.m */; }; 151960FC24E532B700F7BF06 /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151960FB24E532B700F7BF06 /* dummy.swift */; }; + 15865F3524E56F7800345BD7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F3424E56F7800345BD7 /* AppDelegate.m */; }; + 15865F3824E56F7800345BD7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F3724E56F7800345BD7 /* ViewController.m */; }; + 15865F3A24E56F7800345BD7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 15865F3924E56F7800345BD7 /* Assets.xcassets */; }; + 15865F3D24E56F7800345BD7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15865F3B24E56F7800345BD7 /* Main.storyboard */; }; + 15865F4024E56F7800345BD7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F3F24E56F7800345BD7 /* main.m */; }; + 15865F4624E5747800345BD7 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 15865F4524E5747800345BD7 /* libc++.tbd */; }; + 15865F4824E5748900345BD7 /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15865F4724E5748900345BD7 /* dummy.swift */; }; + 1593D6D3BEDCC3E520D136F4 /* Pods_YogaKitOSXSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C318BAE128876A3592EA4EE7 /* Pods_YogaKitOSXSample.framework */; }; 15A7CB5995C9DAB1C8803834 /* Pods_YogaKitSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */; }; 15E1C33C24E568410086A4E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E1C33B24E568410086A4E6 /* AppDelegate.m */; }; 15E1C33F24E568410086A4E6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E1C33E24E568410086A4E6 /* ViewController.m */; }; @@ -64,6 +72,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 130B3C3D7B95A7F1337972B2 /* Pods-YogaKitOSXSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitOSXSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitOSXSample/Pods-YogaKitOSXSample.release.xcconfig"; sourceTree = ""; }; 13687D431DF8748400E7C260 /* YogaKitSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YogaKitSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13687D521DF8748400E7C260 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 13687D571DF8748400E7C260 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -72,6 +81,19 @@ 151960EF24E530E700F7BF06 /* YogaKitSampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YogaKitSampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 151960F924E5314C00F7BF06 /* YogaKitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = YogaKitTests.m; path = ../../Tests/YogaKitTests.m; sourceTree = ""; }; 151960FB24E532B700F7BF06 /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = ""; }; + 15865F3124E56F7800345BD7 /* YogaKitOSXSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YogaKitOSXSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 15865F3324E56F7800345BD7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 15865F3424E56F7800345BD7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 15865F3624E56F7800345BD7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 15865F3724E56F7800345BD7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 15865F3924E56F7800345BD7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 15865F3C24E56F7800345BD7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 15865F3E24E56F7800345BD7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 15865F3F24E56F7800345BD7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 15865F4124E56F7800345BD7 /* YogaKitOSXSample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = YogaKitOSXSample.entitlements; sourceTree = ""; }; + 15865F4524E5747800345BD7 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libc++.tbd"; sourceTree = DEVELOPER_DIR; }; + 15865F4724E5748900345BD7 /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = ""; }; + 15865F4924E577BE00345BD7 /* YogaKitSample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = YogaKitSample.entitlements; sourceTree = ""; }; 15E1C33824E568410086A4E6 /* YogaKitTVSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YogaKitTVSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 15E1C33A24E568410086A4E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 15E1C33B24E568410086A4E6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -93,9 +115,11 @@ 51E1DF9045F526AA9E84841F /* Pods-YogaKitTVSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitTVSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitTVSample/Pods-YogaKitTVSample.release.xcconfig"; sourceTree = ""; }; 5D4F0C780E18ECECE25B2319 /* Pods-YogaKitTVSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitTVSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitTVSample/Pods-YogaKitTVSample.debug.xcconfig"; sourceTree = ""; }; 638A94471E1F06D100A726AD /* ExamplesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExamplesViewController.swift; sourceTree = ""; }; + 6D7F92331FB484D6ED42C5E9 /* Pods-YogaKitOSXSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitOSXSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitOSXSample/Pods-YogaKitOSXSample.debug.xcconfig"; sourceTree = ""; }; 82F0896A88112E957EF37C7F /* Pods-YogaKitSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample.release.xcconfig"; sourceTree = ""; }; 8925233409AB43504C102C31 /* Pods_YogaKitTVSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitTVSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A26128CF4F9CAE93983FF74F /* Pods-YogaKitSampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSampleTests/Pods-YogaKitSampleTests.debug.xcconfig"; sourceTree = ""; }; + C318BAE128876A3592EA4EE7 /* Pods_YogaKitOSXSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitOSXSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FF607399A6E2DE06593D1FA8 /* Pods-YogaKitSampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSampleTests/Pods-YogaKitSampleTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -119,6 +143,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 15865F2E24E56F7800345BD7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 15865F4624E5747800345BD7 /* libc++.tbd in Frameworks */, + 1593D6D3BEDCC3E520D136F4 /* Pods_YogaKitOSXSample.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 15E1C33524E568410086A4E6 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -137,6 +170,7 @@ 13687D451DF8748400E7C260 /* YogaKitSample */, 151960F024E530E700F7BF06 /* YogaKitSampleTests */, 15E1C33924E568410086A4E6 /* YogaKitTVSample */, + 15865F3224E56F7800345BD7 /* YogaKitOSXSample */, 13687D441DF8748400E7C260 /* Products */, 13687D831DF87D1E00E7C260 /* Frameworks */, E1C759E3C8E84821213ECE8D /* Pods */, @@ -149,6 +183,7 @@ 13687D431DF8748400E7C260 /* YogaKitSample.app */, 151960EF24E530E700F7BF06 /* YogaKitSampleTests.xctest */, 15E1C33824E568410086A4E6 /* YogaKitTVSample.app */, + 15865F3124E56F7800345BD7 /* YogaKitOSXSample.app */, ); name = Products; sourceTree = ""; @@ -156,6 +191,7 @@ 13687D451DF8748400E7C260 /* YogaKitSample */ = { isa = PBXGroup; children = ( + 15865F4924E577BE00345BD7 /* YogaKitSample.entitlements */, 40BD9F4E1E47902F002790A9 /* Views */, 40BD9F481E4784B3002790A9 /* ViewControllers */, 638A94471E1F06D100A726AD /* ExamplesViewController.swift */, @@ -170,11 +206,13 @@ isa = PBXGroup; children = ( 15E1C35024E56AB60086A4E6 /* libc++.tbd */, + 15865F4524E5747800345BD7 /* libc++.tbd */, 13687D861DF87D2400E7C260 /* Foundation.framework */, 13687D841DF87D1E00E7C260 /* UIKit.framework */, C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */, 4BB0C63590A97352D30E310E /* Pods_YogaKitSampleTests.framework */, 8925233409AB43504C102C31 /* Pods_YogaKitTVSample.framework */, + C318BAE128876A3592EA4EE7 /* Pods_YogaKitOSXSample.framework */, ); name = Frameworks; sourceTree = ""; @@ -188,6 +226,23 @@ path = YogaKitSampleTests; sourceTree = ""; }; + 15865F3224E56F7800345BD7 /* YogaKitOSXSample */ = { + isa = PBXGroup; + children = ( + 15865F3324E56F7800345BD7 /* AppDelegate.h */, + 15865F3424E56F7800345BD7 /* AppDelegate.m */, + 15865F3624E56F7800345BD7 /* ViewController.h */, + 15865F3724E56F7800345BD7 /* ViewController.m */, + 15865F3924E56F7800345BD7 /* Assets.xcassets */, + 15865F3B24E56F7800345BD7 /* Main.storyboard */, + 15865F3E24E56F7800345BD7 /* Info.plist */, + 15865F3F24E56F7800345BD7 /* main.m */, + 15865F4724E5748900345BD7 /* dummy.swift */, + 15865F4124E56F7800345BD7 /* YogaKitOSXSample.entitlements */, + ); + path = YogaKitOSXSample; + sourceTree = ""; + }; 15E1C33924E568410086A4E6 /* YogaKitTVSample */ = { isa = PBXGroup; children = ( @@ -231,6 +286,8 @@ FF607399A6E2DE06593D1FA8 /* Pods-YogaKitSampleTests.release.xcconfig */, 5D4F0C780E18ECECE25B2319 /* Pods-YogaKitTVSample.debug.xcconfig */, 51E1DF9045F526AA9E84841F /* Pods-YogaKitTVSample.release.xcconfig */, + 6D7F92331FB484D6ED42C5E9 /* Pods-YogaKitOSXSample.debug.xcconfig */, + 130B3C3D7B95A7F1337972B2 /* Pods-YogaKitOSXSample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -278,6 +335,24 @@ productReference = 151960EF24E530E700F7BF06 /* YogaKitSampleTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 15865F3024E56F7800345BD7 /* YogaKitOSXSample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 15865F4424E56F7800345BD7 /* Build configuration list for PBXNativeTarget "YogaKitOSXSample" */; + buildPhases = ( + 48411F57309F483CDA923BEA /* [CP] Check Pods Manifest.lock */, + 15865F2D24E56F7800345BD7 /* Sources */, + 15865F2E24E56F7800345BD7 /* Frameworks */, + 15865F2F24E56F7800345BD7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = YogaKitOSXSample; + productName = YogaKitOSXSample; + productReference = 15865F3124E56F7800345BD7 /* YogaKitOSXSample.app */; + productType = "com.apple.product-type.application"; + }; 15E1C33724E568410086A4E6 /* YogaKitTVSample */ = { isa = PBXNativeTarget; buildConfigurationList = 15E1C34D24E568420086A4E6 /* Build configuration list for PBXNativeTarget "YogaKitTVSample" */; @@ -307,6 +382,7 @@ TargetAttributes = { 13687D421DF8748300E7C260 = { CreatedOnToolsVersion = 8.1; + DevelopmentTeam = J29VN6AP39; LastSwiftMigration = 0820; ProvisioningStyle = Automatic; }; @@ -316,6 +392,11 @@ ProvisioningStyle = Automatic; TestTargetID = 13687D421DF8748300E7C260; }; + 15865F3024E56F7800345BD7 = { + CreatedOnToolsVersion = 11.6; + LastSwiftMigration = 1160; + ProvisioningStyle = Automatic; + }; 15E1C33724E568410086A4E6 = { CreatedOnToolsVersion = 11.6; LastSwiftMigration = 1160; @@ -340,6 +421,7 @@ 13687D421DF8748300E7C260 /* YogaKitSample */, 151960EE24E530E700F7BF06 /* YogaKitSampleTests */, 15E1C33724E568410086A4E6 /* YogaKitTVSample */, + 15865F3024E56F7800345BD7 /* YogaKitOSXSample */, ); }; /* End PBXProject section */ @@ -360,6 +442,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 15865F2F24E56F7800345BD7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 15865F3A24E56F7800345BD7 /* Assets.xcassets in Resources */, + 15865F3D24E56F7800345BD7 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 15E1C33624E568410086A4E6 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -373,6 +464,28 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 48411F57309F483CDA923BEA /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-YogaKitOSXSample-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 513B543F92B2E4F4D1EE1CE7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -479,6 +592,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 15865F2D24E56F7800345BD7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 15865F3824E56F7800345BD7 /* ViewController.m in Sources */, + 15865F4024E56F7800345BD7 /* main.m in Sources */, + 15865F4824E5748900345BD7 /* dummy.swift in Sources */, + 15865F3524E56F7800345BD7 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 15E1C33424E568410086A4E6 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -501,6 +625,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 15865F3B24E56F7800345BD7 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 15865F3C24E56F7800345BD7 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; 15E1C34024E568410086A4E6 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -616,14 +748,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = YogaKitSample/YogaKitSample.entitlements; + DEVELOPMENT_TEAM = J29VN6AP39; INFOPLIST_FILE = YogaKitSample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = YES; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -633,13 +769,17 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = YogaKitSample/YogaKitSample.entitlements; + DEVELOPMENT_TEAM = J29VN6AP39; INFOPLIST_FILE = YogaKitSample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = YES; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; @@ -707,6 +847,74 @@ }; name = Release; }; + 15865F4224E56F7800345BD7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6D7F92331FB484D6ED42C5E9 /* Pods-YogaKitOSXSample.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = YogaKitOSXSample/YogaKitOSXSample.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = YogaKitOSXSample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitOSXSample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 15865F4324E56F7800345BD7 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 130B3C3D7B95A7F1337972B2 /* Pods-YogaKitOSXSample.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = YogaKitOSXSample/YogaKitOSXSample.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = YogaKitOSXSample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitOSXSample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; 15E1C34B24E568420086A4E6 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D4F0C780E18ECECE25B2319 /* Pods-YogaKitTVSample.debug.xcconfig */; @@ -803,6 +1011,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 15865F4424E56F7800345BD7 /* Build configuration list for PBXNativeTarget "YogaKitOSXSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 15865F4224E56F7800345BD7 /* Debug */, + 15865F4324E56F7800345BD7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 15E1C34D24E568420086A4E6 /* Build configuration list for PBXNativeTarget "YogaKitTVSample" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift b/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift index 9637baef..cd170335 100644 --- a/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift +++ b/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift @@ -10,14 +10,11 @@ import YogaKit final class BasicViewController: UIViewController { override func viewDidLoad() { - let containerSize = self.view.bounds.size let root = self.view! root.backgroundColor = .white root.configureLayout { (layout) in layout.isEnabled = true - layout.width = YGValue(containerSize.width) - layout.height = YGValue(containerSize.height) layout.alignItems = .center layout.justifyContent = .center } diff --git a/YogaKit/YogaKitSample/YogaKitSample/YogaKitSample.entitlements b/YogaKit/YogaKitSample/YogaKitSample/YogaKitSample.entitlements new file mode 100644 index 00000000..ee95ab7e --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitSample/YogaKitSample.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.m b/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.m index 949fb7dc..ec5b6382 100644 --- a/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.m +++ b/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.m @@ -18,14 +18,10 @@ - (void)viewDidLoad { [super viewDidLoad]; - CGSize containerSize = self.view.bounds.size; - UIView *root = self.view; root.backgroundColor = UIColor.whiteColor; [root configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { layout.isEnabled = YES; - layout.width = YGPointValue(containerSize.width); - layout.height = YGPointValue(containerSize.height); layout.alignItems = YGAlignCenter; layout.justifyContent = YGJustifyCenter; }];