From 7d034ea39264c6d062533b68fcfa4dd90cfe6c98 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Tue, 26 Jul 2016 18:09:32 +0300 Subject: [PATCH] code review note --- LeadKit/LeadKit/Controllers/TableViewController.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LeadKit/LeadKit/Controllers/TableViewController.swift b/LeadKit/LeadKit/Controllers/TableViewController.swift index a2d202a9..3351fbab 100644 --- a/LeadKit/LeadKit/Controllers/TableViewController.swift +++ b/LeadKit/LeadKit/Controllers/TableViewController.swift @@ -8,7 +8,7 @@ import UIKit -public class TableViewController: UITableViewController, CellsControllerProtocol { +public class TableViewController: UITableViewController, CellsControllerProtocol { private var heightCache: [NSIndexPath: CGFloat] = [:] @@ -16,6 +16,8 @@ public class TableViewController: UITableViewController, CellsContr private let cellCreationType: CellCreationType + private static let creationTypeKey = "CellCreationType" + // MARK: - Initialization public init(style: UITableViewStyle, cellCreationType: CellCreationType = .OnTheFlight) { @@ -24,7 +26,7 @@ public class TableViewController: UITableViewController, CellsContr } public required init?(coder aDecoder: NSCoder) { - if let cellCreationType = CellCreationType(rawValue: aDecoder.decodeIntegerForKey("CellCreationType")) { + if let cellCreationType = CellCreationType(rawValue: aDecoder.decodeIntegerForKey(TableViewController.creationTypeKey)) { self.cellCreationType = cellCreationType super.init(coder: aDecoder) } else { @@ -40,7 +42,7 @@ public class TableViewController: UITableViewController, CellsContr public override func encodeWithCoder(aCoder: NSCoder) { super.encodeWithCoder(aCoder) - aCoder.encodeInteger(cellCreationType.rawValue, forKey: "CellCreationType") + aCoder.encodeInteger(cellCreationType.rawValue, forKey: TableViewController.creationTypeKey) } /**