1.自定义cell
//
// FirstSwiftCell.swift
// SwiftDeKeYiCai
//
//
import UIKit
class FirstSwiftCell: UITableViewCell {
var titleLabel:UILabel?
var picImageVIew:UIImageView?
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.setUpUI()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
func setUpUI() {
self.titleLabel = UILabel.init()
self.titleLabel?.backgroundColor = UIColor.clear;
self.titleLabel?.frame = CGRect(x:65, y:0, width:100, height:50)
self.titleLabel?.textColor = UIColor.magenta
self.titleLabel?.text = "第一条显示的数据"
self.titleLabel?.font = UIFont.systemFont(ofSize: 15)
self.titleLabel?.textAlignment = NSTextAlignment.left;
self.contentView.addSubview(self