-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathExample.swift
More file actions
35 lines (31 loc) · 1.25 KB
/
Copy pathExample.swift
File metadata and controls
35 lines (31 loc) · 1.25 KB
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
//
// Example.swift
// Example
//
// Created by Denys Telezhkin on 14.08.2020.
// Copyright © 2020 Denys Telezhkin. All rights reserved.
//
import Foundation
import UIKit
enum Example: CaseIterable {
case sections
case compositionalLayouts
case pagination
case diffableDatasource
var title: String {
switch self {
case .sections: return "Move sections"
case .compositionalLayouts: return "Compositional layout"
case .pagination: return "Feed with load more / pull to refresh"
case .diffableDatasource: return "Multi-section diffable datasource"
}
}
var controller : UIViewController {
switch self {
case .sections: return UINavigationController(rootViewController: SectionsViewController(collectionViewLayout: UICollectionViewFlowLayout()))
case .compositionalLayouts: return UINavigationController(rootViewController: CompositionalLayoutsViewController())
case .pagination: return UINavigationController(rootViewController: FeedViewController(nibName: "FeedViewController", bundle: nil))
case .diffableDatasource: return UINavigationController(rootViewController: DiffableMultiSectionController())
}
}
}