Skip to content

Commit e32beaf

Browse files
authored
Merge pull request #18 from iWECon/enhance
support [UIView] or [CALayer] in *StackView
2 parents f0c8000 + 21193d4 commit e32beaf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Sources/StackKit/StackKitResultBuilders.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ extension _StackKitViewContentResultBuilderProvider {
2424
public static func buildExpression<T>(_ expression: StackKitCompatible<T>) -> [T] where T: UIView {
2525
[expression.view]
2626
}
27+
public static func buildExpression(_ expression: [UIView]) -> [UIView] {
28+
expression
29+
}
2730
// parse `for ... in ...`
2831
public static func buildArray(_ components: [[UIView]]) -> [UIView] {
2932
components.flatMap({ $0 })
@@ -65,6 +68,9 @@ extension _StackKitLayerContentResultBuilder {
6568
public static func buildExpression(_ expression: Void) -> [CALayer] {
6669
[]
6770
}
71+
public static func buildExpression(_ expression: [CALayer]) -> [CALayer] {
72+
expression
73+
}
6874
// parse `for ... in ...`
6975
public static func buildArray(_ components: [[CALayer]]) -> [CALayer] {
7076
components.flatMap({ $0 })

0 commit comments

Comments
 (0)