-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathTableViewCell.swift
67 lines (51 loc) · 1.3 KB
/
TableViewCell.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
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// TableViewCell.swift
// Astrolabe
//
// Created by Sergei Mikhan on 1/4/17.
// Copyright © 2017 Netcosports. All rights reserved.
//
import UIKit
open class RootTableCell: UITableViewCell {
public convenience init() {
self.init(frame: CGRect.zero)
}
public required override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
internalSetup()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
selectionStyle = .none
internalSetup()
}
open override func awakeFromNib() {
super.awakeFromNib()
selectionStyle = .none
internalSetup()
}
open override class var requiresConstraintBasedLayout: Bool {
return true
}
func internalSetup() {
fatalError("should not be instantiated directly")
}
}
open class TableViewCell: RootTableCell, ReusableView {
open var cell: Cellable?
open weak var containerViewController: UIViewController?
open weak var containerView: UITableView?
open var indexPath: IndexPath?
open var selectedState = false
open var expandedState = false
override func internalSetup() {
setup()
}
open func setup() {
}
open func willDisplay() {
}
open func endDisplay() {
}
}