| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // ContactViewController.swift
- // SocketChat
- //
- // Created by Justine on 16/5/27.
- // Copyright © 2016年 AppCoda. All rights reserved.
- //
- import UIKit
- class ContactViewController: UIViewController,UITableViewDelegate,UITableViewDataSource {
- var tableView:UITableView?
- var dataList = NSMutableArray()
- override func viewDidLoad() {
- super.viewDidLoad()
- self.view.backgroundColor = UIColor.greenColor()
- // Do any additional setup after loading the view.
- self.tableView?.dataSource = self
- self.tableView?.delegate = self
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
-
- /*
- // MARK: - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
- // Get the new view controller using segue.destinationViewController.
- // Pass the selected object to the new view controller.
- }
- */
- //实现继承的委托中的两个方法
- func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{
- return 100;
- }
-
- //返回Cell
- func tableView(tableView:UITableView, cellForRowAtIndexPath indexPath:NSIndexPath)->UITableViewCell{
- //根据需求自己重绘
- let cell = UITableViewCell(style: .Default, reuseIdentifier: "cell")
- // let cellID="Cell ID";
- // var cell=tableView.dequeueReusableCellWithIdentifier(cellID) as? UITableViewCell;
- //
- return cell;
- }
- }
|