title: How to write a Swift number picker in the alert controller like Android
body: <p>How do I create a number picker with a minimum and a maximum defined by a variable?</p>
  
  <p>In my Android application, I created an AlertDialog with a picker number, and the maximum number is linked to a value from my database. </p>
  
  <p>Is it possible to do the same thing in Swift, or something close to it?</p>
  
  <p>My alert controller code is: </p>
  
  <pre><code>func createAlertCarte1(Title:String, Message:String) {
          let alertCarte1 = UIAlertController(title: Title, message: Message, preferredStyle: UIAlertController.Style.alert)
          alertCarte1.addAction(UIAlertAction.init(title: "Ok", style: UIAlertAction.Style.default, handler: { (action1) in
              alertCarte1.dismiss(animated: true, completion: nil)
              self.displayAd()
          }))
          alertCarte1.addAction(UIAlertAction.init(title: "Annuler", style: UIAlertAction.Style.cancel, handler: { (action1) in
              alertCarte1.dismiss(animated: true, completion: nil)
          }))
  
          self.present(alertCarte1, animated: true, completion: nil)
  
      }
  </code></pre>