//
//  TwoViewController.swift
//  tab
//
//  Created by su on 15/12/7.
//  Copyright © 2015年 tian. All rights reserved.
//

import UIKit

class TwoViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {

override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.redColor()
        self.navigationItem.title = "bb"
       
        let tableView:UITableView = UITableView(frame: view.bounds, style: UITableViewStyle.Plain)
        tableView.registerNib(UINib(nibName: "TwoTableViewCell", bundle: nil), forCellReuseIdentifier: "TwoTableViewCell")
        tableView.delegate = self
        tableView.dataSource = self
        self.view.addSubview(tableView)
     }
   
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 4
    }
   
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("TwoTableViewCell", forIndexPath: indexPath) as! TwoTableViewCell
       
        cell.label!.text = "adddddddddddddddddddddddddddddd"
       
        return cell
    }
   
    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.
    }
    */

}

swift学习之UITabelView ----使用xib定义cell的更多相关文章

  1. swift学习之UITabelView ----UITableViewCell

    // //  OneViewController.swift //  tab // //  Created by su on 15/12/7. //  Copyright © 2015年 tian. ...

  2. [iOS]通过xib定义Cell然后关联UICollectionView

    先新建一个View的xib,然后删掉自动生成的View,拖进一个UICollectionCell,再新建一个对应的UIView继承UICollectionCell类. OK,接下来该连outlet的就 ...

  3. iOS深入学习(UITableView系列4:使用xib自定义cell)

    可以通过继承UITableViewCell重新自定义cell,可以像下面一样通过代码来自定义cell,但是手写代码总是很浪费时间, ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...

  4. Swift学习——类的定义,使用,继承,构造等(五)

    Swift学习--类的定义,使用.继承,构造等(五) 类的使用说明 1 使用class和类名来创建一个类名,比如: class student 2 类中属性的声明和常量和变量一样,唯一的差别就是他们的 ...

  5. iOS ---Swift学习与复习

    swift中文网 http://www.swiftv.cn http://swifter.tips/ http://objccn.io/ http://www.swiftmi.com/code4swi ...

  6. 12套swift学习资源分享

    虽然objective-c编程语言在过去很长一段时间都是iOS应用开发的基础语言,且很多iOS开发者对其也深爱有佳,但是随着swift编程语言的问世,迅速发展为开发者追捧的语言.且今年伴随着swift ...

  7. swift 学习之自动引用计数

    swift 学习之自动引用计数 学习和研究的主要是"实例对象和实例对象直接的相会强引用所产生的内从泄漏"和"使用闭包产生的强引用造成的内存泄漏" 注意:只有以引 ...

  8. Swift学习目录

    本学习基于苹果官方Swift学习材料,保留了原版90%左右的内容(一些项目开发中基本不用的知识点没有整理),并根据理解进行整理.如对原版感兴趣,可以直接单击链接阅读和学习. 第一部分 基础篇 1.基本 ...

  9. Swift学习笔记(十四)——字符,常量字符串与变量字符串

    在学习Java过程中,字符串碰到过String和StringBuffer,当中前者是不可变的,不能对字符串进行改动:后者是可变的,能够不断改动. 来到Swift中,对字符串的定义变的更加简单. (1) ...

随机推荐

  1. PLSQL在64位 win7/WIN8上运行(绿色版plsql、无需安装oracle客户端)

    一.准备需要的文件: 1.plsql文件绿色压缩包 2.oracle客户端文件绿色压缩包 二.设置PLSQL 运行plsql,不登陆进入plsql点“工具”-“首选项” 按照如图设置“ oracle主 ...

  2. 使用sublime text3手动安装插件

    众所周知,由于网络问题,使用install package可能会连不上服务器,这时候就不得不手动安装插件了. 其实sublime安装插件的原理就是当你搜索一个插件并安装的时候,它回去github找到这 ...

  3. Android网络请求

    HTTP请求与响应 HTTP请求包结构 例: POST /meme.php/home/user/login HTTP/1.1 Host: 114.215.86.90 Cache-Control: no ...

  4. C++ 函数特性_参数默认值

    函数参数默认值写法 有默认参数值的参数必须在参数表的最右边 ,) // 这是正确的写法 , int k) // 这是错误写法 先声明,后定义 在写函数时要先在代码前面声明,然后再去定义. 函数默认参数 ...

  5. Bootstrap-CL:面包屑导航

    ylbtech-Bootstrap-CL:面包屑导航 1.返回顶部 1. Bootstrap 面包屑导航(Breadcrumbs) 面包屑导航(Breadcrumbs)是一种基于网站层次信息的显示方式 ...

  6. Educational Codeforces Round 37-G.List Of Integers题解

    一.题目 二.题目链接 http://codeforces.com/contest/920/problem/G 三.题意 给定一个$t$,表示有t次查询.每次查询给定一个$x$, $p$, $k$,需 ...

  7. 生成Excel

    生成Excel 需要引用MyXls.SL2.dll的类库: 下载地址:http://sourceforge.net/projects/myxls/ 命名空间using org.in2bits.MyXl ...

  8. Java HashMap 遍历方式探讨

    JDK8之前,可以使用keySet或者entrySet来遍历HashMap,JDK8中引入了map.foreach来进行遍历. keySet其实是遍历了2次,一次是转为Iterator对象,另一次是从 ...

  9. PHP数组键值使用单引号和双引号和无符号的区别

    PHP数组键值使用单引号和双引号和无符号的区别 方法/步骤 1 第一种:$array['key']此单引号键值模式可以直接被解析为一个数组即$array 第二种:$array["key&qu ...

  10. canvas高级动画示例

    canvas高级动画示例 演示地址 https://qzruncode.github.io/example/index.html <!DOCTYPE html> <html lang ...