ios挖坑之路2

来源:互联网 发布:java实现邮件发送功能 编辑:程序博客网 时间:2024/05/30 23:12

tableview

uicontroller需要继承

UITableViewDelegate,UITableViewDataSource

实现

func tableView(_ tableView:UITableView, numberOfRowsInSection section:Int) -> Int {

        returnlistModel.count

    }

    func tableView(_ tableView:UITableView, cellForRowAt indexPath:IndexPath) -> UITableViewCell {

return cell

}

两个方法


tintcolor实现图片颜色更换


子类继承父类的xib

在子类中重写init方法

  overrideinit(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {

        super.init(nibName:"", bundle: nil)

    }

    

    requiredinit?(coder aDecoder: NSCoder) {

        fatalError("init(coder:) has not been implemented")

    }


原创粉丝点击