摘要: // // 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)
摘要: // // RootViewController.m #import "RootViewController.h" #import <AudioToolbox/AudioToolbox.h> @interface RootViewController () @end @implementation 阅读全文
posted @ 2016-07-27 17:37 代码始我快乐 阅读(405) 评论(0) 推荐(0)
摘要: // RootViewController.m #import "RootViewController.h" #import <MediaPlayer/MediaPlayer.h> #define PATH @"http://clips.vorwaerts-gmbh.de/big_buck_bunn 阅读全文
posted @ 2016-07-27 17:28 代码始我快乐 阅读(221) 评论(0) 推荐(0)
摘要: #import "RootViewController.h" @interface RootViewController () { UITableView * table; NSMutableArray * dataSource; } @end @implementation RootViewCon 阅读全文
posted @ 2016-07-26 19:48 代码始我快乐 阅读(315) 评论(0) 推荐(0)
摘要: // // RootViewController.m #import "RootViewController.h" #define SCROLLWIDTH 300 //宽 #define SCROLLHEIGHT 350 //高 @interface RootViewController () { 阅读全文
posted @ 2016-07-26 18:00 代码始我快乐 阅读(234) 评论(0) 推荐(0)
摘要: // // RootViewController.m #import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController //创建背景视图 -(void)cre 阅读全文
posted @ 2016-07-26 17:43 代码始我快乐 阅读(309) 评论(0) 推荐(0)