//
//  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. PHP安全性漫谈

    最近刚做完两个PHP的网站项目,客户虽然没有安全性的相关需求,但是自己不能放过对自己的要求,何况对以后做电子商务的项目相当有帮助,呵呵,早准备早超生,经过查看PHP 帮助和相关资料~~~~       ...

  2. 大数据框架hadoop的序列化机制

    Java内建序列化机制 在Windows系统上序列化的Java对象,可以在UNIX系统上被重建出来,不需要担心不同机器上的数据表示方法,也不需要担心字节排列次序. 在Java中,使一个类的实例可被序列 ...

  3. 基于C#的微信公众平台开发系列1

    1.首先服务器地址及Token验证: Token验证请求地址wx.ashx代码: using System; using System.Web; public class wx : IHttpHand ...

  4. word文档批量合并工具

    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; En ...

  5. Rancher的安装配置

    1.基于Docker镜像安装Rancher Rancher 服务器是一个 Docker image,所以其软件本身不需要安装,只需要执行 Docker 命令下载并且成功运行 Docker 服务器镜像即 ...

  6. CFGym 100198G 题解

    一.题目链接 http://codeforces.com/gym/100198/problem/G 二.题意 看样例就能明白,写表达式解析器. 三 .思路 一看这题目,立马就会想到“后缀表达式”,考虑 ...

  7. C# CS1591 缺少对公共可见类型或成员的 XML 注释 问题解决

    最近在写web api的项目,用到微软的Web api help page组件,用于自动对生成API文档,见博文: https://www.cnblogs.com/lenmom/p/9081363.h ...

  8. cannot nest '/dubboService/src/main/resources' inside '/dubboService/src/main' .To enable the nesting exclude '/resources' from '/dubboService/src/main'

    eclipse Maven--->update Project时出现以上错误: cannot nest '/dubboService/src/main/resources' inside '/d ...

  9. dsm winscp 获得 root 权限修改上传文件

    使用DSM开了ssh只可以用admin登陆scp没有权限上传文件.可以用以下方法. ssh 登陆 dsm sudo -i  取得root权限 修改 /etc/sudoers 文件中 %administ ...

  10. python portia

    docker run -i -t --rm -v <PROJECTS_FOLDER>:/app/data/projects:rw -p 9001:9001 scrapinghub/port ...