iOS_Apprentice_2_Checklists学习总结(2)
来源:互联网 发布:魏氏熏鸡淘宝网 编辑:程序博客网 时间:2024/06/14 06:46
今天学习了添加按钮和AddItem.swift的编写,由于有很多需要设置的东西不太好写上来,就只上代码了
AddItemViewController.swift
import UIKit
class AddItemViewController: UITableViewController, UITextFieldDelegate {
@IBAction fun cancel() {
dismissViewControllerAnimated(true, completion: nil)
}
@IBAction func done() {
dismissViewControllerAnimated(true, completion: nil)
}
@IBOutlet weak var doneBarButton: UIBarButtonItem!
override func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? {
return nil
}
func textField(textField: UITextField, shouldCharactersInRange range: NSRange, replacementString string:String) -> Bool {
let oldText: NSString = textField.text
let newText: NSString = oldText.stringByReplacingCharactersInRange(range, withString: string)
doneBarButton.enabled = (newtext.length > 0)
return true
}
}
- iOS_Apprentice_2_Checklists学习总结(2)
- iOS_Apprentice_2_Checklists学习总结(1)
- iOS_Apprentice_2_Checklists学习总结(4)
- iOS_Apprentice_2_Checklists学习总结(3) protocol解释
- iOS_Apprentice_2_Checklists学习总结(6)输入/输出存储数据
- iOS_Apprentice_2_Checklists学习总结(5)建立存储数据用的路径
- 最近学习总结(2)
- YUI学习总结(2)
- VBA学习总结(2)
- dom4j学习总结(2)
- Linux学习总结(2)
- Hibernate学习总结(2)
- zabbix学习总结(2)
- 阶段性学习总结(2)
- JAVA学习总结(2)
- python学习总结(2)
- 学习阶段总结(2)
- JPA学习总结(续)(2)
- 数据库设计三大范式
- 第十一周项目六——回文,素数(1)
- Java op= 运算符
- Linux内核的时钟中断(2)
- TC/UDPP网络编程
- iOS_Apprentice_2_Checklists学习总结(2)
- oracle中常用的单行函数
- Android实现仿QQ5.0的侧滑效果
- 多态
- 搭建android开发环境
- 深入理解abstract class和interface
- Linux内核的时钟中断(3)
- 获取指定应用线上版本信息
- 2014-11-6Android学习------苹果切水果游戏手指滑动效果实现--------动画Animation学习篇