Var table: UITableView!

var table: UITableView!
UITableView? Is the optional UITableView type, then UITableView! What does it mean?

Mar.10,2021

! Indicates that this property cannot be empty, so you can use it without ? or unpacking
var table: UITableView!
if you declare it like this, then you must initialize the table, in the viewDidload or initialization method, otherwise you will collapse the property directly if you access it directly.


is also optional, but you can be sure it has a value when you use it. In this way, you can directly use tableView instead of tableView! Or if let tabel = tableView.

Menu