 class AddCityPageVC: UIViewController {
 
     //MARK: Property
-    var cities = [String]()
-    var filteredCities = [String]()
-    
-    var senderView : UITableViewCell
-    let maskView = UIView()
+    private var cities = [String]()
+    private var filteredCities = [String]()
+    
+    private var senderView : UITableViewCell?
+    private let maskView = UIView()
     
     let searchTableView = UITableView()
     var searchController : CitySearchController!
     
-    var rootViewController : UIViewController!
+    private var rootViewController : UIViewController!
 
     var delegate : SelectCityForAddingDelegate?
 
     //MARK: Life cycle
-    init(senderView : UITableViewCell,backgroundColor:UIColor){
+    init(senderView : UITableViewCell?, rootViewController rootVC:UIViewController, backgroundColor:UIColor){
         self.senderView = senderView
         self.maskView.backgroundColor = backgroundColor
         
-        rootViewController = UIApplication.sharedApplication().keyWindow!.rootViewController!
+        rootViewController = rootVC
         
         if let controller = rootViewController as? MainViewController{
             delegate = controller

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        initCities()
    }
    

                
                }, completion: {[unowned self](finished) in
                    self.searchController.citySearchBar.resignFirstResponder()
            })
            UIView.animateWithDuration(0.5, delay: 0, options: [UIViewAnimationOptions.BeginFromCurrentState, UIViewAnimationOptions.CurveEaseInOut], animations: {[unowned self]() in
                self.maskView.alpha = 0.0
