Skip to content

Commit 6ce4ab8

Browse files
authored
Merge branch 'master' into dependabot/bundler/rubyzip-1.3.0
2 parents 7b01852 + e3c1237 commit 6ce4ab8

File tree

19 files changed

+525
-69
lines changed

19 files changed

+525
-69
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ Carthage/Checkouts
2424
.buckversion
2525

2626
fastlane/report.xml
27-
fastlane/test_output
27+
fastlane/test_output
28+
29+
# SwiftPM
30+
swiftpm/

Example/FlexLayoutSample.xcodeproj/project.pbxproj

Lines changed: 238 additions & 3 deletions
Large diffs are not rendered by default.

FlexLayout.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Pod::Spec.new do |spec|
66
spec.homepage = "https://github.com/lucdion/FlexLayout.git"
77
spec.license = "MIT license"
88
spec.author = { "Luc Dion" => "luc_dion@yahoo.com" }
9-
9+
1010
spec.platform = :ios, "8.0"
1111
spec.source = { :git => "https://github.com/lucdion/FlexLayout.git", :tag => "#{spec.version}" }
1212
spec.source_files = "Sources/**/*.{swift,h,m,mm,cpp,c}"
13-
spec.public_header_files = "Sources/yoga/{Yoga,YGEnums,YGMacros}.h", "Sources/YogaKit/{UIView+Yoga,YGLayout}.h"
13+
spec.public_header_files = "Sources/yoga/include/yoga/*.h", "Sources/YogaKit/include/YogaKit/*.h"
1414
spec.libraries = 'c++'
1515

1616
# Should match yoga_defs.bzl + BUCK configuration

FlexLayout.xcodeproj/project.pbxproj

Lines changed: 117 additions & 59 deletions
Large diffs are not rendered by default.

Package.swift

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// swift-tools-version:5.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "FlexLayout",
8+
platforms: [
9+
.iOS(.v8)
10+
],
11+
products: [
12+
.library(name: "FlexLayout", targets: ["FlexLayout"]),
13+
.library(name: "FlexLayoutYoga", targets: ["FlexLayoutYoga"]),
14+
.library(name: "FlexLayoutYogaKit", targets: ["FlexLayoutYogaKit"])
15+
],
16+
dependencies: [
17+
],
18+
targets: [
19+
.target(
20+
name: "FlexLayout",
21+
dependencies: ["FlexLayoutYoga", "FlexLayoutYogaKit"],
22+
path: "Sources/Swift",
23+
cSettings: [
24+
.define("FLEXLAYOUT_SWIFT_PACKAGE")
25+
],
26+
cxxSettings: [
27+
.define("FLEXLAYOUT_SWIFT_PACKAGE"),
28+
.headerSearchPath("include/yoga/"),
29+
.headerSearchPath("./")
30+
],
31+
swiftSettings: [
32+
.define("FLEXLAYOUT_SWIFT_PACKAGE")
33+
]
34+
),
35+
.target(
36+
name: "FlexLayoutYoga",
37+
dependencies: [],
38+
path: "Sources/yoga",
39+
cSettings: [
40+
.define("FLEXLAYOUT_SWIFT_PACKAGE")
41+
],
42+
cxxSettings: [
43+
.define("FLEXLAYOUT_SWIFT_PACKAGE"),
44+
.headerSearchPath("include/yoga/"),
45+
.headerSearchPath("./")
46+
]
47+
),
48+
.target(
49+
name: "FlexLayoutYogaKit",
50+
dependencies: ["FlexLayoutYoga"],
51+
path: "Sources/YogaKit",
52+
cSettings: [
53+
.define("FLEXLAYOUT_SWIFT_PACKAGE")
54+
],
55+
cxxSettings: [
56+
.define("FLEXLAYOUT_SWIFT_PACKAGE"),
57+
.headerSearchPath("include/YogaKit/"),
58+
.headerSearchPath("./")
59+
]
60+
)
61+
],
62+
cLanguageStandard: .gnu99,
63+
cxxLanguageStandard: .gnucxx11
64+
)

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- FlexLayout (1.3.16)
2+
- FlexLayout (1.3.17)
33
- Nimble (8.0.1)
44
- PinLayout (1.8.7)
55
- Quick (2.1.0)
@@ -13,7 +13,7 @@ DEPENDENCIES:
1313
- SwiftLint
1414

1515
SPEC REPOS:
16-
https://github.com/cocoapods/specs.git:
16+
https://github.com/CocoaPods/Specs.git:
1717
- Nimble
1818
- PinLayout
1919
- Quick
@@ -24,12 +24,12 @@ EXTERNAL SOURCES:
2424
:path: "./"
2525

