Generar un numero random
// // ViewController.swift // PrimerAppCF // // Created by Luis Enrique Hernandez Celaya en 04/06/17. // Copyright © 2017 CodigoFacilito All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var numbertxt: UITextField ! @ IBOutlet weak var intentoslbl: UILabel ! @ IBOutlet weak var mensajeslbl: UILabel ! var random = "" @IBAction func validar( _ sender: Any ) { setValues ( ) } override func viewDidLoad( ) { super . viewDidLoad ( ) //Do any additional setup after loading the view, typically from a nib. } func setValues( ){ random = String ( arc4random_uniform ( 10 )) print ( random ) } }