• 7_Table Views


    7

    //
    //  ViewController.swift
    //  Table Views
    //
    //  Created by ZC on 16/1/9.
    //  Copyright © 2016年 ZC. All rights reserved.
    //
    
    import UIKit
    
    class ViewController: UIViewController, UITableViewDelegate {
        
        var viewContent = ["apple","banana","pear","peach","watermelon"]
        
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
        }
    
        func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
            
            return viewContent.count
            
        }
        
        func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
            
            let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")
            
            cell.textLabel?.text = viewContent[indexPath.row]
            
            return cell
            
        }
        
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    
    
    }
    

    项目:7_Table Views

  • 相关阅读:
    miniprogramer--ajax
    miniprogram 获取两点之间的距离(经纬度)
    express node-schedule
    express generate xls
    protected default
    Java UUID
    关于轮播图兼容的问题
    关于git上的一些错误信息
    cookie
    关于ajax原理介绍
  • 原文地址:https://www.cnblogs.com/zcdll/p/5161042.html
Copyright © 2020-2023  润新知