@@ -54,7 +54,7 @@ class ExampleViewController: UITableViewController {
5454
5555 override func loadView( ) {
5656 super. loadView ( )
57- tableView. register ( ExampleCell . self, forCellReuseIdentifier: NSStringFromClass ( ExampleCell . self) )
57+ tableView. register ( ExampleCell . self, forCellReuseIdentifier: String ( describing : ExampleCell . self) )
5858 tableView. tableFooterView = flipButton
5959 tableView. tableFooterView? . isUserInteractionEnabled = true
6060 }
@@ -83,23 +83,24 @@ class ExampleViewController: UITableViewController {
8383 }
8484
8585 override func tableView( _ tableView: UITableView , cellForRowAt indexPath: IndexPath ) -> UITableViewCell {
86- let cell = tableView. dequeueReusableCell ( withIdentifier: NSStringFromClass ( ExampleCell . self) , for: indexPath)
87- switch types [ ( indexPath as NSIndexPath ) . section] {
86+ let cell = tableView. dequeueReusableCell ( withIdentifier: String ( describing: ExampleCell . self) , for: indexPath)
87+
88+ switch types [ indexPath. section] {
8889 case let type as ICKeyboardDismissTextField . Type :
8990 let textField = type. init ( )
9091 textField. leftViewMode = . always
9192 textField. leftView = UIView ( frame: CGRect ( x: 0 , y: 0 , width: 15 , height: 15 ) )
92- textField. placeholder = String ( type)
93+ textField. placeholder = String ( describing : type)
9394 ( cell as? ExampleCell ) ? . showcase = textField
9495
9596 case let type as CustomizedTokenField . Type :
96- cell. textLabel? . text = String ( type)
97+ cell. textLabel? . text = String ( describing : type)
9798 cell. accessoryType = . disclosureIndicator
9899
99100 case let type as ICTokenField . Type :
100101 let container = UIView ( frame: cell. bounds)
101102 let tokenField = type. init ( )
102- tokenField. placeholder = String ( type)
103+ tokenField. placeholder = String ( describing : type)
103104 tokenField. frame = container. bounds. insetBy ( dx: 5 , dy: 0 )
104105 tokenField. autoresizingMask = [ . flexibleWidth, . flexibleHeight]
105106 container. addSubview ( tokenField)
@@ -114,18 +115,18 @@ class ExampleViewController: UITableViewController {
114115 // MARK: - UITableViewDelegate
115116
116117 override func tableView( _ tableView: UITableView , shouldHighlightRowAt indexPath: IndexPath ) -> Bool {
117- return types [ ( indexPath as NSIndexPath ) . section] == CustomizedTokenField . self
118+ return types [ indexPath. section] == CustomizedTokenField . self
118119 }
119120
120121 override func tableView( _ tableView: UITableView , didSelectRowAt indexPath: IndexPath ) {
121- if types [ ( indexPath as NSIndexPath ) . section] == CustomizedTokenField . self {
122+ if types [ indexPath. section] == CustomizedTokenField . self {
122123 present ( UINavigationController ( rootViewController: CustomizedTokenViewController ( ) ) , animated: true , completion: nil )
123124 }
124125 }
125126
126127 // MARK: - UIResponder Callbacks
127128
128- @objc private func showStoryboard( _ sender: UIButton ) {
129+ @objc fileprivate func showStoryboard( _ sender: UIButton ) {
129130 if let controller = UIStoryboard ( name: " Main " , bundle: Bundle . main) . instantiateInitialViewController ( ) {
130131 controller. modalTransitionStyle = . flipHorizontal
131132 present ( controller, animated: true , completion: nil )
0 commit comments