专题 - GCD 介绍与使用(一)
变更记录
序号
录入时间
录入人
备注
1
2015-03-02
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
3
2016-05-06
Alfred Jiang
更新 dispatch_group_enter() 和 dispatch_group_leave() 成对出现备注说明
方案名称专题 - GCD 介绍与使用(一)
关键字专题 \ Block \ Dispatch \ GCD \ 异步 \ 并行
需求场景
单例模式(dispatch_once)
延时执行(dispatch_after)
队列需求(dispatch_queue_create)
孤立队列
迭代执行
组(dispatch_group_create)
事件源
输入输出
基准测试
原子操作
动画
回调
异步
参考链接
CocoaChina - Objc的底层并发API
CSDN - 初探swift语言的学习笔记十
《Blocks编程要点》
简书 - 深入研究Block捕获外部变量和__block实现原理(推荐)
简书 - 深入研究Block用weakS ...
手势 - 实现手势操作介绍
变更记录
序号
录入时间
录入人
备注
1
2015-04-25
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称手势 - 实现手势操作介绍
关键字手势 \ Gesture Recognizer \ 手势操作
需求场景
需要对页面增加手势操作响应时
参考链接
Apple documentation
iOS手势识别的详细使用:拖动、缩放、旋转、点击、手势依赖、自定义手势
UIGestureRecognizer Tutorial in iOS 5: Pinches, Pans, and More!
详细内容SDK 提供的手势
序号
手势
Class
说明
1
Tap Gesture Recognizer
UITapGestureRecognizer
点击手势
2
Pinch Gesture Recognizer
UIPinchGestureRecognizer
二指往內或往外拨动,平时经常用到的缩放
3
Rotation Gesture Recognizer
UIRotationGestureRecogn ...
UITableViewCell - 动态修改 UITableViewCell 高度
变更记录
序号
录入时间
录入人
备注
1
2015-04-01
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称UITableViewCell - 动态修改 UITableViewCell 高度
关键字UITableViewCell \ UITableView \ 高度 \ 动态调整高度
需求场景
需要根据不同内容动态显示 Cell 高度时
参考链接
动态计算UITableViewCell高度详解
使用Autolayout实现UITableView的Cell动态布局和高度动态改变
详细内容#####1. 基本原理
通过对 UITableViewCell 中显示文字相关控件大小的计算,得出理想的显示控件大小;
根据显示控件大小,计算出合适的 Cell 高度;
在 UITableView reloadData 时,通过 UITableView 的 heightForRowAtIndexPath 方法返回合适的 Cell 高度。
#####2. 示例
######1. Swift 示例
示例一 : 使用 sizeTha ...
UIButton - 使用 RNLoadingButton 实现等待按钮
变更记录
序号
录入时间
录入人
备注
1
2015-04-02
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称UIButton - 使用 RNLoadingButton 实现等待按钮
关键字UIButton \ 等待 \ 按钮
需求场景
实现一个显示等待状态的按钮
参考链接
GitHub - RNLoadingButton-Swift
GitHub - RNLoadingButton
详细内容用法示例
12345678910111213//Mark: Can usage with Nib// Configure Statebtn1.hideTextWhenLoading = falsebtn1.loading = falsebtn1.activityIndicatorAlignment = RNActivityIndicatorAlignment.Rightbtn1.activityIndicatorEdgeInsets = UIEdgeInsetsMake(0, 50, 0, 10)btn1.setTitle(& ...
Keychain - 使用 PDKeychainBindingsController 实现 Keychain 保存数据封装
变更记录
序号
录入时间
录入人
备注
1
2015-04-02
Alfred Jiang
-
2
2015-09-09
Alfred Jiang
-
3
2015-12-23
Alfred Jiang
-
方案名称Keychain - 使用 PDKeychainBindingsController 实现 Keychain 保存数据封装
关键字Keychain \ 秘钥 \ 安全保存用户密码
需求场景
需要保存秘钥串类字串,保证在应用被删除时亦不会消失的需求
安全保存用户密码到 keychain 中的需求
参考链接
GitHub - PDKeychainBindingsController
详细内容确保保存的信息在应用关闭甚至被删除时依然保存在本机
将以下文件加入工程
1234PDKeychainBindings.hPDKeychainBindings.mPDKeychainBindingsController.hPDKeychainBindingsController.m
引入头文件
1#import "PDKeychainBindings.h ...
动画 - 使用 POViewFrameBuilder 快速实现 UIView 的动画移动和布局
变更记录
序号
录入时间
录入人
备注
1
2015-04-03
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称动画 - 使用 POViewFrameBuilder 快速实现 UIView 的动画移动和布局
关键字动画 \ UIView \ Layout \ Animation
需求场景
动画实现子 UIView 的布局动画和动画移动效果
参考链接
GitHub - POViewFrameBuilder
详细内容
将 POViewFrameBuilder 文件加入工程
引入 UIView+POViewFrameBuilder.h 头文件
使用示例12345678//Resizing a view:[view.po_frameBuilder setWidth:100.0f height:40.0f];//Moving a view to be centered within it's superview:[view.po_frameBuilder centerInSuperview];//You can co ...
数据存储 - 使用 SSZipArchive 实现文件的压缩和解压缩
变更记录
序号
录入时间
录入人
备注
1
2015-04-03
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称数据存储 - 使用 SSZipArchive 实现文件的压缩和解压缩
关键字数据存储 \ 文件 \ 压缩 \ 解压缩 \ zip \ unzip
需求场景
需要对文件进行压缩和解压缩操作时
参考链接
GitHub - SSZipArchive
详细内容
将 SSZipArchive 文件加入工程
引入 SSZipArchive.h 头文件
添加 libz.dylib 库
用法123456789101112// UnzippingNSString *zipPath = @"path_to_your_zip_file";NSString *destinationPath = @"path_to_the_folder_where_you_want_it_unzipped";[SSZipArchive unzipFileAtPath:zipPath toDestination ...
正则表达式 - 在 iOS 开发中使用正则表达式
变更记录
序号
录入时间
录入人
备注
1
2015-03-02
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
3
2016-11-15
Alfred Jiang
-
方案名称正则表达式 - 在 iOS 开发中使用正则表达式
关键字正则表达式 \ Email 验证 \ ip 验证 \ 域名验证 \ 手机号码验证 \ 输入验证 \ NSString
需求场景
需要对字符串进行正则相关的验证时
参考链接
RegexKit Framework
RegexKitLite
博客园 - iOS NSPredicate和正则表达式
Regexper : 正则表达式可视化
deerchao - 正则表达式30分钟入门教程
详细内容正则表达式的相关语法Google Analytics Regex and Keyboard Shortcuts Desktop Backgrounds
使用方法
去 RegexKitLite 下载类库,解压出来会有一个例子包及 2 个文件,其实用到的就这 2 个文件,添加到工程中。
工程中添加 libicuc ...
Auto Layout - 手动添加 Auto Layout 约束(Masonry)
变更记录
序号
录入时间
录入人
备注
1
2015-04-08
Alfred Jiang
-
2
2015-08-18
Alfred Jiang
更新OC示例
3
2015-12-08
Alfred Jiang
添加 Masonry 相关
4
2015-12-23
Alfred Jiang
-
4
2015-03-08
Alfred Jiang
添加 Masonry 备注相关
方案名称Auto Layout - 手动添加 Auto Layout 约束(Masonry)
关键字Auto Layout \ 约束 \ Constraint \ 自动布局 \ 页面布局 \ Masonry
需求场景
部分页面或控件的代码载入需要实现代码添加约束
参考链接
Github - Masonry
CSDN - Auto Layout 进阶
简书 - 追求Masonry
Autolayout的第一次亲密接触
有趣的Autolayout示例-Masonry实现
详细内容#####1. 系统提供的代码添加约束方法
首先设置 View 的 translatesAutores ...
JSON - 使用 JSONHelper 进行 JSON 数据解析
变更记录
序号
录入时间
录入人
备注
1
2015-04-09
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称JSON - 使用 JSONHelper 进行 JSON 数据解析
关键字JSON \ JSONHelper \ 解析 \ 网络返回数据
需求场景
解析由网络返回的 JSON 格式数据
参考链接
GitHub - JSONHelper
详细内容#####1. 将 JSONHelper.swift 文件加入工程
#####2. 自定义的解析数据模型需要实现 Deserializable 协议
示例一
1234567891011121314151617181920212223242526272829//定义internal struct Movie: Deserializable { var name: String? // You can also use let instead of var if you want. var releaseDate: NSDate? init(data: ...