01 2016 档案
摘要:- (CGFloat)getCellHeight:(UITableViewCell*)cell { [cell layoutIfNeeded]; [cell updateConstraintsIfNeeded]; CGFloat height = [cell.contentView systemLa
阅读全文
摘要:@property (nonatomic, assign) NSInteger timeout; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(100, 100,
阅读全文
摘要:1、 (1) 第一步,制定协议 //因为是ConfigViewController其他界面发送消息 // 1. 告诉其他界面我要给你发送什么消息 // 2. 确保其他实现了消息对应的方法 // 声明协议和协议方法 @protocol ConfigViewControllerDelegate <NSO
阅读全文
摘要:1、开源库,利用pod引入第三方库MMDrawerController: 在建立的Podfile中加入代码: platform :ios, '7.0' pod 'ReactiveCocoa' pod 'MMDrawerController' pod 'Toast', '~> 3.0' pod 'Co
阅读全文
摘要:1、NSMutableAttributedString总的来说一共有21个属性: NSFontAttributeName 设置字体属性,默认值:字体:Helvetica(Neue) 字号:12 NSForegroundColorAttributeNam 设置字体颜色,取值为 UIColor对象,默认
阅读全文
摘要:1、首先在storyboard中拖两个imageView,是相互重叠的两个imageView,把要刮开显示的图片放到下面,上面的imageView显示要刮掉的图片,在上层显示的图片要开启交互功能,如图: 2、代码实现。 上层的imageView拖到控制器一个属性,同时再建立一个属性判断手指是否在触摸
阅读全文
摘要:1.获取本地时间的相关代码: NSDateFormatter* formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSString * date = [format
阅读全文
摘要:1.模式为MRC的工程要兼容ARC的类需要做如下配置:Build Phases -》Compile Sources 在ARC模式的类后面添加-fobjc-arc 2.模式为ARC的工程要兼容MRC的类需要做如下配置:同上,在相应的类后面添加-fno-objc-arc
阅读全文
摘要:1.首先引入第三方库:KeychainItemWrapper,下载地址:http://pan.baidu.com/s/1eRdEGSi 2.把KeychainItemWrapper.h和KeychainItemWrapper.m文件拉入工程,还要添加Security.framework; 3.由于这
阅读全文
摘要:1.首先创建一个Image类,.h文件复制 + (UIImage *)captureWithView:(UIView *)view; 2.在.m文件中实现方法; + (UIImage *)captureWithView:(UIView *)view { // 1.开启上下文 UIGraphicsBe
阅读全文
摘要:1.首先创建一个Image类,.h文件复制 /** * 打水印 * * @param bg 背景图片 * @param logo 右下角的水印图片 */ + (UIImage *)waterImageWithBg:(NSString *)bg logo:(NSString *)logo; 2.在.m
阅读全文
摘要:在一个工程中选中Editor--》Add Target
阅读全文
摘要:首先用pod引入第三方库: MMDrawerController 在podfile中填写 platform :ios, '7.0' pod 'MMDrawerController' 在AppDelegate中引入头文件 #import <MMDrawerController.h> #import "
阅读全文
摘要:注:使用AFNetworking加载数据时,首先要添加HTTPs的白名单,设置详解见http://www.cnblogs.com/h-tao/p/5098877.html 判断网络状态: #pragma mark - 判断网络状态 - (void)judgeNetworkStatus { //原理:
阅读全文
摘要:在plist文件中添加 NSAppTransportSecurity,属性设置为字典,然后再下一级添加 NSAllowsArbitraryLoads,属性设置为bool型,设置为YES;如图: 或者直接把一下代码复制到plist文件当中 <key>NSAppTransportSecurity</ke
阅读全文
浙公网安备 33010602011771号