Skip to content

Commit bf2ccd4

Browse files
authored
Merge pull request #271 from OhKanghoon/task/update-yoga-3.2.1
Update yoga to 3.2.1
2 parents 772d8fc + 4aa4d19 commit bf2ccd4

File tree

12 files changed

+89
-39
lines changed

12 files changed

+89
-39
lines changed

Example/cocoapods/FlexLayoutSample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
249EFE361E64FAFE00165E39 = {
200200
isa = PBXGroup;
201201
children = (
202-
249EFE411E64FAFE00165E39 /* FlexLayoutSample */,
202+
249EFE411E64FAFE00165E39 /* ../FlexLayoutSample */,
203203
461884C59B72ACEAFC912B8A /* Frameworks */,
204204
85CAAE97812075333AF3E88F /* Pods */,
205205
249EFE401E64FAFE00165E39 /* Products */,
@@ -214,7 +214,7 @@
214214
name = Products;
215215
sourceTree = "<group>";
216216
};
217-
249EFE411E64FAFE00165E39 /* FlexLayoutSample */ = {
217+
249EFE411E64FAFE00165E39 /* ../FlexLayoutSample */ = {
218218
isa = PBXGroup;
219219
children = (
220220
2439CC671E66614D003326FB /* Supporting Files */,
@@ -664,7 +664,7 @@
664664
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
665665
GCC_INPUT_FILETYPE = automatic;
666666
INFOPLIST_FILE = "../FlexLayoutSample/Supporting Files/Info.plist";
667-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
667+
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
668668
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutSample;
669669
PRODUCT_NAME = "$(TARGET_NAME)";
670670
SWIFT_VERSION = 5.0;
@@ -678,7 +678,7 @@
678678
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
679679
GCC_INPUT_FILETYPE = automatic;
680680
INFOPLIST_FILE = "../FlexLayoutSample/Supporting Files/Info.plist";
681-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
681+
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
682682
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutSample;
683683
PRODUCT_NAME = "$(TARGET_NAME)";
684684
SWIFT_VERSION = 5.0;

FlexLayout.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Pod::Spec.new do |spec|
77
spec.license = "MIT license"
88
spec.author = { "Luc Dion" => "luc_dion@yahoo.com" }
99

10-
spec.platform = :ios, "14.0"
10+
spec.platform = :ios, "13.4"
1111
spec.source = { :git => "https://github.com/lucdion/FlexLayout.git", :tag => "#{spec.version}" }
1212
spec.source_files = "Sources/**/*.{swift,h,m,mm,cpp,c}"
1313
spec.public_header_files = "Sources/YogaKit/include/YogaKit/*.h"
@@ -24,5 +24,5 @@ Pod::Spec.new do |spec|
2424
'-fPIC'
2525
]
2626

27-
spec.dependency 'Yoga'
27+
spec.dependency 'Yoga', '3.2.1'
2828
end

FlexLayout.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@
594594
DYLIB_INSTALL_NAME_BASE = "@rpath";
595595
GENERATE_INFOPLIST_FILE = YES;
596596
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
597+
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
597598
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
598599
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayout;
599600
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -622,6 +623,7 @@
622623
DYLIB_INSTALL_NAME_BASE = "@rpath";
623624
GENERATE_INFOPLIST_FILE = YES;
624625
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
626+
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
625627
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
626628
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayout;
627629
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -640,6 +642,7 @@
640642
DEVELOPMENT_TEAM = F37Y9H9E46;
641643
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
642644
GENERATE_INFOPLIST_FILE = YES;
645+
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
643646
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
644647
OTHER_LDFLAGS = "$(inherited)";
645648
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutTests;
@@ -656,6 +659,7 @@
656659
DEVELOPMENT_TEAM = F37Y9H9E46;
657660
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
658661
GENERATE_INFOPLIST_FILE = YES;
662+
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
659663
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
660664
OTHER_LDFLAGS = "$(inherited)";
661665
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutTests;

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let package = Package(
1212
.library(name: "FlexLayout", targets: ["FlexLayout"]),
1313
],
1414
dependencies: [
15-
.package(url: "https://github.com/facebook/yoga.git", from: "3.1.0"),
15+
.package(url: "https://github.com/facebook/yoga.git", .upToNextMinor(from: "3.2.1")),
1616
],
1717
targets: [
1818
.target(

Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
source 'https://cdn.cocoapods.org/'
22
use_frameworks!
3-
platform :ios, '14.0'
3+
platform :ios, '13.4'
44

55
workspace 'FlexLayout.xcworkspace'
66

77
target 'FlexLayout' do
8-
pod 'Yoga', git: 'https://github.com/facebook/yoga.git', tag: 'v3.1.0'
8+
pod 'Yoga'
99
end
1010

1111
target 'FlexLayoutTests' do

Podfile.lock

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,32 @@
11
PODS:
2-
- FlexLayout (2.0.10):
3-
- Yoga
2+
- FlexLayout (2.1.0):
3+
- Yoga (= 3.2.1)
44
- PinLayout (1.10.5)
55
- SwiftLint (0.55.1)
6-
- Yoga (3.1.0)
6+
- Yoga (3.2.1)
77

88
DEPENDENCIES:
99
- FlexLayout (from `./`)
1010
- PinLayout
1111
- SwiftLint
12-
- Yoga (from `https://github.com/facebook/yoga.git`, tag `v3.1.0`)
12+
- Yoga
1313

1414
SPEC REPOS:
1515
trunk:
1616
- PinLayout
1717
- SwiftLint
18+
- Yoga
1819

1920
EXTERNAL SOURCES:
2021
FlexLayout:
2122
:path: "./"
22-
Yoga:
23-
:git: https://github.com/facebook/yoga.git
24-
:tag: v3.1.0
25-
26-
CHECKOUT OPTIONS:
27-
Yoga:
28-
:git: https://github.com/facebook/yoga.git
29-
:tag: v3.1.0
3023

3124
SPEC CHECKSUMS:
32-
FlexLayout: aaf305c1f3203be3d8694c3835773d1e7a912b72
25+
FlexLayout: 4832b2e2069002e7d3f48dffbb20cc773a1813be
3326
PinLayout: f6c2b63a5a5b24864064e1d15c67de41b4e74748
3427
SwiftLint: 3fe909719babe5537c552ee8181c0031392be933
35-
Yoga: 955c6d6390d5b00fb54d02151e67d69b3ac6f2d8
28+
Yoga: 636ce73bd247407928a7df089f3bc3675916b3ff
3629

37-
PODFILE CHECKSUM: 616cb577f11ab8498737680dedeed47c6fae4b64
30+
PODFILE CHECKSUM: de7bb13eccf1a1ff875980af83b7d4a0cba2ca59
3831

39-
COCOAPODS: 1.16.2
32+
COCOAPODS: 1.15.2

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,26 @@ FlexLayout automatically includes the UIView when:
722722

723723
Set the item display or not, with `none` value, the item will be hidden and not included in the layout.
724724

725+
Values:
726+
* **`flex`**: Default value. The item is displayed normally and included in the layout.
727+
* **`none`**: The item will be hidden and not included in the layout.
728+
* **`contents`**: The node is removed from the layout flow, while its children are preserved and hoisted. This allows higher-level UI frameworks to compose wrapper components (e.g., to handle events) without influencing the layout of child nodes.
729+
730+
<br>
731+
732+
### boxSizing
733+
- Applies to: `flex items`
734+
735+
**Method:**
736+
737+
* **`boxSizing(_: BoxSizing)`**
738+
739+
Set the box sizing mode for the item. This determines how the width and height of an element are calculated.
740+
741+
Values:
742+
* **`borderBox`**: Default value. With `borderBox`, the specified dimensions (width, height) include the content, padding, and border. This means the overall size of the element is as defined, with padding and border accounted for inside.
743+
* **`contentBox`**: With `contentBox`, the specified dimensions refer only to the content area. Padding and borders are added outside these dimensions, potentially increasing the total size of the element.
744+
725745
<br>
726746

727747
### markDirty()

Sources/Swift/FlexLayout.swift

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ public final class Flex {
891891

892892
/**
893893
Set all margins using UIEdgeInsets.
894-
This method is particularly useful to set all margins using iOS 11 `UIView.safeAreaInsets`.
894+
This method is particularly useful to set all margins using `UIView.safeAreaInsets`.
895895
*/
896896
@discardableResult
897897
public func margin(_ insets: UIEdgeInsets) -> Flex {
@@ -904,11 +904,8 @@ public final class Flex {
904904

905905
/**
906906
Set margins using NSDirectionalEdgeInsets.
907-
This method is particularly to set all margins using iOS 11 `UIView.directionalLayoutMargins`.
908-
909-
Available only on iOS 11 and higher.
907+
This method is particularly to set all margins using `UIView.directionalLayoutMargins`.
910908
*/
911-
@available(tvOS 11.0, iOS 11.0, *)
912909
@discardableResult
913910
public func margin(_ directionalInsets: NSDirectionalEdgeInsets) -> Flex {
914911
yoga.marginTop = YGValue(directionalInsets.top)
@@ -1124,7 +1121,7 @@ public final class Flex {
11241121

11251122
/**
11261123
Set paddings using UIEdgeInsets.
1127-
This method is particularly useful to set all paddings using iOS 11 `UIView.safeAreaInsets`.
1124+
This method is particularly useful to set all paddings using `UIView.safeAreaInsets`.
11281125
*/
11291126
@discardableResult
11301127
public func padding(_ insets: UIEdgeInsets) -> Flex {
@@ -1137,11 +1134,8 @@ public final class Flex {
11371134

11381135
/**
11391136
Set paddings using NSDirectionalEdgeInsets.
1140-
This method is particularly to set all paddings using iOS 11 `UIView.directionalLayoutMargins`.
1141-
1142-
Available only on iOS 11 and higher.
1137+
This method is particularly to set all paddings using `UIView.directionalLayoutMargins`.
11431138
*/
1144-
@available(tvOS 11.0, iOS 11.0, *)
11451139
@discardableResult
11461140
public func padding(_ directionalInsets: NSDirectionalEdgeInsets) -> Flex {
11471141
yoga.paddingTop = YGValue(directionalInsets.top)
@@ -1334,7 +1328,20 @@ public final class Flex {
13341328
yoga.display = value.yogaValue
13351329
return self
13361330
}
1337-
1331+
1332+
//
1333+
// MARK: Box Sizing
1334+
//
1335+
1336+
/**
1337+
Set the box sizing
1338+
*/
1339+
@discardableResult
1340+
public func boxSizing(_ value: BoxSizing) -> Flex {
1341+
yoga.boxSizing = value.yogaValue
1342+
return self
1343+
}
1344+
13381345
// MARK: Enums
13391346

13401347
/**
@@ -1472,8 +1479,22 @@ public final class Flex {
14721479
case flex
14731480
/// With this value, the item will be hidden and not be calculated
14741481
case none
1482+
/// With this value, the node is removed from the layout flow, while its children are preserved and hoisted.
1483+
/// This allows higher-level UI frameworks to compose wrapper components (e.g., to handle events)
1484+
/// without influencing the layout of child nodes.
1485+
case contents
14751486
}
1476-
1487+
1488+
public enum BoxSizing {
1489+
/// Default value.
1490+
/// With `borderBox`, the specified dimensions (e.g., width, height) include the content, padding, and border.
1491+
/// This means the overall size of the element is as defined, with padding and border accounted for inside.
1492+
case borderBox
1493+
/// With `contentBox`, the specified dimensions refer only to the content area.
1494+
/// Padding and borders are added outside these dimensions, potentially increasing the total size of the element.
1495+
case contentBox
1496+
}
1497+
14771498
/*public enum Overflow {
14781499
/// Items that overflow
14791500
case visible

Sources/Swift/Impl/FlexLayout+Enum.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ extension Flex.Display {
114114
switch self {
115115
case .flex: return YGDisplay.flex
116116
case .none: return YGDisplay.none
117+
case .contents: return YGDisplay.contents
118+
}
119+
}
120+
}
121+
122+
extension Flex.BoxSizing {
123+
var yogaValue: YGBoxSizing {
124+
switch self {
125+
case .borderBox: return YGBoxSizing.borderBox
126+
case .contentBox: return YGBoxSizing.contentBox
117127
}
118128
}
119129
}

0 commit comments

Comments
 (0)