Skip to content

Commit

Permalink
Only compile iOS 14.5 availability check on Xcode 12.4
Browse files Browse the repository at this point in the history
Fix CI complaining about unknown types (ugh)
  • Loading branch information
ualch9 committed Jun 23, 2021
1 parent eb9917a commit b5b11ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions OBAKit/Controls/ListView/OBAListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ public class OBAListView: UICollectionView, UICollectionViewDelegate {

// #398 - list view separators always appears on iOS 14.4
// Necessary for CI compatibility. Remove check when CI is fixed.
// Also, remove availability checks in OBAListRowSeparatorConfiguration.swift.
//
// CI uses Xcode 12.4 (swift 5.3), which doesn't contain iOS 14.5 API,
// causing the code below to fail to compile.
// The block below builds on Xcode 12.5+ (swift 5.4).
#if swift(>=5.4)
if #available(iOS 14.5, *) {
configuration.separatorConfiguration = .init(listAppearance: .insetGrouped)
configuration.itemSeparatorHandler = { [unowned self] (indexPath, listConfiguration) -> UIListSeparatorConfiguration in
Expand All @@ -195,6 +201,7 @@ public class OBAListView: UICollectionView, UICollectionViewDelegate {
return configuration
}
}
#endif

configuration.leadingSwipeActionsConfigurationProvider = self.leadingSwipeActions
configuration.trailingSwipeActionsConfigurationProvider = self.trailingSwipeActions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public struct OBAListRowSeparatorConfiguration: Equatable {
}

// #398 - list view separators always appears on iOS 14.4
@available(swift 5.4)
@available(iOS 14.5, *)
extension UIListSeparatorConfiguration {
mutating func applying(_ obaConfiguration: OBAListRowSeparatorConfiguration) {
Expand Down

0 comments on commit b5b11ac

Please sign in to comment.