瀏覽代碼

- Marked some classes as final

Iftekhar 3 年之前
父節點
當前提交
13adb19bb5

+ 13 - 12
Demo/Swift_Demo/ViewController/CollectionViewDemoController.swift

@@ -28,19 +28,20 @@ class CollectionViewDemoController: UIViewController, UICollectionViewDelegate,
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
-
-            if identifier == "SettingsNavigationController" {
-
-                let controller = segue.destination
-
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+        if identifier == "SettingsNavigationController" {
+            
+            let controller = segue.destination
+            
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 13 - 12
Demo/Swift_Demo/ViewController/CustomViewController.swift

@@ -192,19 +192,20 @@ class CustomViewController: UIViewController, UIPopoverPresentationControllerDel
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
-
-            if identifier == "SettingsNavigationController" {
-
-                let controller = segue.destination
-
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+        if identifier == "SettingsNavigationController" {
+            
+            let controller = segue.destination
+            
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 13 - 12
Demo/Swift_Demo/ViewController/ExampleTableViewController.swift

@@ -59,19 +59,20 @@ class ExampleTableViewController: UIViewController, UITableViewDataSource, UITab
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
-
-            if identifier == "SettingsNavigationController" {
-
-                let controller = segue.destination
-
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+        if identifier == "SettingsNavigationController" {
+            
+            let controller = segue.destination
+            
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 10 - 9
Demo/Swift_Demo/ViewController/ManualToolbarViewController.swift

@@ -86,19 +86,20 @@ class ManualToolbarViewController: UIViewController, UIPopoverPresentationContro
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 10 - 9
Demo/Swift_Demo/ViewController/NavigationBarViewController.swift

@@ -45,19 +45,20 @@ class NavigationBarViewController: UIViewController, UITextFieldDelegate, UIPopo
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 10 - 9
Demo/Swift_Demo/ViewController/OptionsViewController.swift

@@ -25,20 +25,21 @@ class OptionsViewController: UITableViewController {
 
     override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
 
-        if let cell = tableView.dequeueReusableCell(withIdentifier: "OptionTableViewCell", for: indexPath) as? OptionTableViewCell {
-            cell.labelOption.text = options[indexPath.row]
+        guard let cell = tableView.dequeueReusableCell(withIdentifier: "OptionTableViewCell", for: indexPath) as? OptionTableViewCell else {
+            fatalError("Can't dequeue cell")
+        }
 
-            if indexPath.row == self.selectedIndex {
+        cell.labelOption.text = options[indexPath.row]
 
-                cell.accessoryType = .checkmark
-            } else {
+        if indexPath.row == self.selectedIndex {
 
-                cell.accessoryType = .none
-            }
+            cell.accessoryType = .checkmark
+        } else {
 
-            return cell
+            cell.accessoryType = .none
         }
-        return UITableViewCell()
+
+        return cell
     }
 
     override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

+ 10 - 9
Demo/Swift_Demo/ViewController/ScrollViewController.swift

@@ -61,19 +61,20 @@ class ScrollViewController: UIViewController, UITableViewDataSource, UITableView
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 31 - 33
Demo/Swift_Demo/ViewController/SearchViewController.swift

@@ -47,40 +47,38 @@ class SearchViewController: UITableViewController, UISearchResultsUpdating, UISe
 
     func searchForText(_ searchText: String?, scope: Int) {
 
-        if let text = searchText {
-
-            if text.isEmpty == false {
-                if scope == 0 {
-                    self.filteredList = self.dataList.filter({ (obj: [String: String]) -> Bool in
-
-                        if obj["name"]?.contains(text) == true || obj["email"]?.contains(text) == true {
-                            return true
-                        } else {
-                            return false
-                        }
-                    })
-                } else if scope == 1 {
-                    self.filteredList = self.dataList.filter({ (obj: [String: String]) -> Bool in
-
-                        if obj["name"]?.contains(text) == true || obj["email"]?.contains(text) == true {
-                            return true
-                        } else {
-                            return false
-                        }
-                    })
-                } else if scope == 2 {
-                    self.filteredList = self.dataList.filter({ (obj: [String: String]) -> Bool in
-
-                        if obj["email"]?.contains(text) == true {
-                            return true
-                        } else {
-                            return false
-                        }
-                    })
+        guard let text = searchText, !text.isEmpty else {
+            self.filteredList = self.dataList
+            return
+        }
+        
+        if scope == 0 {
+            self.filteredList = self.dataList.filter({ (obj: [String: String]) -> Bool in
+
+                if obj["name"]?.contains(text) == true || obj["email"]?.contains(text) == true {
+                    return true
+                } else {
+                    return false
+                }
+            })
+        } else if scope == 1 {
+            self.filteredList = self.dataList.filter({ (obj: [String: String]) -> Bool in
+
+                if obj["name"]?.contains(text) == true || obj["email"]?.contains(text) == true {
+                    return true
+                } else {
+                    return false
+                }
+            })
+        } else if scope == 2 {
+            self.filteredList = self.dataList.filter({ (obj: [String: String]) -> Bool in
+
+                if obj["email"]?.contains(text) == true {
+                    return true
+                } else {
+                    return false
                 }
-            } else {
-                self.filteredList = self.dataList
-            }
+            })
         }
     }
 

+ 173 - 141
Demo/Swift_Demo/ViewController/SettingsViewController.swift

@@ -178,163 +178,192 @@ class SettingsViewController: UITableViewController {
         case 0:
             switch indexPath.row {
             case 0:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.enable
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.enableAction(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.enable
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.enableAction(_:)), for: .valueChanged)
+                return cell
             case 1:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "StepperTableViewCell") as? StepperTableViewCell {
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.stepper.value = Double(IQKeyboardManager.shared.keyboardDistanceFromTextField)
-                    cell.labelStepperValue.text = NSString(format: "%.0f", IQKeyboardManager.shared.keyboardDistanceFromTextField) as String
-                    cell.stepper.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.stepper.addTarget(self, action: #selector(self.keyboardDistanceFromTextFieldAction(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "StepperTableViewCell", for: indexPath) as? StepperTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.stepper.value = Double(IQKeyboardManager.shared.keyboardDistanceFromTextField)
+                cell.labelStepperValue.text = NSString(format: "%.0f", IQKeyboardManager.shared.keyboardDistanceFromTextField) as String
+                cell.stepper.removeTarget(nil, action: nil, for: .allEvents)
+                cell.stepper.addTarget(self, action: #selector(self.keyboardDistanceFromTextFieldAction(_:)), for: .valueChanged)
+                return cell
             default:    break
             }
         case 1:
             switch indexPath.row {
             case 0:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.enableAutoToolbar
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.enableAutoToolbarAction(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.enableAutoToolbar
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.enableAutoToolbarAction(_:)), for: .valueChanged)
+                return cell
             case 1:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "NavigationTableViewCell") as? NavigationTableViewCell {
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "NavigationTableViewCell", for: indexPath) as? NavigationTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                return cell
             case 2:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.shouldToolbarUsesTextFieldTintColor
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.shouldToolbarUsesTextFieldTintColorAction(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.shouldToolbarUsesTextFieldTintColor
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.shouldToolbarUsesTextFieldTintColorAction(_:)), for: .valueChanged)
+                return cell
             case 3:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.shouldShowToolbarPlaceholder
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.shouldShowToolbarPlaceholder(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.shouldShowToolbarPlaceholder
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.shouldShowToolbarPlaceholder(_:)), for: .valueChanged)
+                return cell
             case 4:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "NavigationTableViewCell") as? NavigationTableViewCell {
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "NavigationTableViewCell", for: indexPath) as? NavigationTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                return cell
             case 5:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "ColorTableViewCell") as? ColorTableViewCell {
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.colorPickerTextField.selectedColor = IQKeyboardManager.shared.toolbarTintColor
-                    cell.colorPickerTextField.tag = 15
-                    cell.colorPickerTextField.delegate = self
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "ColorTableViewCell", for: indexPath) as? ColorTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.colorPickerTextField.selectedColor = IQKeyboardManager.shared.toolbarTintColor
+                cell.colorPickerTextField.tag = 15
+                cell.colorPickerTextField.delegate = self
+                return cell
             case 6:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "ImageSwitchTableViewCell") as? ImageSwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.arrowImageView.image = IQKeyboardManager.shared.toolbarDoneBarButtonItemImage
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.toolbarDoneBarButtonItemImage != nil
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.toolbarDoneBarButtonItemImage(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "ImageSwitchTableViewCell", for: indexPath) as? ImageSwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.arrowImageView.image = IQKeyboardManager.shared.toolbarDoneBarButtonItemImage
+                cell.switchEnable.isOn = IQKeyboardManager.shared.toolbarDoneBarButtonItemImage != nil
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.toolbarDoneBarButtonItemImage(_:)), for: .valueChanged)
+                return cell
             case 7:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "TextFieldTableViewCell") as? TextFieldTableViewCell {
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.textField.text = IQKeyboardManager.shared.toolbarDoneBarButtonItemText
-                    cell.textField.tag = 17
-                    cell.textField.delegate = self
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "TextFieldTableViewCell", for: indexPath) as? TextFieldTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.textField.text = IQKeyboardManager.shared.toolbarDoneBarButtonItemText
+                cell.textField.tag = 17
+                cell.textField.delegate = self
+                return cell
             default:    break
             }
         case 2:
             switch indexPath.row {
             case 0:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.overrideKeyboardAppearance
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.overrideKeyboardAppearanceAction(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
 
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.overrideKeyboardAppearance
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.overrideKeyboardAppearanceAction(_:)), for: .valueChanged)
+                return cell
             case 1:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "NavigationTableViewCell") as? NavigationTableViewCell {
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "NavigationTableViewCell", for: indexPath) as? NavigationTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                return cell
             default:    break
             }
         case 3:
             switch indexPath.row {
             case 0:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.shouldResignOnTouchOutside
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.shouldResignOnTouchOutsideAction(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.shouldResignOnTouchOutside
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.shouldResignOnTouchOutsideAction(_:)), for: .valueChanged)
+                return cell
             default:    break
             }
         case 4:
             switch indexPath.row {
             case 0:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.shouldPlayInputClicks
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.shouldPlayInputClicksAction(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.shouldPlayInputClicks
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.shouldPlayInputClicksAction(_:)), for: .valueChanged)
+                return cell
             default:    break
             }
         case 5:
             switch indexPath.row {
             case 0:
-                if let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell") as? SwitchTableViewCell {
-                    cell.switchEnable.isEnabled = true
-                    cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
-                    cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
-                    cell.switchEnable.isOn = IQKeyboardManager.shared.enableDebugging
-                    cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
-                    cell.switchEnable.addTarget(self, action: #selector(self.enableDebugging(_:)), for: .valueChanged)
-                    return cell
+                guard let cell = tableView.dequeueReusableCell(withIdentifier: "SwitchTableViewCell", for: indexPath) as? SwitchTableViewCell else {
+                    fatalError("Can't dequeue cell")
                 }
+
+                cell.switchEnable.isEnabled = true
+                cell.labelTitle.text = keyboardManagerProperties[indexPath.section][indexPath.row]
+                cell.labelSubtitle.text = keyboardManagerPropertyDetails[indexPath.section][indexPath.row]
+                cell.switchEnable.isOn = IQKeyboardManager.shared.enableDebugging
+                cell.switchEnable.removeTarget(nil, action: nil, for: .allEvents)
+                cell.switchEnable.addTarget(self, action: #selector(self.enableDebugging(_:)), for: .valueChanged)
+                return cell
             default:    break
             }
         default:    break
@@ -345,45 +374,47 @@ class SettingsViewController: UITableViewController {
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
-
-            if identifier.elementsEqual("OptionsViewController"), let controller = segue.destination as? OptionsViewController, let cell = sender as? UITableViewCell {
-
-                controller.delegate = self
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-                selectedIndexPathForOptions = self.tableView.indexPath(for: cell)
+        if identifier.elementsEqual("OptionsViewController"), let controller = segue.destination as? OptionsViewController, let cell = sender as? UITableViewCell {
 
-                if let selectedIndexPath = selectedIndexPathForOptions {
+            controller.delegate = self
 
-                    if (selectedIndexPath as NSIndexPath).section == 1 && (selectedIndexPath as NSIndexPath).row == 1 {
+            selectedIndexPathForOptions = self.tableView.indexPath(for: cell)
 
-                        controller.title = "Toolbar Manage Behaviour"
-                        controller.options = ["IQAutoToolbar By Subviews", "IQAutoToolbar By Tag", "IQAutoToolbar By Position"]
-                        controller.selectedIndex = IQKeyboardManager.shared.toolbarManageBehaviour.hashValue
+            guard let selectedIndexPath = selectedIndexPathForOptions else {
+                return
+            }
 
-                    } else if (selectedIndexPath as NSIndexPath).section == 1 && (selectedIndexPath as NSIndexPath).row == 4 {
+            if selectedIndexPath.section == 1 && selectedIndexPath.row == 1 {
 
-                        controller.title = "Fonts"
-                        controller.options = ["Bold System Font", "Italic system font", "Regular"]
-                        controller.selectedIndex = IQKeyboardManager.shared.toolbarManageBehaviour.hashValue
+                controller.title = "Toolbar Manage Behaviour"
+                controller.options = ["IQAutoToolbar By Subviews", "IQAutoToolbar By Tag", "IQAutoToolbar By Position"]
+                controller.selectedIndex = IQKeyboardManager.shared.toolbarManageBehaviour.hashValue
 
-                        let fonts = [UIFont.boldSystemFont(ofSize: 12), UIFont.italicSystemFont(ofSize: 12), UIFont.systemFont(ofSize: 12)]
+            } else if selectedIndexPath.section == 1 && selectedIndexPath.row == 4 {
 
-                        if let placeholderFont = IQKeyboardManager.shared.placeholderFont {
+                controller.title = "Fonts"
+                controller.options = ["Bold System Font", "Italic system font", "Regular"]
+                controller.selectedIndex = IQKeyboardManager.shared.toolbarManageBehaviour.hashValue
 
-                            if let index = fonts.firstIndex(of: placeholderFont) {
+                let fonts = [UIFont.boldSystemFont(ofSize: 12), UIFont.italicSystemFont(ofSize: 12), UIFont.systemFont(ofSize: 12)]
 
-                                controller.selectedIndex = index
-                            }
-                        }
+                if let placeholderFont = IQKeyboardManager.shared.placeholderFont {
 
-                    } else if (selectedIndexPath as NSIndexPath).section == 2 && (selectedIndexPath as NSIndexPath).row == 1 {
+                    if let index = fonts.firstIndex(of: placeholderFont) {
 
-                        controller.title = "Keyboard Appearance"
-                        controller.options = ["UIKeyboardAppearance Default", "UIKeyboardAppearance Dark", "UIKeyboardAppearance Light"]
-                        controller.selectedIndex = IQKeyboardManager.shared.keyboardAppearance.hashValue
+                        controller.selectedIndex = index
                     }
                 }
+
+            } else if selectedIndexPath.section == 2 && selectedIndexPath.row == 1 {
+
+                controller.title = "Keyboard Appearance"
+                controller.options = ["UIKeyboardAppearance Default", "UIKeyboardAppearance Dark", "UIKeyboardAppearance Light"]
+                controller.selectedIndex = IQKeyboardManager.shared.keyboardAppearance.hashValue
             }
         }
     }
@@ -417,18 +448,19 @@ extension SettingsViewController: ColorPickerTextFieldDelegate {
 extension SettingsViewController: OptionsViewControllerDelegate {
     func optionsViewController(_ controller: OptionsViewController, index: NSInteger) {
 
-        if let selectedIndexPath = selectedIndexPathForOptions {
+        guard let selectedIndexPath = selectedIndexPathForOptions else {
+            return
+        }
 
-            if (selectedIndexPath as NSIndexPath).section == 1 && (selectedIndexPath as NSIndexPath).row == 1 {
-                IQKeyboardManager.shared.toolbarManageBehaviour = IQAutoToolbarManageBehaviour(rawValue: index)!
-            } else if (selectedIndexPath as NSIndexPath).section == 1 && (selectedIndexPath as NSIndexPath).row == 4 {
+        if selectedIndexPath.section == 1 && selectedIndexPath.row == 1 {
+            IQKeyboardManager.shared.toolbarManageBehaviour = IQAutoToolbarManageBehaviour(rawValue: index)!
+        } else if selectedIndexPath.section == 1 && selectedIndexPath.row == 4 {
 
-                let fonts = [UIFont.boldSystemFont(ofSize: 12), UIFont.italicSystemFont(ofSize: 12), UIFont.systemFont(ofSize: 12)]
-                IQKeyboardManager.shared.placeholderFont = fonts[index]
-            } else if (selectedIndexPath as NSIndexPath).section == 2 && (selectedIndexPath as NSIndexPath).row == 1 {
+            let fonts = [UIFont.boldSystemFont(ofSize: 12), UIFont.italicSystemFont(ofSize: 12), UIFont.systemFont(ofSize: 12)]
+            IQKeyboardManager.shared.placeholderFont = fonts[index]
+        } else if selectedIndexPath.section == 2 && selectedIndexPath.row == 1 {
 
-                IQKeyboardManager.shared.keyboardAppearance = UIKeyboardAppearance(rawValue: index)!
-            }
+            IQKeyboardManager.shared.keyboardAppearance = UIKeyboardAppearance(rawValue: index)!
         }
     }
 }

+ 10 - 9
Demo/Swift_Demo/ViewController/SpecialCaseViewController.swift

@@ -137,19 +137,20 @@ class SpecialCaseViewController: UIViewController, UISearchBarDelegate, UITextFi
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 10 - 9
Demo/Swift_Demo/ViewController/TableViewInContainerViewController.swift

@@ -44,19 +44,20 @@ class TableViewInContainerViewController: UIViewController, UITableViewDataSourc
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 10 - 9
Demo/Swift_Demo/ViewController/TextFieldViewController.swift

@@ -109,19 +109,20 @@ class TextFieldViewController: UIViewController, UITextViewDelegate, UIPopoverPr
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 10 - 9
Demo/Swift_Demo/ViewController/TextSelectionViewController.swift

@@ -51,19 +51,20 @@ class TextSelectionViewController: UIViewController, UITableViewDelegate, UITabl
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 10 - 9
Demo/Swift_Demo/ViewController/TextViewSpecialCaseViewController.swift

@@ -49,19 +49,20 @@ class TextViewSpecialCaseViewController: UIViewController, UITextViewDelegate, U
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-            if identifier == "SettingsNavigationController" {
+        if identifier == "SettingsNavigationController" {
 
-                let controller = segue.destination
+            let controller = segue.destination
 
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 25 - 24
Demo/Swift_Demo/ViewController/ViewController.swift

@@ -41,31 +41,32 @@ class ViewController: UITableViewController, UIPopoverPresentationControllerDele
 
     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
 
-        if let identifier = segue.identifier {
-
-            if identifier == "SettingsNavigationController" {
-
-                let controller = segue.destination
-
-                controller.modalPresentationStyle = .popover
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
-                controller.popoverPresentationController?.sourceView = sender as? UIView
-
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            } else if identifier == "PopoverViewController" {
-                let controller = segue.destination
-
-                controller.modalPresentationStyle = .popover
-
-                controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
-                controller.popoverPresentationController?.sourceView = sender as? UIView
+        guard let identifier = segue.identifier else {
+            return
+        }
 
-                let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
-                controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
-                controller.popoverPresentationController?.delegate = self
-            }
+        if identifier == "SettingsNavigationController" {
+            
+            let controller = segue.destination
+            
+            controller.modalPresentationStyle = .popover
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.popoverPresentationController?.sourceView = sender as? UIView
+            
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
+        } else if identifier == "PopoverViewController" {
+            let controller = segue.destination
+            
+            controller.modalPresentationStyle = .popover
+            
+            controller.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
+            controller.popoverPresentationController?.sourceView = sender as? UIView
+            
+            let heightWidth = max(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
+            controller.preferredContentSize = CGSize(width: heightWidth, height: heightWidth)
+            controller.popoverPresentationController?.delegate = self
         }
     }
 

+ 1 - 1
IQKeyboardManagerSwift/IQKeyboardManager.swift

@@ -32,7 +32,7 @@ import QuartzCore
 Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. A generic version of KeyboardManagement. https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
 */
 
-@objc public class IQKeyboardManager: NSObject {
+@objc public final class IQKeyboardManager: NSObject {
 
     /**
     Returns the default singleton instance.

+ 2 - 2
IQKeyboardManagerSwift/IQKeyboardReturnKeyHandler.swift

@@ -24,7 +24,7 @@
 // import Foundation - UIKit contains Foundation
 import UIKit
 
-private class IQTextFieldViewInfoModal: NSObject {
+private final class IQTextFieldViewInfoModal: NSObject {
 
     fileprivate weak var textFieldDelegate: UITextFieldDelegate?
     fileprivate weak var textViewDelegate: UITextViewDelegate?
@@ -42,7 +42,7 @@ private class IQTextFieldViewInfoModal: NSObject {
 /**
 Manages the return key to work like next/done in a view hierarchy.
 */
-public class IQKeyboardReturnKeyHandler: NSObject {
+public final class IQKeyboardReturnKeyHandler: NSObject {
 
     // MARK: Settings
 

+ 1 - 1
IQKeyboardManagerSwift/IQToolbar/IQInvocation.swift

@@ -23,7 +23,7 @@
 
 import UIKit
 
-@objc public class IQInvocation: NSObject {
+@objc public final class IQInvocation: NSObject {
     @objc public weak var target: AnyObject?
     @objc public var action: Selector
 

+ 1 - 1
IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift

@@ -26,7 +26,7 @@ import UIKit
 /**
  IQBarButtonItemConfiguration for creating toolbar with bar button items
  */
-@objc public class IQBarButtonItemConfiguration: NSObject {
+@objc public final class IQBarButtonItemConfiguration: NSObject {
 
     @objc public init(barButtonSystemItem: UIBarButtonItem.SystemItem, action: Selector) {
         self.barButtonSystemItem = barButtonSystemItem