上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页
摘要: KVC 其实就是键值编码 1、赋值其实就两个方法 setValue: forKey 给对象的某个属性值赋值 setValue:forKeyPath 给对象的某个属性中的属性赋值 2、获取值其实也是两个方法 valueForKey 获取对象的某个属性值 valueForKeyPath 获取对象的某个属 阅读全文
posted @ 2019-12-26 00:55 ZhangShengjie 阅读(299) 评论(0) 推荐(0)
摘要: 基本原理-> 给一个对象的属性添加监听 当属性值发生变化时 会触发监听器的监听的方法 #import "ViewController.h" #import "Person.h" @interface ViewController () @property (nonatomic, strong) Pe 阅读全文
posted @ 2019-12-25 00:36 ZhangShengjie 阅读(375) 评论(0) 推荐(0)
摘要: 最终效果图 item2地址 https://iterm2.com 下载item2配色包 http://iterm2colorschemes.com 下载然后倒入到item2中 使用的颜色是 在配合oh my zsh GitHub地址 https://github.com/ohmyzsh/ohmyzs 阅读全文
posted @ 2019-12-10 13:30 ZhangShengjie 阅读(604) 评论(0) 推荐(0)
摘要: 1、可选项 一般也叫可选类型,它允许将值设置为nil 在类型名称后面加个问号? 来定义一个可选项 2、强制解包(Forced Unwrapping) 可选项是对其他类型的一层封装,可以理解它为一个盒子 如果为nil,那么他就是空盒子 如果不为nil,那么盒子里装的是:被包装的数据类型 3、可选项绑定 阅读全文
posted @ 2019-08-14 18:02 ZhangShengjie 阅读(470) 评论(0) 推荐(0)
摘要: 1、基本用法 //enum direction { // case north // case south // case west // case east //} 等价于下面写法 enum direction { case north,south,west,east } var dir = di 阅读全文
posted @ 2019-08-12 17:54 ZhangShengjie 阅读(1263) 评论(0) 推荐(0)
摘要: 1、函数的定义 2、隐式返回 3、元组返回、实现多返回值 4、参数标签 5、默认参数值 6、可变参数 7、Swift 自带的 print 函数 8、 inout 可以用inout定义一个输入输出参数:可以在函数内部修改外部实参的值 可变参数不能标记为inout inout参数不能有默认值 inout 阅读全文
posted @ 2019-08-08 18:08 ZhangShengjie 阅读(370) 评论(0) 推荐(0)
摘要: 1、if else 注意:if 后面的小括号可以省略、条件后面的大括号不能省略 if 条件后面只能跟bool类型 2、while repeat while 相当于c语言中的do while 这里不用age-- 是因为从swift3开始,去除了自增(++)、自减(--)运算符 3、for let na 阅读全文
posted @ 2019-07-24 18:03 ZhangShengjie 阅读(204) 评论(0) 推荐(0)
摘要: 1. var 定义变量 let 定义常量 2、定义变量和常量如果初始化不赋值 那么必须声明其数据类型 如 var a : Int 3、常量 let 它的值不要求在编译时期确定,但是使用之前必须赋值一次 // 布尔 let bool = true //字符串 let string = "123" // 阅读全文
posted @ 2019-07-10 17:36 ZhangShengjie 阅读(174) 评论(0) 推荐(0)
摘要: AVAsset *asset = [AVAsset assetWithURL:url]; NSArray *tracks = [asset tracksWithMediaType:AVMediaTypeVideo]; AVAssetTrack *videoTrack = tracks[0]; CGSize videoSize = CGSizeApplyAffineTran... 阅读全文
posted @ 2019-05-06 19:15 ZhangShengjie 阅读(699) 评论(0) 推荐(0)
摘要: 1、GitHub下载是指向了Amazon的服务器 下载地址是http://github-cloud.s3.amazonaws.com/ 解决方案是更改host文件,使该域名指向香港的服务器 2、去 https://www.ipaddress.com/ 查看 github.com和github.glo 阅读全文
posted @ 2019-04-23 11:37 ZhangShengjie 阅读(5064) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页