Select Page

Running code in a quoted PRINT command

Basic Print command:print(“This is text that is printed”)The result will be:This is text that is printed Running simple code inside a print command uses \(something) inside it.Example:print(“This number 25 is the same as \(20+5).)The result will...

IBAction with Button Press

When moving a button action into the View coding screen, CRTL + click and drag the button BELOW the “viewDidLoad” { bracketed } area. In many cases, Touch Up Inside is the best response for this, especially when it’s a basic button response. This...

Image Literal

//        diceImageView1.image = #imageLiteral(resourceName: “DiceThree”) //        diceImageView2.image = #imageLiteral(resourceName: “DiceFour”)

Making IBOutlet for Images

To make an “Interface Builder Outlet” (IBOutlet), CTRL + click and drag the image ABOVE viewDidLoad and BELOW “class ViewController” This allows for giving a button an interface NAME so things like buttons can interact and change...