Hello World IOS App Part 2 AutoLayout: IOS Swift Tutorial

This entry is part 6 of 33 in the series iOS Apps

This IOS tutorial shows how to build first ios app hello world in swift and add autolayout constraints to arrange the uilabel centered horizontally and vertically with respect to parent view with the align center x to superview and align center y to superview constraints. It also shows how to change text color of UILabel and background color of UIView
https://www.youtube.com/watch?v=Cc312tvOzBM

iOS: A simple counter

This entry is part 4 of 33 in the series iOS Apps

This is another tutorial that I found that will be suitable for us to learn iOS programming with swift.

Below here the code that was used.

import UIKit

class ViewController: UIViewController {
    
    
    @IBOutlet var outputLabel: UILabel!
    var currentCount = 0
    

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
    @IBAction func addOneButton(sender: UIButton) {
        
        currentCount = currentCount + 1
        
        outputLabel.text = "The button has been clicked \(currentCount) no of times"
        outputLabel.textColor = UIColor.redColor()
        
    }
}

iOS: Hello World with a text field

This entry is part 2 of 33 in the series iOS Apps

Hello World created with Swift with a text entering field.

I tested it with my latest version of xCode and this is what I have in ViewController.swift.

import UIKit

class ViewController: UIViewController {

    @IBOutlet var nameLabel: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func helloWorldAction(nameTextField: UITextField) {
        
        nameLabel.text = "Hi \(nameTextField.text!)"
        
    }

}