Generar un numero random

 -Escribir el código para crear una app que genere un número random

//

//  ViewController.swift

//  PrimerAppCF

//

//  Created by Luis Enrique Hernandez Cejas

//  Copyright © 2017 CódigoFacilito. All rights reserved.

//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var numbertxt: UITextField!

    @IBOutlet weak var intentostlbl: UILabel!

    @IBOutlet weak var mensajeLbl: 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.

        setValues()

    }

    func setValues() {

        random = String(arc4random_uniform(10))

        print(random)

    }

}




Comentarios

Entradas populares de este blog

Necesidades y problemas del mercado.

Cuestionario de etapas del desarrollo.