设计模式 - 使用命令模式实现撤销删除
变更记录
序号
录入时间
录入人
备注
1
2015-03-03
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称设计模式 - 使用命令模式实现撤销删除
关键字设计模式 \ 命令模式 \ 撤销删除
需求场景
较为复杂的撤销删除需求
参考链接
IOS设计模式之四(备忘录模式,命令模式)
详细内容命令模式将一个请求封装为一个对象。封装以后的请求会比原生的请求更加灵活,因为这些封装后的请求可以在多个对象之间传递,存储以便以后使用,还可以动态的修改,或者放进一个队列中。苹果通过 Target-Action 机制和 Invocation 实现命令模式。
123456789101112131415161718192021222324- (void)deleteAlbum{ // 1 Album *deletedAlbum = allAlbums[currentAlbumIndex]; // 2 NSMethodSignature *sig = [self methodSignatureForSel ...
网络 - iOS7 的多任务处理——后台获取(Background Fetch)
变更记录
序号
录入时间
录入人
备注
1
2015-03-03
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称网络 - iOS7 的多任务处理——后台获取(Background Fetch)
关键字网络 \ 多任务处理 \ 后台获取数据 \ Background Fetch \ Remote Notification
需求场景
在程序进入后台的情况下,如果你想要下载一部很大的视频以便离线观看,或者将用户图片备份到服务器时
参考链接
iOS 7系列译文:iOS7的多任务处理
详细内容
在 info plist 文件中的 UIBackgroundModes 健值指定使用的特性。1234<key>UIBackgroundModes</key><array><string>fetch</string></array>
最简单的途径是在 Xcode5 的 project editor 中新的性能标签页中(Capabilities tab)设置,这个标 ...
CoreData - 使用 FYHDBManager 管理 CoreData
变更记录
序号
录入时间
录入人
备注
1
2015-03-03
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称CoreData - 使用 FYHDBManager 管理 CoreData
关键字CoreData \ 数据库 \ FYHDBManager
需求场景
部分轻型小应用的数据库需求
参考链接(无)
详细内容#####定义
FYHDBHeader.h
12345678910111213141516171819//// FYHDBHeader.h// GrandJustice//// Created by Alfred Jiang on 3/3/15.// Copyright (c) 2015 FYH. All rights reserved.//#ifndef GrandJustice_FYHDBHeader_h#define GrandJustice_FYHDBHeader_h#define NAME_OF_SQLITE @"GrandJustice.sqlite"#define ...
通知 - iOS7 的多任务处理——远程通知(Remote Notifications)
变更记录
序号
录入时间
录入人
备注
1
2015-03-03
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称通知 - iOS7 的多任务处理——远程通知(Remote Notifications)
关键字通知 \ 多任务处理 \ 后台获取数据 \ Background Fetch \ Remote Notification
需求场景
需要获取服务器的通知时
参考链接
iOS 7系列译文:iOS7的多任务处理
详细内容
注册推送通知
1234- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UIApplication sharedApplication] registerForRemoteNotifications]; return YES;}
处理一个推送通知
12345678910111213141516 ...
动画 - Core Animation 之 CABaseAnimation
变更记录
序号
录入时间
录入人
备注
1
2015-03-04
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称动画 - Core Animation 之 CABaseAnimation
关键字动画 \ Core Animation \ CALayer \ CAAnimation \ CAPropertyAnimation \ CABaseAnimation \ CAKeyframeAnimation \ CATransition \ CAAnimationGroup
需求场景
使用 Core Animation 实现动画需求
参考链接
CSDN - CABasicAnimation的基本使用方法(移动·旋转·放大·缩小)
博客园 - CABasicAnimation animationWithKeyPath 一些规定的值
简书 - 干货系列之手把手教你使用Core animation 做动画 (推荐)
《核心动画编程指南》
详细内容#####1.继承关系
1234567891011@interface CAAnim ...
网络 - 使用 AFNetworking 实现网络请求
变更记录
序号
录入时间
录入人
备注
1
2015-03-05
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称网络 - 使用 AFNetworking 实现网络请求
关键字网络 \ AFNetworking \ 网络编程 \ 网络请求
需求场景
需要实现网络交互的需求时
参考链接
GitHub - AFNetworking
AFNetworking
AFNetworking2.0源码解析
详细内容#####1. 下载 AFNetworking 并添加入工程
直接在 Prefix.pch 文件中引入,或者在工程的网络管理模块相关文件中引入。
#####2. 快速创建各种请求
Get 请求
123456AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];[manager GET:@"http://example.com/resources.json" parameters:nil succ ...
数据加密 - RSA 加密(包含JAVA服务器端解密)
变更记录
序号
录入时间
录入人
备注
1
2015-03-12
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称数据加密 - RSA 加密(包含JAVA服务器端解密)
关键字数据加密 \ 加密 \ 解密 \ RSA \ 非对称加密算法
需求场景
移动端与服务器敏感数据通讯加密需求
参考链接
ITEYE - iOS中使用RSA对数据进行加密解密
GitHub - gen_rsakey.sh
GitHub - RSAEncryptor
详细内容#####1. 使用openssl生成密匙对
gen_rsakey.sh
1234567891011121314151617181920212223#!/usr/bin/env bashecho "Generating RSA key pair ..."echo "1024 RSA key: private_key.pem"openssl genrsa -out private_key.pem 1024echo "create c ...
动画 - Core Animation 之 Key Path
变更记录
序号
录入时间
录入人
备注
1
2015-03-04
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称动画 - Core Animation 之 Key Path
关键字动画 \ Core Animation \ CAAnimation \ CALayer
需求场景
CAAnimation 、 CALayer 实现动画需求时 setValue:forKeyPath: 和 valueForKeyPath: 支持的 Key Path 速查
参考链接
Apple documentation - Core Animation Programming Guide
简书 - 干货系列之手把手教你使用Core animation 做动画 (推荐)
《核心动画编程指南》
详细内容表 1 支持的 Key Path 类型
C type
Wrapping class
CGPoint
NSValue
CGSize
NSValue
CGRect
NSValue
CATransform3D
NSValue
...
键盘 - 弹出与收起改变页面高度
变更记录
序号
录入时间
录入人
备注
1
2015-03-02
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称键盘 - 弹出与收起改变页面高度
关键字键盘 \ Keyboard \ 弹出键盘 \ 收起键盘
需求场景
页面弹出键盘需要改变页面高度时
参考链接(无)
详细内容
Swift 解决方案1234567891011121314151617181920212223242526272829303132333435363738394041deinit{ NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillShowNotification, object: nil) NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillHideNotification, object: nil)}fun ...
键盘 - 使用 IQKeyboardManager 完美解决IOS开发键盘遮挡
变更记录
序号
录入时间
录入人
备注
1
2015-03-26
Alfred Jiang
-
2
2015-12-22
Alfred Jiang
-
方案名称键盘 - 使用 IQKeyboardManager 完美解决IOS开发键盘遮挡
关键字键盘 \ Keyboard \ 弹出键盘 \ 收起键盘
需求场景
需要弹出键盘收起键盘的页面避免遮挡问题
参考链接
IQKeyboardManager-不用写一行代码就完美解决IOS开发键盘遮挡的类库
GitHub - IQKeyboardManager
GitHub - CocoaPods
详细内容#####1. Cocoapod安装:
你可以使用 Cocoapods 来安装 IQKeyboardManager 类库。在 Podfile 文件中这样写:
1pod 'IQKeyboardManager'
就可以了
#####2. Framework加入:
将 KeyboardManager.framework 、 IQKeyboardManager.bundle 等文件加入到项目中即可。详细可以下载De ...