swift
文章平均质量分 82
peterchen149
这个作者很懒,什么都没留下…
展开
-
swift学习笔记0
开始学swift,随便记录一下。(英文部分摘自官方文档)1 optionals 可选 You use optionals in situations where a value may be absent. An optional represents two possibilities: Either there is a value, and you can unwrap the optio原创 2017-04-18 13:37:39 · 178 阅读 · 0 评论 -
swift学习笔记1 操作符
注:英文部分来自官方文档基础操作符赋值操作符 If the right side of the assignment is a tuple with multiple values, its elements can be decomposed into multiple constants or variables at once: 如果赋值的左边是一个包含多个值的tuple,它的元素可原创 2017-04-18 13:39:15 · 232 阅读 · 0 评论 -
swift学习笔记2 字符串
注:英文部分来自官方文档字符串字符串可变性 You indicate whether a particular String can be modified (or mutated) by assigning it to a variable (in which case it can be modified), or to a constant (in which case it canno原创 2017-04-18 13:40:04 · 273 阅读 · 0 评论 -
swift学习笔记3 集合类型
注:英文部分来自官方文档 It is good practice to create immutable collections in all cases where the collection does not need to change. Doing so makes it easier for you to reason about your code and enables the原创 2017-04-18 13:41:08 · 240 阅读 · 0 评论 -
swift学习笔记4 控制流
注:英文部分来自官方文档switchfallthrough In contrast with switch statements in C and Objective-C, switch statements in Swift do not fall through the bottom of each case and into the next one by default. Instea原创 2017-04-18 13:41:55 · 345 阅读 · 0 评论 -
swift学习笔记5 函数
注:英文部分来自官方文档 Every function in Swift has a type, consisting of the function’s parameter types and return type. You can use this type like any other type in Swift, which makes it easy to pass function原创 2017-04-18 13:42:23 · 446 阅读 · 0 评论 -
swift学习笔记6 闭包
闭包 Closures are self-contained blocks of functionality that can be passed around and used in your code. Closures in Swift are similar to blocks in C and Objective-C and to lambdas in other programmin原创 2017-04-18 13:42:50 · 385 阅读 · 0 评论 -
swift学习笔记7 枚举
枚举枚举语法 You introduce enumerations with the enum keyword and place their entire definition within a pair of braces:枚举用enum关键字开始,后面加上大括号括起来的枚举定义: enum SomeEnumeration { // 枚举的定义 }举个例子原创 2017-04-18 13:43:20 · 320 阅读 · 0 评论 -
swift学习笔记8 类与结构
类与结构 Unlike other programming languages, Swift does not require you to create separate interface and implementation files for custom classes and structures. In Swift, you define a class or a structur原创 2017-04-18 13:43:48 · 557 阅读 · 0 评论