2626
SPEC CHECKSUMS:
27-
FlexLayout: 2c9f7724c5218eb2f23c734dc4343141815a1681
27+
FlexLayout: 2db7ebbdc5a6d5a6abfe3d1ca5f31bf7c7a362a5
2828
Nimble: 45f786ae66faa9a709624227fae502db55a8bdd0
2929
PinLayout: a0722a5c8f0e0168a9c091ffe4930dabf0c8582c
3030
Quick: 4be43f6634acfa727dd106bdf3929ce125ffa79d
3131
SwiftLint: fed9c66336e41fc74dc48a73678380718f0c8b0e
3232

3333
PODFILE CHECKSUM: 9c74b444ce1d9b0b90a0d90a353efb1f26fd93e2
3434

35-
COCOAPODS: 1.7.5
35+
COCOAPODS: 1.8.4

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,22 @@ github "layoutBox/FlexLayout"
11041104
3. Add built `FlexLayout.framework` in your Xcode project in the **Embedded Binaries** section.
11051105

11061106

1107+
### Swift Package Manager
1108+
1109+
#### Another Swift Package
1110+
1111+
To integrate FlexLayout into another Swift Package, add it as a dependency:
1112+
1113+
```
1114+
.package(url: "https://github.com/layoutBox/FlexLayout.git", from: "1.3.18")
1115+
```
1116+
1117+
#### In an Xcode target
1118+
1119+
1. To integrate FlexLayout into an Xcode target, use the `File -> Swift Packages -> Add Package Dependency` menu item.
1120+
2. Add "FLEXLAYOUT_SWIFT_PACKAGE=1" to the Xcode target's `GCC_PREPROCESSOR_DEFINITIONS` build setting.
1121+
1122+
11071123
<br/>
11081124

11091125
## Changelog
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// Created by Luc Dion on 2017-06-19.
1414

1515
import UIKit
16+
#if FLEXLAYOUT_SWIFT_PACKAGE
17+
import FlexLayoutYogaKit
18+
#endif
1619

1720
/**
1821
FlexLayout interface.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,64 @@
1414

1515
import UIKit
1616

17+
#if FLEXLAYOUT_SWIFT_PACKAGE
18+
import FlexLayoutYoga
19+
20+
extension YGFlexDirection {
21+
static let column = YGFlexDirectionColumn
22+
static let columnReverse = YGFlexDirectionColumnReverse
23+
static let row = YGFlexDirectionRow
24+
static let rowReverse = YGFlexDirectionRowReverse
25+
}
26+
27+
extension YGJustify {
28+
static let flexStart = YGJustifyFlexStart
29+
static let center = YGJustifyCenter
30+
static let flexEnd = YGJustifyFlexEnd
31+
static let spaceBetween = YGJustifySpaceBetween
32+
static let spaceAround = YGJustifySpaceAround
33+
static let spaceEvenly = YGJustifySpaceEvenly
34+
}
35+
36+
extension YGAlign {
37+
static let auto = YGAlignAuto
38+
static let baseline = YGAlignBaseline
39+
static let stretch = YGAlignStretch
40+
static let flexStart = YGAlignFlexStart
41+
static let center = YGAlignCenter
42+
static let flexEnd = YGAlignFlexEnd
43+
static let spaceBetween = YGAlignSpaceBetween
44+
static let spaceAround = YGAlignSpaceAround
45+
}
46+
47+
extension YGWrap {
48+
static let noWrap = YGWrapNoWrap
49+
static let wrap = YGWrapWrap
50+
static let wrapReverse = YGWrapWrapReverse
51+
}
52+
53+
extension YGPositionType {
54+
static let relative = YGPositionTypeRelative
55+
static let absolute = YGPositionTypeAbsolute
56+
}
57+
58+
extension YGDirection {
59+
static let LTR = YGDirectionLTR
60+
static let RTL = YGDirectionRTL
61+
static let inherit = YGDirectionInherit
62+
}
63+
64+
extension YGDisplay {
65+
static let flex = YGDisplayFlex
66+
static let none = YGDisplayNone
67+
}
68+
69+
extension YGUnit {
70+
static let percent = YGUnitPercent
71+
static let point = YGUnitPoint
72+
}
73+
#endif
74+
1775
extension Flex.Direction {
1876
var yogaValue: YGFlexDirection {
1977
switch self {

Sources/Impl/FlexLayout+Private.swift renamed to Sources/Swift/Impl/FlexLayout+Private.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
//
88

99
import UIKit
10+
#if FLEXLAYOUT_SWIFT_PACKAGE
11+
import FlexLayoutYoga
12+
#endif
1013

1114
extension Flex {
1215
func valueOrUndefined(_ value: CGFloat?) -> YGValue {

0 commit comments

Comments
 (0)