Fix access modifiers error
Seto Elkahfi committed
Mar 28, 2017 at 19:25 UTC
ba920e432b5aec8d8488ff7bd2be3324462f36da
4 files changed
+26
-15
JomloTableView/Classes/JomloTableView.swift
+10
-3
@@ -13,18 +13,25 @@ public class JomloTableView: UITableView {
13
// Table view section
14
var sections = Array<JomloTableViewSection>()
15
16
+ required public init?(coder aDecoder: NSCoder) {
17
+ super.init(coder: aDecoder)
18
+
19
+ self.delegate = self
20
+ self.dataSource = self
21
+ self.tableFooterView = UIView()
22
+ }
23
17
- func numberOfSectionsInTableView(tableView: UITableView) -> Int {
24
+ public func numberOfSectionsInTableView(tableView: UITableView) -> Int {
25
return sections.count
26
}
27
28
// Add single section to table view
22
- func addSection(section: JomloTableViewSection) {
29
+ public func addSection(section: JomloTableViewSection) {
30
sections.append(section)
31
}
32
33
// Remove all section in table view
27
- func removeAllSection() {
34
+ public func removeAllSection() {
35
sections.removeAll()
36
}
37
JomloTableView/Classes/JomloTableViewCell.swift
+1
-1
@@ -8,6 +8,6 @@
8
9
import Foundation
10
11
-public class JomloTableViewCell: UITableViewCell {
11
+open class JomloTableViewCell: UITableViewCell {
12
13
}
JomloTableView/Classes/JomloTableViewRow.swift
+8
-8
@@ -8,17 +8,17 @@
8
9
import Foundation
10
11
-public class JomloTableViewRow: NSObject {
11
+open class JomloTableViewRow: NSObject {
12
13
- var identifier: String {
13
+ open var identifier: String {
14
return ""
15
}
16
17
- var rowHeight: CGFloat {
17
+ open var rowHeight: CGFloat {
18
return 0
19
}
20
21
- var estimatedRowHeight: CGFloat {
21
+ open var estimatedRowHeight: CGFloat {
22
return 0
23
}
24
@@ -26,20 +26,20 @@ public class JomloTableViewRow: NSObject {
26
// Use IBAction on single view componen if you need to register action for a particular view inside the row
27
internal var onClicked: ((JomloTableViewRow) -> (Void))?
28
29
- func setOnItemClickedCallback(clicked:@escaping (JomloTableViewRow) -> Void){
29
+ open func setOnItemClickedCallback(clicked:@escaping (JomloTableViewRow) -> Void){
30
onClicked = clicked
31
}
32
33
34
- func populateView(cell: JomloTableViewCell) {
34
+ open func populateView(cell: JomloTableViewCell) {
35
fatalError("Should be overrided")
36
}
37
38
- func willDisplay(cell: UITableViewCell){
38
+ open func willDisplay(cell: UITableViewCell){
39
cell.separatorInset = UIEdgeInsetsMake(0, 6, 0, 6)
40
}
41
42
- func onItemClicked() {
42
+ open func onItemClicked() {
43
if let clicked = onClicked {
44
clicked(self)
45
}
JomloTableView/Classes/JomloTableViewSection.swift
+7
-3
@@ -12,20 +12,24 @@ public class JomloTableViewSection {
12
13
var rows = Array<JomloTableViewRow>()
14
15
+ public init() {
16
+
17
+ }
18
+
19
// Count rows in this table view section
16
- var count: Int {
20
+ public var count: Int {
21
get {
22
return rows.count
23
}
24
}
25
26
// Add a single row for this table view section
23
- func addRow(row: JomloTableViewRow) {
27
+ public func addRow(row: JomloTableViewRow) {
28
self.rows.append(row);
29
}
30
31
// Remove all rows in this table view section
28
- func removeAllRows() {
32
+ public func removeAllRows() {
33
self.rows.removeAll()
34
}
35