xcode常用项目模板
2015-11-13 20:58
411 查看
xcode常用的项目模板中,主要有以下几类
首先来讲一下master detail application 其主要是为创建日志的时候可以应用 其主要也是有两个按钮 一个是添加的按钮 一个是消除的按钮 其中可以在代码中修改 使其不具备增加或修改的能力
打开masterviewcontroller.swift文件
这里才是真正的主代码,代码的审核通过这里 若全部注释掉 则没有功能了
pagebasedapplication 主要用于作为电子书的模板
打开ModelController.swift可以在其中修改数据源 pageData
首先来讲一下master detail application 其主要是为创建日志的时候可以应用 其主要也是有两个按钮 一个是添加的按钮 一个是消除的按钮 其中可以在代码中修改 使其不具备增加或修改的能力
打开masterviewcontroller.swift文件
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool { // Return false if you do not want the specified item to be editable. return false }这个是是否可以进行修改
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if editingStyle == .Delete { objects.removeAtIndex(indexPath.row) tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) } else if editingStyle == .Insert { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. } } }
这里才是真正的主代码,代码的审核通过这里 若全部注释掉 则没有功能了
pagebasedapplication 主要用于作为电子书的模板
打开ModelController.swift可以在其中修改数据源 pageData
pageData = ["cao","kai","qiang"]之后就是这样了
相关文章推荐
- word 2003如何嵌入endnote菜单
- 第九章 JSP标签
- 第十章 会话管理
- (5)创建版本库
- 每天学一点easyui①
- Post方式的Http流请求调用
- jquery 禁止herf跳转,并执行相应的js代码
- MongoDB的用户、认证和权限
- java输入输出流概要
- 【译】17个提升iOS开发效率的必用工具
- 第八章 拦截器机制
- hdu acm 1075 What Are You Talking About
- 池化方法总结(Pooling)
- NOI 2008 志愿者招募 BZOJ 1061
- ios6.1&ios7&ios9判断沙盒文件或者目录是否存在,以及判断是文件还是目录的一个隐藏问题
- 初识widget桌面小组件
- 第六章 Realm及相关对象
- 第七章 与Web集成
- Toad创建DBLINKsop
- 开始使用C++11的几个理由