懒加载控件刚开始只展示一个tableview的;
// 懒加载tableview
lazy var table : UITableView = self.tableView()
func tableView() -> UITableView {
self.table = UITableView(frame: CGRect.init(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height), style: UITableViewStyle.grouped);
self.table.delegate = self;
self.table.dataSource = self;
return table;
}
调用:
self.view.addSubview(self.table);