             popoverController.sourceView = source
             popoverController.sourceRect = source.bounds
         }
-        
+
         return self
     }
-    
+
     deinit {
         //print("deinit")
     }

        return topController
    }

    
    /// For ActionSheet
    public func setBarButton(item: UIBarButtonItem) -> Self {
        guard UIDevice.current.userInterfaceIdiom == .pad else {

                }
            }
        }

        self.presentedController?.present(self.alertController,
                                          animated: animated,
                                          completion: completion)

        return self
    }

    private var presentedController:UIViewController? {
        if let viewController = UIApplication.shared.keyWindow?.rootViewController {
            //Find the presented view controller
            var presentedController = viewController

            while presentedController.presentedViewController != nil &&
                  presentedController.presentedViewController?.isBeingDismissed == false
            {
                presentedController = presentedController.presentedViewController!
            }

            return presentedController
        }

        return nil
    }

    private var topViewController:UIViewController? {
        var topController = self.presentedController

        while topController?.childViewControllers.last != nil {
            topController = topController?.childViewControllers.last!
        }
