Implemented percentage values in YogaKit

Summary:
We still need to wait for the `YGUnitPoint` PR to be merged :) But please let me know what you think. One caveat: because of a limitation of Swift, a literal value can be automatically understood as a point-based `YGValue`, but variables have to be explicitly cast. I haven't found a way around it yet:

```
view.yoga.width = 10 // value == 10, unit == YGUnitPixel

let a: CGFloat = 100
view.yoga.height = a // Compiler error
view.yoga.height = YGValue(a) // works, not great
```
Closes https://github.com/facebook/yoga/pull/390

Reviewed By: emilsjolander

Differential Revision: D4954021

Pulled By: maxoll

fbshipit-source-id: 5eff6aeb6dd969d0d5dc557b149bb5819b0e31de
This commit is contained in:
David Hart
2017-04-28 10:32:02 -07:00
committed by Facebook Github Bot
parent 203577724e
commit 7b89a1dd48
10 changed files with 322 additions and 221 deletions

View File

@@ -19,7 +19,7 @@ podspec = Pod::Spec.new do |spec|
spec.ios.frameworks = 'UIKit'
spec.dependency 'Yoga', '~> 1.3'
spec.source_files = 'YogaKit/Source/*.{h,m}'
spec.source_files = 'YogaKit/Source/*.{h,m,swift}'
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
end