Skip to content

Commit

Permalink
Rename to compactMap
Browse files Browse the repository at this point in the history
  • Loading branch information
onmyway133 committed Apr 11, 2018
1 parent 5599123 commit 4bb2b76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Builder/Anchor+Builder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public extension Anchor {
/// Build a paging scrollView horizontally
func pagingHorizontally(togetherWith views: [View], in scrollView: UIScrollView) -> Builder.PagingHorizontally {
var array: [View] = []
array.append(contentsOf: [item as? View].flatMap({ $0 }))
array.append(contentsOf: [item as? View].compactMap({ $0 }))
array.append(contentsOf: views)
return Builder.PagingHorizontally(scrollView: scrollView, views: array)
}
Expand All @@ -33,15 +33,15 @@ public extension Anchor {
/// Add fixed spacing. The views will resize
func fixedSpacingHorizontally(togetherWith views: [View], spacing: CGFloat) -> Builder.FixedSpacingHorizontally {
var array: [View] = []
array.append(contentsOf: [item as? View].flatMap({ $0 }))
array.append(contentsOf: [item as? View].compactMap({ $0 }))
array.append(contentsOf: views)
return Builder.FixedSpacingHorizontally(views: array, spacing: spacing)
}

/// Add dynamic spacing using LayoutGuide. The spacing will resize
func dynamicSpacingHorizontally(togetherWith views: [View]) -> Builder.DynamicSpacingHorizontally {
var array: [View] = []
array.append(contentsOf: [item as? View].flatMap({ $0 }))
array.append(contentsOf: [item as? View].compactMap({ $0 }))
array.append(contentsOf: views)
return Builder.DynamicSpacingHorizontally(views: array)
}
Expand Down

0 comments on commit 4bb2b76

Please sign in to comment.