         super.init(frame: CGRect(origin: CGPointZero, size: UIScreen.mainScreen().bounds.size))
         
         self.addSubview(self.darkView)
-
     }
     
     //Computed Property

    
    func show()
    {
        //We get the window
        let keyWindow:UIWindow = UIApplication.sharedApplication().keyWindow
        

                self.activityIndicatorView.center = CGPointMake(self.darkView.frame.size.width / 2.0, self.activityIndicatorView.frame.size.height / 2.0)
            }
        }
        NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("orientationHasChanged:"), name: UIApplicationDidChangeStatusBarOrientationNotification, object: nil)
    }
    
    func hide()
    {
        NSNotificationCenter.defaultCenter().removeObserver(self, name:UIApplicationDidChangeStatusBarOrientationNotification , object: nil)
        self.removeFromSuperview()
    }
    
    
    func orientationHasChanged(notification:NSNotification)
    {
        self.frame = CGRect(origin: CGPointZero, size: UIScreen.mainScreen().bounds.size)
        let center = CGPointMake(UIScreen.mainScreen().bounds.size.width/2, UIScreen.mainScreen().bounds.size.height/2)
        self.darkView.center = center
    }
}
