Swift注释
//MARK: 对方法注释
//MARK: -创建 TableView
func createTableView() {
tableViewPlain = UITableView(frame: CGRect(x: 0, y: 70, width: KScreenWidth / 2, height: KScreenHeight - 70), style: .plain)
tableViewPlain.delegate = self
tableViewPlain.dataSource = self
tableViewPlain.tableFooterView = UIView()
self.view.addSubview(tableViewPlain)
}
//TODO: 有待完成的代码
//TODO: -CollectionView 创建
func createCollectionView() {
let layout = UICollectionViewFlowLayout()
layout.itemSize = CGSize(width: 50, height: 40)
layout.minimumLineSpacing = 10
layout.minimumInteritemSpacing = 20
layout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10)
collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight), collectionViewLayout: layout)
collectionView.delegate = self
collectionView.dataSource = self
indentity = "Cell"
collectionView.register(UINib(nibName: "Cell", bundle: nil), forCellWithReuseIdentifier: indentity)
view.addSubview(collectionView)
}
//FIXME: 代码修改过
//FIXME: -返回界面
func dismissAction(_ sender: UIButton) {
self.dismiss(animated: true) {
print("我退出了第一个界面" + "button tag:\(sender.tag)")
}
}