Sunday 7 January 2024

Lập trình đơn giản

 func functionName(){what to do}

Muốn lấy giá trị nào đó từ button thì dùng sender. ví dụ: print(sender.blackgroundColor)


Array:

let ArrayName = [A,B,C]

Lấy giá trị ngẫu nhiên trong Array

ImageView1.image = ArrayName[Int.random(in: 0...5)]


  • To assign data type to a variable, we add a colon after variable name

var myage: String = "Ten"

No comments:

Post a Comment

How to connect to VPS with Private Key on Mac OS

1. Use the cd command to navigate to the directory where your private key file is stored. For example, if your private key is in the Downlo...