title: How to make a global function for UIAlertController(ActionSheet) to access in many classes of project
body: <p>I want to make a function in <code>NSObject</code> class for <code>UIAlertCotroller</code>. So that I can access this function in any class. I have tried with that following code:</p>
  
  <pre><code>open class func showActionSheet(_ delegate: UIViewController, message: String, strtittle: String, handler: ((UIAlertController) -&gt; Void)! = nil)
      {
          let actionSheetController: UIAlertController = UIAlertController(title: strtittle, message: message, preferredStyle: UIAlertControllerStyle.actionSheet)
  
          if handler == nil{
              actionSheetController.addAction(UIAlertAction(title: "Default(Off)" , style: .default , handler:{ (UIAlertAction)in
              }))
          }
          else{
              actionSheetController.addAction(UIAlertAction(title: "Default(Off)" , style: .default , handler:{ (UIAlertAction)in
  
              }))
          }
  
          delegate.present(actionSheetController, animated: true, completion: {
              print("completion block")
          })
      }
  </code></pre>
  
  <p>This is the function that I made, but problem is there can be number of actions in ActionSheet and they also have different tittle and different styles. </p>
  
  <p><strong>Question:</strong> How can I make this function? Please Help.</p>
  
  <p>Thanks!</p>