Generar un numero random

 import UIKit

class ViewController: UIViewController { 


@IBOutlet weak var numbertxt: UITextField!

@IBOutlet weak var intentoslbl: UILabel!

@IBOutlet weak var mensajelbl: UILabel!

var random = “ “ 

@IBAction func validar (sender:Any) {

setValues()

}

override fund ViewDidLoad () {

super.ViewDidLoad ()

//Do any additional setup after loading the view, typically from a nib.

}

func SetValues () {

random = string (arc4random_uniform (10))

print (random)

}

}







Comentarios

Entradas populares de este blog

Necesidades específicas para la elaboración de aplicaciones móviles

Investigación de código de programa de la actividad anterior

Necesidades y problemas del mercado