xcode常用项目模板

xcode常用的项目模板中,主要有以下几类


首先来讲一下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"]
之后就是这样了



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值