         super.init(model: model, scheme:scheme, bundle:bundle, tableName:tableName)
         populateCountryList()
         doOnInit()
+        
+        
+        NSNotificationCenter.defaultCenter().addObserver(self,
+            selector:Selector("keyboardWillShow:"),
+            name:UIKeyboardWillShowNotification,
+            object:nil)
+        NSNotificationCenter.defaultCenter().addObserver(self,
+            selector:Selector("keyboardWillHide:"),
+            name:UIKeyboardWillHideNotification,
+            object:nil)
     }
     
     required public init(coder aDecoder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
+    }
+    
+    deinit{
+        NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillShowNotification, object: nil)
+        NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillHideNotification, object: nil)
+    
     }
     
     var haveExtraSections:  Bool{ get {return (havePhoneSection || haveNetworkSection) } }

        
        tableView.translatesAutoresizingMaskIntoConstraints = false
        self.addSubview(tableView)
  
    }
    
    func searchController() -> UISearchController{

        let locale = prefferedLocale()
        for countryCode in countryCodeArray {
            let countryName:String = locale.displayNameForKey(NSLocaleCountryCode, value:countryCode)!;
            var countryInfo:CountryInfo!
            let phoneUtil = NBPhoneNumberUtil.sharedInstance()
            if let resolvedCountryCode = phoneUtil.getCountryCodeForRegion(countryCode){
                if (resolvedCountryCode != 0) {
                    countryInfo = CountryInfo(name:countryName, prefix:"+\(resolvedCountryCode)",code:countryCode)
                    countryArray.append(countryInfo)
                }
            }
            
            if(countryInfo == nil){
                print("Not present: \(countryCode) \(countryName)")
            }
        }
