08 2016 档案

摘要:// ViewController.m #import "ViewController.h" #import "ScrollSliderView.h" @interface ViewController () { NSArray *titleArray; } @end @implementation ViewController - (void)viewDidLoad { ... 阅读全文
posted @ 2016-08-23 11:17 代码始我快乐 阅读(723) 评论(0) 推荐(0)
摘要:NSPredicate 查询 /* 1、字符串本身SELF BEGINSWITH 以某个字符串开始 CONTAINS 包含某个字符串 ENDSWITH 以某个字符串结尾 */ NSString * name1 = [NSString stringWithFormat:@"北京"]; NSArray * arr1 = @... 阅读全文
posted @ 2016-08-19 15:15 代码始我快乐 阅读(163) 评论(0) 推荐(0)
摘要:/* 升序、降序 */ NSArray * array41 = @[@4,@5,@2,@6,@3,@7,@8]; NSArray * array42 = [[NSArray alloc]init]; array42 = [array41 sortedArrayUsingComparator:^NSComparisonResult(id obj1... 阅读全文
posted @ 2016-08-19 15:15 代码始我快乐 阅读(665) 评论(0) 推荐(0)
摘要:// ViewController.swift // Block import UIKit class ViewController: UIViewController { var myLabel = UILabel() override func viewDidLoad() { super.viewDidLoad() sel... 阅读全文
posted @ 2016-08-17 14:48 代码始我快乐 阅读(149) 评论(0) 推荐(0)
摘要:let stringurl = "http://www.huiyunche.cn/kyleuat/banner/list" Alamofire.request(.GET,stringurl,parameters:nil) .responseJSON { response in if let JSON = re... 阅读全文
posted @ 2016-08-17 14:43 代码始我快乐 阅读(174) 评论(0) 推荐(0)
摘要:let label = UILabel() label.frame = CGRectMake(100, 100, 100, 100) label.backgroundColor = UIColor.cyanColor() label.text = "SnapKit" label.textAlignment = NST... 阅读全文
posted @ 2016-08-17 14:21 代码始我快乐 阅读(313) 评论(0) 推荐(0)
摘要:let image = UIImageView() image.sd_setImageWithURL(NSURL(string:"http://qiniu.test.huiyunche.cn/banner1.jpg?e=1471421220&token=wQknukoe-lwcjLKEnsBz-Br 阅读全文
posted @ 2016-08-17 14:20 代码始我快乐 阅读(126) 评论(0) 推荐(0)
摘要:一、查询第三方版本号 pod search SDWebImage 二、项目添加pod 1、在终端打开项目路径 2、输入 pod init 生成Podfile 三、在Podfile输入需要的第三方 # Uncomment this line to define a global platform fo 阅读全文
posted @ 2016-08-17 10:56 代码始我快乐 阅读(217) 评论(0) 推荐(0)
摘要:// // ViewController.swift // banner滚动视图 import UIKit let WIDTH = CGFloat(UIScreen.mainScreen().bounds.size.width) let HEIGHT = CGFloat(UIScreen.mainS 阅读全文
posted @ 2016-08-11 16:05 代码始我快乐 阅读(153) 评论(0) 推荐(0)
摘要:// 协议中虽然可以指定属性的读写,但即使协议中规定属性是只读的但在使用时也可以将其实现成可读写的; // Swift的协议中可以约定属性是实例属性还是类型属性、是读写属性还是只读属性,但是不能约束其是存储属性还是计算属性; // 协议中的类型属性和类型方法使用static修饰而不是class(尽管对于类的实现中类型属性、类型方法使用class修饰); ... 阅读全文
posted @ 2016-08-09 11:19 代码始我快乐 阅读(263) 评论(0) 推荐(0)
摘要:// 子类的指定构造方法必须调用父类构造方法,并确保调用发生在子类存储属性初始化之后。而且指定构造方法不能调用同一个类中的其他指定构造方法; // 便利构造方法必须调用同一个类中的其他指定构造方法(可以是指定构造方法或者便利构造方法),不能直接调用父类构造方法(用以保证最终以指定构造方法结束); // 如果父类仅有一个无参构造方法(不管是否包含便利... 阅读全文
posted @ 2016-08-09 11:09 代码始我快乐 阅读(1653) 评论(0) 推荐(0)
摘要://#if #endif宏定义的意思就是如果定义了DEBUG,那么就使用NSLog输出;否则这段代码直接忽略。有人会疑问这个DEBUG和_DEBUG来自哪里,这个其实不用担心,这个来自于Xcode的默认设置,可以取消DEBUG模式,开启RELEASE发布模式 //选择Product->Scheme->Edit Scheme, #if defined(DEBUG)||defined(_D... 阅读全文
posted @ 2016-08-02 10:45 代码始我快乐 阅读(171) 评论(0) 推荐(0)
摘要:app 进入后台后,实现手机短信验证码时间不间断倒计时 阅读全文
posted @ 2016-08-01 14:13 代码始我快乐 阅读(316) 评论(0) 推荐(0)