         
         loadingView.layer.addAnimation(animation, forKey: "basic")
     }
+    
+    func orientationDidChange(notification: NSNotification?) {
+        
+        var currentOrientation: UIInterfaceOrientation = UIApplication.sharedApplication().statusBarOrientation
+        
+        if UIInterfaceOrientationIsPortrait(currentOrientation) {
+            self.frame = CGRectMake(0.0, -20.0, CGRectGetWidth(UIScreen.mainScreen().bounds), 2.0)
+        }
+        else if UIInterfaceOrientationIsLandscape(currentOrientation) {
+            self.frame = CGRectMake(0.0, 0.0, CGRectGetWidth(UIScreen.mainScreen().bounds), 2.0)
+        }
+    }
 }
 
 extension UIViewController {


private var xoTimerAssociationKeyy: NSTimer        = NSTimer()

private let _LoaderHUDSharedInstance = LoaderHUD(frame: CGRectMake(0.0, -20.0,
                                                                   CGRectGetWidth(UIScreen.mainScreen().bounds), 2.0))

class LoaderHUD: UIView {
    
    var factoryTimer: NSTimer?
    
    var foregroundColor: UIColor?
    
    class var sharedInstance: LoaderHUD {
        return _LoaderHUDSharedInstance

    func startLoadingAnimation(animated: Bool) -> Void {
        
        stopLoadingAnimation(false)
            
        UIView.animateWithDuration((animated ? 0.2 : 0.0), animations: { () -> Void in
            LoaderHUD.sharedInstance.alpha = 1.0
        })
