Swift
文章平均质量分 88
LTOVE-CODE
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
AutoLayout代码适配之VFL
NSLayoutConstraint的第二个类方法+ (NSArray *)constraintsWithVisualFormat:(NSString *)format options:(NSLayoutFormatOptions)opts metrics:(原创 2016-11-04 11:56:31 · 511 阅读 · 0 评论 -
swift 学习小笔记之控件
1.UIButton1> 增加addtarget事件//不传递触摸对象(即点击的按钮)button.addTarget(self, action:#selector(tapped), for:.touchUpInside)func tapped(){ print("tapped")} //传递触摸对象(即点击的按钮),需要在定义action参数时,方法名称后面带上冒原创 2016-12-06 12:01:26 · 365 阅读 · 0 评论 -
swift 之使用第三方框架 cocoapods
platform :ios, '7.0'inhibit_all_warnings!use_frameworks! //可以直接在swift文件里 import 第三方框架source 'https://github.com/cocoapods/specs.git'target 'swift---' dopod 'Masonry'end原创 2016-12-06 14:33:28 · 385 阅读 · 0 评论 -
swift 学习小笔记之语法
1.for循环let str = "--Str" for index in 0 ..< indexPath.row { print( "索引 [\(index)] 对应的值为 \(str+"11")") }原创 2016-12-07 11:26:48 · 358 阅读 · 0 评论 -
Swift 新的访问控制fileprivate和open
在swift 3中新增加了两种访问控制权限 fileprivate和 open。下面将对这两种新增访问控制做详细介绍。fileprivate在原有的swift中的 private其实并不是真正的私有,如果一个变量定义为private,在同一个文件中的其他类依然是可以访问到的。这个场景在使用extension的时候很明显。class User { privat原创 2016-12-07 14:49:34 · 488 阅读 · 0 评论 -
swift 尾随闭包
{ func myMentue(name:String) -> Void { print("实例方法\(name)") } func myblock(_ param:(_ make:String) -> Void) -> Void { param("MyBolcCpde") } func blocData(_ resourc原创 2016-12-07 16:44:00 · 695 阅读 · 0 评论
分享