下為應用程式設計、圖片,以及撰寫了一些程式的說明及教學。
(1) 你必須在 Storyboard 當中選擇你要設定圓角的元件。
(2) 在右邊選擇 Show the Identity inspector (一個報紙的 icon) 的選單
(3) 在 User Defined Runtime Attributes 當中新增一個 Key Path
(4) Key Path = layer.cornerRadius
(5) Type = Number
(6) Value = 圓角的長度
// 在全域建構 UILabel 元件
@IBOutlet weak var label: UILabel!
// 賦予資訊
self.label.text = "Text"
// 在全域建構 UIButton 元件
@IBOutlet weak var button: UIButton!
// 賦予資訊
self.button.setTitle("Text", for: .normal)
// 讀取記事本
let preferences = UserDefaults.standard
// 在記事本上寫入一個 Key&Value
self.preferences.setValue("value", forKey: "Key")
// 儲存記事本資訊
preferences.synchronize()
self.變數 = self.preferences.object(forKey: "Key")
// 取得現在時間 = DispatchTime.now()
// 定義一個時間 = DispatchTime.init(uptimeNanoseconds: <#T##UInt64#>)
// 定義一個秒數 = .seconds(Int)
// 定義一個毫秒數 = .milliseconds(Int)
DispatchQueue.main.asyncAfter(deadline: Time) {
// Code ...
}