Akagi201
9/20/2014 - 10:21 AM

swift.md

desktop

web框架

swift for android

swift 开源

mac开发

  • OS X Human Interface Guidelines: 在 iBook 上可以找到,介绍 OS X 的界面设计规范, OS X 上的软件比较注重界面设计。
  • The swift Programming language: 同样在 iBook 上可以搜索到,主要就是介绍 swift 语言,可以先通篇浏览一遍,后续遇到问题再去查。同时配合 Dash 查 Cocoa 的 API , perfect 。
  • Cocoa Programming for Mac OS X(5th): 第五版以上,里面用的是 swift 讲解,介绍的例子通俗易懂,全书的例子做一遍下来,开发简单的 OS X 程序不成问题。

社区

教程

book

cheat sheet

video

type convert

15:38 Akagi201: print(Int("23")), then I got Optional(23) in the console, How can I get Int 23.
15:39 Psy: print(Int("23")!)
15:40 Psy: Akagi201: add the ! exclamation point to unwrap it
15:41 Akagi201: Psy: Thanks, it works, but when should I use the ! mark.
15:41 Akagi201: Everytime when I need to convert a type?
15:41 Psy: ! means force unwrap
15:42 Psy: if you have an optional object and you're sure it's not going to be nil when you use it, you can use !
15:42 Psy: if your object can be nil, then you use ? instead
15:44 Psy: note that ! represents an implicitly unwrapped optional

docs