8

//
// ViewController.swift
// Times Tables
//
// Created by ZC on 16/1/9.
// Copyright © 2016年 ZC. All rights reserved.
// import UIKit class ViewController: UIViewController, UITableViewDelegate { @IBOutlet weak var sliderValue: UISlider! @IBOutlet weak var result: UITableView! @IBAction func sliderMoved(sender: AnyObject) { result.reloadData() } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 20 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cells") let timesTable = Int(sliderValue.value * 20) cell.textLabel?.text = String(timesTable * (indexPath.row + 1)) return cell } override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
} override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}

项目:8_Times Tables

8_Times_Tables的更多相关文章

随机推荐

  1. JVM学习之强引用、弱引用、软引用、虚引用

    转自:http://my.oschina.net/ydsakyclguozi/blog/404389 多谢博主分享 1.强引用(StrongReference) 强引用是使用最普遍的引用.如果一个对象 ...

  2. OC语法3——点语法,self关键字

    点语法:   为了给程序员提供便捷,OC中也引入了点语法.不过它和Java中点语法的意义是完全不同的. 在Java中无论调用任何方法,还是访问public类型的成员变量都是用点语法(.号). 而在OC ...

  3. Centos6.5源码编译安装nginx

    1.安装pcre下载地址:http://jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz #tar -axvf pcre ...

  4. win8VPN

    上一章已经讲过Windows2008RT搭建VPN服务器搭建过程,接下来说一下win8的VPN登录 这里是win2008的VPN连接过程 先说win8的VPN登录过程.同样也很简单步骤和2008的差不 ...

  5. jmake 编译当前目录所有c/c++单文件

    在一个目录下写一些单文件的c或者c++文件时,每次敲出命令如g++ a.cpp -o a感觉比较麻烦. 所以就模仿makefile的功能,实现了扫描当前目录,并将所有c文件.cc文件.cpp文件直接调 ...

  6. 搭建Android开发环境之——Android4.0.3, 4.1, 4.2, 4.3, 4.x,及升级 ADT(22.0.5)和SDK(22.x)

    1.首先要下载相关的软件 1). JDK 6 以上 2). eclipse( Version 3.6.2  or higher ) 点击下载 3). SDK(android-sdk_r18-windo ...

  7. logrotate 清理tomcat日志

    rsyslog tomcat 服务器: 192.168.32.215 input(type="imfile" File="/usr/local/apache-tomcat ...

  8. MojoliciousLite: 实时的web框架 概述

    MojoliciousLite: 实时的web框架: SYNOPSIS 简介: # Automatically enables "strict", "warnings&q ...

  9. NOI2015 Day2

    NOI2015 Day2 荷马史诗 题目描述:给出\(n\)个数,要求\(n\)个\(k\)进制数来对应这\(k\)个数(允许有前导零),\(n\)个\(k\)进制数互不为前缀,求\(n\)个数乘以对 ...

  10. chroot 的用途

    http://www.ibm.com/developerworks/cn/linux/l-cn-chroot/ http://liyongxian.blog.51cto.com/432519/1126 ...