swift开发知识点滴

来源:互联网 发布:淘宝会员名大全简单 编辑:程序博客网 时间:2024/06/02 07:09

用swift开发时不用导入具体的类也可以使用其他类的方法

 // UITableView DataSource

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

       return todoManager.todos.count;

    }



    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

        let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier:"Default")


        cell.textLabel?.text = todoManager.todos[indexPath.row].name

        cell.detailTextLabel?.text = todoManager.todos[indexPath.row].desc


        return cell

    }


0 0
原创粉丝点击