会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ZhangShengjie
学无止境
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
9
10
11
12
13
14
15
下一页
2017年5月9日
Function types cannot have argument labels 错误解决方案
摘要: 今天在封装网络工具类的时候 报错了 经过分析发现是在Swift3.0 把闭包的入参的参数名去掉就好了
阅读全文
posted @ 2017-05-09 00:26 ZhangShengjie
阅读(2525)
评论(0)
推荐(0)
2017年5月8日
CocoaPods 使用详解
摘要: 原理介绍 CocoaPods 地址 https://github.com/CocoaPods/CocoaPods CocoaPods 索引地址 https://github.com/CocoaPods/Specs 安装好了CocoaPods 之后 下载 CocoaPods的索引到本地 索引中有pod
阅读全文
posted @ 2017-05-08 16:14 ZhangShengjie
阅读(891)
评论(0)
推荐(0)
2017年5月7日
try? try! try do catch try 使用详解
摘要: 当一个使用一个方法发现后面 throws 说明可能会抛出异常 需要try 进行处理 1 try? 如果解析成功就有值 否则返回nil (推荐) 2 try! 如果解析成功就有值 否则直接崩溃 (不推荐) 3 try 如果 如果解析成功就有值 如果出错 能够处理异常 输出错误 do try catch
阅读全文
posted @ 2017-05-07 18:43 ZhangShengjie
阅读(505)
评论(0)
推荐(0)
2017年5月5日
Swift Write to file 到电脑桌面
摘要: (arr as NSArray).write(toFile: "Users/你的用户名/Desktop/mian.plist", atomically: true)
阅读全文
posted @ 2017-05-05 17:27 ZhangShengjie
阅读(470)
评论(0)
推荐(0)
2017年5月4日
NSLayoutConstraint 使用详解 VFL使用介绍
摘要: 注意 使用前必须先取消所有的你想设置View 的 Autoresizing 属性 因为 Autoresizing Layout不能共存 系统默认是 Autoresizing 自动布局核心公式 自动布局构造函数 如果指定宽 高 约束 参照视图设置为 nil 参照属性选择 .NotAnAttribute
阅读全文
posted @ 2017-05-04 18:14 ZhangShengjie
阅读(695)
评论(0)
推荐(0)
automaticallyAdjustsScrollViewInsets 详解
摘要: automaticallyAdjustsScrollViewInsets 自动缩进 20 像素 默认是 True 项目中如果有UIViewController 和ScrollView 一般都要设置成false
阅读全文
posted @ 2017-05-04 15:01 ZhangShengjie
阅读(223)
评论(0)
推荐(0)
Swift 给UITableView 写extension 时 报错 does not conform to protocol 'UITableViewDataSource'
摘要: 那是因为你没有实现 数据源和代理方法 实现下就好了
阅读全文
posted @ 2017-05-04 12:44 ZhangShengjie
阅读(2324)
评论(1)
推荐(0)
2017年5月3日
OC Swift中检查代码行数
摘要: 1 打开终端 cd 进去当前项目 2 总行数查看命令 find . -name "*.m" -or -name "*.h" | xargs wc -l "*.m"是你想查看的文件名 同理".swift"代表swift文件 3 总行数除去空行查看命令 find . -name "*.m" -or -n
阅读全文
posted @ 2017-05-03 21:58 ZhangShengjie
阅读(608)
评论(0)
推荐(0)
UINavigationController 、navigationBar 、 UINavigationItem、UIBarButtonItem之间的关系
摘要:
阅读全文
posted @ 2017-05-03 21:45 ZhangShengjie
阅读(252)
评论(0)
推荐(0)
Swift中 @objc 使用介绍
摘要: 在swift 中 如果一个按钮添加点击方法 如果定义为Private 或者 定义为 FilePrivate 那么会在Addtaget方法中找不到私有方法 但是又不想把方法暴露出来,避免外界访问 ,那么可以在私有方法前加 @objc 修饰 那么它就能找到那个方法了 @objc 作用 1 filepri
阅读全文
posted @ 2017-05-03 11:08 ZhangShengjie
阅读(6532)
评论(0)
推荐(0)
上一页
1
···
9
10
11
12
13
14
15
下一页
公告