 //MARK: CitySearchControllerDelegate
 extension AddCityPageVC : CitySearchControllerDelegate {
     func didChangeSearchTextInSearchBar(searchBar: CitySearchBar, searchText: String) {
-        filterContentForSearchText(searchBar.text!)
-    }
-}
-
+        filterContentForSearchText(searchText)
+    }
+}
+

    //MARK: Animation
    private func animateEntry(){
        UIView.animateWithDuration(0.6, delay: 0.0, options: [UIViewAnimationOptions.BeginFromCurrentState, UIViewAnimationOptions.CurveEaseInOut], animations: {[unowned self]() -> Void in
            
            self.searchController.citySearchBar.alpha = 1
            self.searchTableView.alpha = 1
        
            }, completion: {(finished) in
                print("finishe")
        })
        
        UIView.animateWithDuration(0.3, delay: 0.0, options: [UIViewAnimationOptions.BeginFromCurrentState, UIViewAnimationOptions.CurveEaseInOut], animations: {[unowned self]() -> Void in
            
            self.maskView.alpha = 0.5
            
            }, completion: {[unowned self](finished) in

class AddCityPageVC: UIViewController {

    //MARK: Property
    private var cities = [String]()
    private var filteredCities = [String]()
    
    private var senderView : UITableViewCell?
    private let maskView = UIView()
    
    let searchTableView = UITableView()
    var searchController : CitySearchController!
    
    private var rootViewController : UIViewController!

    var delegate : SelectCityForAddingDelegate?

    //MARK: Life cycle
    init(senderView : UITableViewCell?, rootViewController rootVC:UIViewController, backgroundColor:UIColor){
        self.senderView = senderView
        self.maskView.backgroundColor = backgroundColor
        
        rootViewController = rootVC
        
        if let controller = rootViewController as? MainViewController{
            delegate = controller
