Skip to content

Commit a059125

Browse files
committed
Add support catalyst
1 parent d8e6f33 commit a059125

8 files changed

+12
-12
lines changed

Example/Controllers/SideBarController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import UIKit
22

3-
@available(iOS 14, *)
3+
@available(iOS 14, macCatalyst 14, *)
44
class SidebarController: SPDiffableSideBarController {
55

66
override func viewDidLoad() {
@@ -63,7 +63,7 @@ class SidebarController: SPDiffableSideBarController {
6363
}
6464
}
6565

66-
@available(iOS 14, *)
66+
@available(iOS 14, macCatalyst 14, *)
6767
class SideBarSplitController: UISplitViewController {
6868

6969
init() {

Sources/SPDiffable/CellProvider/Models/SPDiffableSnapshot.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ public typealias SPDiffableSnapshot = NSDiffableDataSourceSnapshot<SPDiffableSec
3030
/**
3131
Wrapper of NSDiffableDataSourceSectionSnapshot with basic `SPDiffableItem`.
3232
*/
33-
@available(iOS 14, *)
33+
@available(iOS 14, macCatalyst 14, *)
3434
public typealias SPDiffableSectionSnapshot = NSDiffableDataSourceSectionSnapshot<SPDiffableItem>

Sources/SPDiffable/CellProvider/SPDiffableCollectionCellProviders.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public enum SPDiffableCollectionCellProviders {
66
Defaults cell provider, which can help you doing side bar faster.
77
You can do your providers and ise its with more flexible.
88
*/
9-
@available(iOS 14, *)
9+
@available(iOS 14, macCatalyst 14, *)
1010
public static var sideBar: SPDiffableCollectionCellProvider {
1111
let cellProvider: SPDiffableCollectionCellProvider = { (collectionView, indexPath, item) -> UICollectionViewCell? in
1212
let providers = [sideBarItem, sideBarButton, sideBarHeader]
@@ -20,7 +20,7 @@ public enum SPDiffableCollectionCellProviders {
2020
return cellProvider
2121
}
2222

23-
@available(iOS 14, *)
23+
@available(iOS 14, macCatalyst 14, *)
2424
public static var sideBarItem: SPDiffableCollectionCellProvider {
2525
let cellProvider: SPDiffableCollectionCellProvider = { (collectionView, indexPath, item) -> UICollectionViewCell? in
2626
guard let item = item as? SPDiffableSideBarItem else { return nil }
@@ -36,7 +36,7 @@ public enum SPDiffableCollectionCellProviders {
3636
return cellProvider
3737
}
3838

39-
@available(iOS 14, *)
39+
@available(iOS 14, macCatalyst 14, *)
4040
public static var sideBarButton: SPDiffableCollectionCellProvider {
4141
let cellProvider: SPDiffableCollectionCellProvider = { (collectionView, indexPath, item) -> UICollectionViewCell? in
4242
guard let item = item as? SPDiffableSideBarButton else { return nil }
@@ -49,7 +49,7 @@ public enum SPDiffableCollectionCellProviders {
4949
return cellProvider
5050
}
5151

52-
@available(iOS 14, *)
52+
@available(iOS 14, macCatalyst 14, *)
5353
public static var sideBarHeader: SPDiffableCollectionCellProvider {
5454
let cellProvider: SPDiffableCollectionCellProvider = { (collectionView, indexPath, item) -> UICollectionViewCell? in
5555
guard let item = item as? SPDiffableSideBarHeader else { return nil }

Sources/SPDiffable/Collection/Models/SPDiffableSideBarButton.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import UIKit
2626

2727
Colorful title usually.
2828
*/
29-
@available(iOS 14, *)
29+
@available(iOS 14, macCatalyst 14, *)
3030
open class SPDiffableSideBarButton: SPDiffableItem {
3131

3232
public let title: String

Sources/SPDiffable/Collection/Models/SPDiffableSideBarHeader.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import UIKit
2424
/**
2525
Header model for side bar item.
2626
*/
27-
@available(iOS 14, *)
27+
@available(iOS 14, macCatalyst 14, *)
2828
open class SPDiffableSideBarHeader: SPDiffableItem {
2929

3030
public var text: String

Sources/SPDiffable/Collection/Models/SPDiffableSideBarItem.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import UIKit
2626

2727
For header use `SPDiffableSideBarHeader` class.
2828
*/
29-
@available(iOS 14, *)
29+
@available(iOS 14, macCatalyst 14, *)
3030
open class SPDiffableSideBarItem: SPDiffableItem {
3131

3232
public let title: String

Sources/SPDiffable/Collection/SPDiffableSideBarButtonCollectionViewListCell.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import UIKit
2828
Also not show background selection, but cell selected. Need deselect it manually.
2929
Configure it cell need via `updateWithItem` func.
3030
*/
31-
@available(iOS 14, *)
31+
@available(iOS 14, macCatalyst 14, *)
3232
class SPDiffableSideBarButtonCollectionViewListCell: UICollectionViewListCell {
3333

3434
private var item: SPDiffableSideBarButton? = nil

Sources/SPDiffable/Collection/SPDiffableSideBarController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Basic side bar controller.
3030
Collection configuration setted to `.sidebar`.
3131
Layout detect data source and automatically set header and footer mode.
3232
*/
33-
@available(iOS 14, *)
33+
@available(iOS 14, macCatalyst 14, *)
3434
open class SPDiffableSideBarController: UIViewController, UICollectionViewDelegate {
3535

3636
public var collectionView: UICollectionView!

0 commit comments

Comments
 (0)