8_Times_Tables
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的更多相关文章
随机推荐
- cdh 上安装spark on yarn
在cdh 上安装spark on yarn 还是比较简单的,不需要独立安装什么模块或者组件. 安装服务 选择on yarn 模式:上面 Spark 在spark 服务中添加 在yarn 服务中添加 g ...
- qrcode各版本/各类型容量支持表
1.qrcode共有40个版本,支持各种类型数据.个人一般统一转换成8位字节进行算法存储.(汉字 --uff8占用3个字节)
- Algorithms 4th - 1.1 Basic Programming Model - EXERCISES
欢迎交流 1.1.1 a. 7 b. 200.0000002 c. true 1.1.2 a. 1.618 b. 10.0 c. true d. 33 1.1.3 public class MainA ...
- PHP设计模式之单例模式(数据库访问)
1.什么是单例模式? 作为对象的创建模式,单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统全局地提供这个实例.它不会创建实例副本,而是会向单例类内部存储的实例返回一个引用. 2.单例模式的 ...
- 纯css3实现tab选项卡
<!doctype html> <html> <head> <title>Welcome</title> <meta http-equ ...
- APP分享抓取网页图片
var getShareImages = { defaultimg:"defaultimg.png", _allImgs:null, init:function(){ getSha ...
- DB2 相关操作
查看数据库版本:db2level DB21061E Command line environment not initialized. windows命令行下,需要先调用db2cmd,或者DB2 ...
- 关系数据库标准语言SQL的基本问答
1 .试述 sQL 语言的特点. 答: (l)综合统一. sQL 语言集数据定义语言 DDL .数据操纵语言 DML .数据控制语言 DCL 的功能于一体. (2)高度非过程化.用 sQL 语言进行数 ...
- sqlserver 分页sql语句
select * from (select *,row_number() over(order by CONTENT_ID ) as rnum from ArchiveContents) t whe ...
- codeforces 665D Simple Subset
题目链接 给一个数列, 让你选出其中的m个数, 使得选出的数中任意两个数之和都为质数, m尽可能的大. 首先, 除了1以外的任意两个相同的数相加结果都不是质数. 然后, 不考虑1的话, 选出的数的个数 ...