摘要:
NSDateFormatter常用的格式yyyy-MM-dd HH:mm:ss.SSS yyyy-MM-dd HH:mm:ssyyyy-MM-ddMM dd yyyyNSDateFormatter格式化参数G: 公元时代,例如AD公元yy: 年的后2位yyyy: 完整年MM: 月,显示为1-12MM... 阅读全文
摘要:
搜集的常用第三方库一:网络请求库 1.AFNetworking github地址:https://github.com/AFNetworking/AFNetworking 2.ASIHttpRequest github地址:https://github.com/pokeb/asi-http-requ... 阅读全文
摘要:
// button.titleLabel.textAlignment = NSTextAlignmentLeft; 这句无效 button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; ... 阅读全文
摘要:
1.协议 Swift使用protocol定义协议:protocol ExampleProtocol { var simpleDescription: String { get } mutating func adjust()} 类型、枚举和结构都可以实现协议:class Simple... 阅读全文
摘要:
1.枚举 使用enum创建枚举——注意Swift的枚举可以关联方法:enum Rank: Int { case Ace = 1 case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten case Jack, Queen, ... 阅读全文
摘要:
在Swift中,类的初始化要经过两个阶段(1)第一个阶段,每一个存储属性都被设置了一个初始值。(2)在第二个阶段,每个类在这个实例被使用之前都会有机会来设置它们相应的存储属性1.创建和使用类 使用 class 和类名来创建一个类。类中属性的声明和常量、变量声明一样,唯一的区别就是 它们的上下文是类... 阅读全文
摘要:
函数 Swift使用func关键字声明函数:func greet(name: String, day: String) -> String { return "Hello \(name), today is \(day)."}greet("Bob", "Tuesday") 通过元组(Tup... 阅读全文
摘要:
变量与常量 Swift使用var声明变量,let声明常量。var myVariable = 42myVariable = 50let myConstant = 42 //myConstant不能修改类型推导 Swift支持类型推导(Type Inference),所以上面的代码不需指定类型,... 阅读全文
摘要:
Git 是当前最流行的版本控制程序之一,文本包含了 Git 的一些基本用法 创建 git 仓库 初始化 git 仓库mkdir project # 创建项目目录 cd project # 进入到项目目录 git init # 初始化 git 仓库。此命令会在当前目录新建一个 .git 目录,用... 阅读全文
摘要:
1.提示“You've implemented -[ application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the l... 阅读全文