-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathViewRegistrationViewType.swift
54 lines (45 loc) · 1.08 KB
/
ViewRegistrationViewType.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// Created by Jesse Squires
// https://www.jessesquires.com
//
// Documentation
// https://jessesquires.github.io/ReactiveCollectionsKit
//
// GitHub
// https://github.com/jessesquires/ReactiveCollectionsKit
//
// Copyright © 2019-present Jesse Squires
//
import Foundation
/// Describes the type of view to be registered for reuse.
public enum ViewRegistrationViewType: Hashable, Sendable {
/// Describes a cell.
case cell
/// Describes a supplementary view.
case supplementary(kind: String)
// MARK: Internal
var kind: String {
switch self {
case .cell: "cell"
case .supplementary(let kind): kind
}
}
var isCell: Bool {
switch self {
case .cell: true
case .supplementary: false
}
}
var isSupplementary: Bool {
switch self {
case .cell: false
case .supplementary: true
}
}
var isHeader: Bool {
self.kind == CollectionViewConstants.headerKind
}
var isFooter: Bool {
self.kind == CollectionViewConstants.footerKind
}
}