229 lines
16 KiB
Markdown
229 lines
16 KiB
Markdown

|
||
|
||
# [Swift 学习资源](http://blog.liulantao.com/SwiftBeginnersGuide/)
|
||
|
||
> Swift,一种强大的开源编程语言,让大家都能开发出众的 App。
|
||
> Swift 是一种强劲而直观的编程语言,它由 Apple 创造,可用来为 iOS、Mac、Apple TV 和 Apple Watch 开发 app。它旨在为开发者提供充分的自由。Swift 易用并且开源,只要有想法,谁都可以创造非凡。
|
||
|
||
> Swift is a high-performance system programming language. It has a clean and modern syntax, offers seamless access to existing C and Objective-C code and frameworks, and is memory safe by default.
|
||
> On December 3, 2015, the Swift language, supporting libraries, debugger, and package manager were published under the Apache 2.0 license with a Runtime Library Exception, and Swift.org was created to host the project.
|
||
|
||
苹果公司在WWDC 2014上宣布了他们将会推出一款新的编程语言,面向iOS和OS X系统的开发人员,这个新的语言被命名为Swift。
|
||
|
||
Swift在iOS 8发布的时候推向市场,用来取代 Objective-C 语言。
|
||
对于这个巨大的决定,苹果公司的解释是Swift速度更快,使用起来更加容易。
|
||
在Swift推出之后,苹果公司应该不会停止对 Objective-C 的支持,开发工具会同时支持两种语言。
|
||
|
||
在 Swift 开源后,开发者社区活跃。目前 CocoaPods 中有大量的第三方开发库已经支持 Swift。
|
||
|
||
### 贡献
|
||
|
||
- 提交 PR - [iOS-Swift-Demos](https://github.com/Lax/iOS-Swift-Demos/pulls)
|
||
- 加入 QQ群 32958950
|
||
|
||
---
|
||
|
||
### 官方资源
|
||
|
||
- [Swift 开发者社区 - Swift.org](https://swift.org)
|
||
- [Swift 代码库](https://github.com/apple/swift)
|
||
- [Apple developer 的 Swift 首页](https://developer.apple.com/swift/)
|
||
- [Swift Blog](https://developer.apple.com/swift/playgrounds/)
|
||
- [Swift Resources](https://developer.apple.com/swift/resources/)
|
||
- [Swift Playgrounds](https://developer.apple.com/swift/playgrounds/) Learn Swift on iPad
|
||
- [苹果官网的 Swift 页面](http://www.apple.com/swift/)
|
||
- [Xcode](https://itunes.apple.com/app/xcode/id497799835)
|
||
|
||
### 权威文档
|
||
|
||
* The Swift Programming Language - The Definitive Book
|
||
- [Online Version](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/index.html)
|
||
- ePub([官方](https://docs.swift.org/swift-book/TheSwiftProgrammingLanguageSwift5.epub))
|
||
- [iBooks Store](https://itunes.apple.com/us/book-series/swift-programming-series/id888896989?mt=11)
|
||
* App Development with Swift
|
||
- [iBooks Store](https://itunes.apple.com/us/book/app-development-with-swift/id1118575552?mt=11)
|
||
* Using Swift with Cocoa and Objective-C
|
||
- [iBooks Store](https://itunes.apple.com/us/book/using-swift-cocoa-objective/id888894773?mt=11)
|
||
- [Online Version](https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/index.html)
|
||
* [Swift Standard Library API Reference](https://developer.apple.com/reference/swift)
|
||
* [Start Developing iOS Apps](https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/index.html)
|
||
* [API Design Guidelines](https://swift.org/documentation/api-design-guidelines/)
|
||
* [Swift Programming Language Evolution](http://apple.github.io/swift-evolution/)
|
||
* [WWDC2014 Videos](https://developer.apple.com/videos/wwdc/2014/)
|
||
|
||
---
|
||
|
||
### 社区文档
|
||
|
||
- The Swift Programming Language [社区译中文版](https://github.com/numbbbbb/the-swift-programming-language-in-chinese)
|
||
|
||
### 课程
|
||
|
||
- [Stanford University: Developing iOS 9 Apps with Swift](https://itunes.com/StanfordSwift)
|
||
- [Plymouth University: iOS Development in Swift](https://itunes.com/PlymouthSwift)
|
||
|
||
---
|
||
|
||
### 非官方文档与社区(英文)
|
||
|
||
#### 初级话题
|
||
|
||
* [StackOverflow上的Swift讨论](http://stackoverflow.com/questions/tagged/swift-language)
|
||
* github上的swift内容 [search结果](https://github.com/search?l=Swift&q=swift&ref=cmdform&type=Repositories)
|
||
* [Swift Cheatsheet](http://cdn2.raywenderlich.com/wp-content/uploads/2014/06/RW-Swift-Cheatsheet-0_3.pdf)
|
||
* [Swift & Cocoapods](https://medium.com/swift-programming/swift-cocoapods-da09d8ba6dd2) How to integrate Cocoapods into a vanilla Swift project
|
||
* [Swift Toolbox](http://www.swifttoolbox.io)
|
||
* [SwiftUI Tutorials](https://janeshswift.com)
|
||
* [Developing iOS Apps Using Swift Tutorial](http://jamesonquave.com/blog/developing-ios-apps-using-swift-tutorial/)
|
||
* [7 thoughts on “Swift: Not quite there, but too far gone too”](http://studentf.wordpress.com/2014/06/03/swift-not-quite-there-but-too-far-gone-too/)
|
||
* [Swift Impressions](http://www.evanmiller.org/swift-impressions.html) by Evan Miller
|
||
* [Swift Tutorial – Developing iOS 8 Apps](http://jamesonquave.com/blog/developing-ios-apps-using-swift-tutorial/) by Jameson Quave 很完整的学习文档
|
||
* [An Absolute Beginner’s Guide to Swift](http://blog.teamtreehouse.com/an-absolute-beginners-guide-to-swift)和[Understanding Optionals in Swift](http://blog.teamtreehouse.com/understanding-optionals-swift) by Amit Bijlani
|
||
* [Swift Cheat Sheet and Quick Reference](http://cdn2.raywenderlich.com/wp-content/uploads/2014/06/RW-Swift-Cheatsheet-0_3.pdf) by Ray Wenderlich
|
||
* [Generics in Swift](http://swiftyeti.com/generics/)
|
||
* [How to use the Swift REPL language shell – Swift programming from the command line](http://practicalswift.com/2014/06/07/swift-repl/)
|
||
* [How to write a minimal WebKit browser in 30 lines of Swift](http://practicalswift.com/2014/06/27/a-minimal-webkit-browser-in-30-lines-of-swift/)
|
||
* [Swift Initializers](http://ashfurrow.com/blog/swift-initializers/)
|
||
* [Create the Game of Life using Swift and SpriteKit](https://www.makegameswith.us/gamernews/399/create-the-game-of-life-using-swift-and-spritekit)
|
||
* [Composing functions in Swift](http://railsware.com/blog/2014/06/17/composing-functions-in-swift/)
|
||
* [Advanced Swift](http://blog.fivelakesstudio.com/2014/06/advanced-swift-part-1.html)
|
||
* [We ❤ Swift](http://www.weheartswift.com)
|
||
* [LEARNABLE PROGRAMMING](http://worrydream.com/#!/LearnableProgramming) Designing a programming system for understanding programs
|
||
* [把《The Swift Programming Language》读薄](http://hawstein.com/posts/make-thiner-tspl.html) by [Hawstein](http://hawstein.com)
|
||
|
||
#### 深入话题
|
||
|
||
* [Swift Operators](http://nshipster.com/swift-operators/) by Mattt Thompson
|
||
* [Beginning Core Image in Swift](http://www.raywenderlich.com/76285/beginning-core-image-swift)
|
||
* [Multiple Animations](http://ronnqvi.st/multiple-animations/) by David Rönnqvist
|
||
* [The Case for Message Passing in Swift](http://www.buckleyisms.com/home/2014/6/16/the-case-for-message-passing-in-swift.html) by Michael Buckley
|
||
* [The Core Data stack in Swift](http://www.cimgf.com/2014/06/08/the-core-data-stack-in-swift/) by Marcus Zarra
|
||
* [How to Make a Game Like Candy Crush with Swift Tutorial: Part 1](http://www.raywenderlich.com/75270/make-game-like-candy-crush-with-swift-tutorial-part-1) and [Part 2](http://www.raywenderlich.com/75273/make-game-like-candy-crush-with-swift-tutorial-part-2) by Matthijs Hollemans
|
||
* [Build custom simulators](http://ericasadun.com/2014/06/18/ios-8-building-custom-simulators/) by Erica Sadun
|
||
* [CloudKit: Moves like Azure](http://www.atomicbird.com/blog/cloudkit-moves-like-azure) by Tom Harrington
|
||
* about [Error handling](http://swiftlytyping.tumblr.com/post/88210131086/error-handling) by Chris Cieslak
|
||
* [Inside Swift](http://www.eswick.com/2014/06/inside-swift/)
|
||
* [List of implicitly defined variables in Swift](http://practicalswift.com/2014/06/10/list-of-implicitly-defined-variables-in-swift/) 和 [Swift Standard Library: Documented and undocumented built-in functions in the Swift standard library – the complete list with all 74 functions](http://practicalswift.com/2014/06/14/the-swift-standard-library-list-of-built-in-functions/) by practicalswift
|
||
* [Swift’s Weird Handling of Basic Value Types and AnyObject](http://www.drewag.me/posts/swift-s-weird-handling-of-basic-value-types-and-anyobject)
|
||
* [Creation of pure Swift module](http://railsware.com/blog/2014/06/26/creation-of-pure-swift-module/) by Alex Denisov. make a logging library and shows us how to document classes in Xcode.
|
||
* [How to write unit tests in Swift with XCTest](http://roadfiresoftware.com/2014/06/unit-testing-with-swift/)
|
||
* [gesture recognizer](http://michaelteeuw.nl/post/90182386142/swift-around-and-around)
|
||
* [Swift Language Highlights: An Objective-C Developer’s Perspective](http://www.raywenderlich.com/73997/swift-language-highlights)
|
||
* [Swift Sequences and lazy evaluation](http://www.scottlogic.com/blog/2014/06/26/swift-sequences.html)
|
||
* [SPACESHIP OPERATOR IN SWIFT](http://vperi.com/2014/06/05/spaceship-operator-in-swift/) 和 [REGULAR EXPRESSIONS IN SWITCH STATEMENTS](http://vperi.com/2014/06/08/regular-expressions-in-switch-statements/) by Venkat Peri
|
||
|
||
|
||
#### 社区
|
||
|
||
* https://www.v2ex.com/go/swift
|
||
* http://swift.sh
|
||
* http://swift-china.org
|
||
* CocoaChina的[Swift讨论区](http://www.cocoachina.com/bbs/thread.php?fid=57)
|
||
* QQ群 iOS开发者-开始Swift,群号:32958950,申请时请说明身份。
|
||
|
||
|
||
#### 翻译
|
||
|
||
* [《The Swift Programming Language》中文版](http://www.swiftguide.cn) ([协作翻译](http://numbbbbb.github.io/the-swift-programming-language-in-chinese/)))第一份完整的中文翻译
|
||
|
||
* 《[Apple Swift编程语言入门教程](http://gashero.iteye.com/blog/2075324)》比较早期的一篇翻译,最近没有更新
|
||
|
||
|
||
#### 评论
|
||
|
||
* 《[关于 Swift 的一点初步看法](http://onevcat.com/2014/06/my-opinion-about-swift/)》 by onevcat
|
||
* 《[行走于 Swift 的世界中](http://onevcat.com/2014/06/walk-in-swift/)》 by onevcat 更详细的一篇评论
|
||
* 《[来自苹果的编程语言——Swift简介](http://zh.lucida.me/blog/an-introduction-to-swift/)》
|
||
|
||
|
||
#### 课程
|
||
|
||
* 《[SwiftV课堂](http://www.swiftv.cn/)》 免费Swift学习视频
|
||
* 《[Apple Swift语言基础教程](http://www.jikexueyuan.com/course/92.html)》极客学院
|
||
|
||
---
|
||
|
||
### 官方示例
|
||
|
||
Apple同时发布了3个示例程序,用于初窥Swift开发的项目。
|
||
|
||
* Lister: A Productivity App Built in Swift
|
||
[github](https://github.com/Lax/iOS-Swift-Demos/tree/master/Lister)
|
||
* UICatalog: Creating and Customizing UIKit Controls in Swift
|
||
[apple](https://developer.apple.com/library/ios/samplecode/UICatalog/Introduction/Intro.html)
|
||
/
|
||
[github](https://github.com/Lax/iOS-Swift-Demos/tree/master/UICatalog)
|
||
* Adventure: Building a SpriteKit Game Using Swift
|
||
[apple](https://developer.apple.com/library/mac/samplecode/Adventure-Swift/Introduction/Intro.html)
|
||
/
|
||
[github](https://github.com/Lax/iOS-Swift-Demos/tree/master/Adventure)
|
||
* GestureRecognizers: Using standard UIGestureRecognizers in Swift
|
||
[github](https://github.com/Lax/iOS-Swift-Demos/tree/master/GestureRecognizersUsingstandardUIGestureRecognizers)
|
||
|
||
---
|
||
|
||
### 非官方代码分享
|
||
|
||
* [Swift Trending](https://github.com/trending?l=swift&since=monthly)
|
||
* [FlappySwift](https://github.com/fullstackio/FlappySwift) 用Swift实现的FlappyBird
|
||
* [swift-2048](https://github.com/austinzheng/swift-2048)
|
||
* [PNChart-Swift](https://github.com/kevinzhow/PNChart-Swift) 可以创建图表的库
|
||
* [Game of Life](https://github.com/yonbergman/swift-gameoflife) 一个游戏
|
||
* [swift-alarm](https://github.com/ChrisChares/swift-alarm.git) 基于地理位置的提醒工具 [blog](http://chares.ghost.io/lets-make-a-swift-app-part-1/)
|
||
* [SwiftNote](https://github.com/mslathrop/SwiftNote.git)
|
||
* [翻翻看](https://github.com/geek5nan/FanFanSwift) 游戏翻翻看Swift版
|
||
* [HackerNews](https://github.com/amitburst/HackerNews) HackerNews网站的第三方客户端
|
||
* [SwiftWeather](https://github.com/JakeLin/SwiftWeather) 一个天气客户端
|
||
* [SwiftSingleton](https://github.com/hpique/SwiftSingleton)
|
||
* [Swift: Spiroswiftograph](http://ericasadun.com/2014/06/23/swift-spiroswiftograph/) a cool example of what you can do in the Playground
|
||
* [UIImageView-BetterFace-Swift](https://github.com/croath/UIImageView-BetterFace-Swift) 展示图片是加入面部识别,改善展示效果
|
||
* [YYHRequest-Swift](https://github.com/yayuhh/YYHRequest-Swift) 异步HTTP请求类
|
||
* [Noah’s Ark, in Swift](https://twitter.com/futurepaul/status/473902211463118848) is a funny example of unicode support
|
||
* [Cartography](https://github.com/robb/Cartography) is an excellent example of what could be achieved with operator overloading. If you don’t like writing Autolayout constraints you should definitely check it out.
|
||
* [Dollar](https://github.com/ankurp/Dollar.swift) is a Swift library that provides useful functional programming helper methods without extending any built in objects. It is similar to Lo-Dash or Underscore in Javascript.
|
||
* [swifter](https://github.com/glock45/swifter) Tiny http server engine written in Swift programming language.
|
||
* [SwiftyJSON](https://github.com/lingoer/SwiftyJSON)
|
||
* [Agent](https://github.com/hallas/agent) Minimalistic Swift HTTP request agent for iOS and OS X
|
||
* [JustUiKit](https://github.com/lfkdsk/JustUiKit) - JustUiKit是一套Android样式工具iOS UI套件。 JustUiKit包含JustLinearLayout,JustFrameLayout, JustRelativeLayout等。 它旨在使Android开发人员轻松构建iOS UI。 也为iOS开发人员提供了一种新的方式来构建UI。
|
||
|
||
---
|
||
|
||
## 开发工具
|
||
|
||
### xcode 6 下载
|
||
|
||
```xcode 6 安装系统要求为MacOSX 10.9.3+```
|
||
|
||
* [http://pan.baidu.com/s/1dD2AJ3j](http://pan.baidu.com/s/1dD2AJ3j)
|
||
* xcode_6.0.1.dmg [http://pan.baidu.com/s/1sjNQY1B](http://pan.baidu.com/s/1sjNQY1B)
|
||
* xcode_6.dmg [http://pan.baidu.com/s/1jGoTsWm](http://pan.baidu.com/s/1jGoTsWm)_
|
||
* xcode_6_beta_6.dmg [http://pan.baidu.com/s/1dD3qeOT](http://pan.baidu.com/s/1dD3qeOT)
|
||
* xcode_6_beta_4.dmg [http://pan.baidu.com/s/1pJ0nkJx](http://pan.baidu.com/s/1pJ0nkJx)
|
||
* xcode_6_beta_3.dmg [http://pan.baidu.com/s/1nt0WS8T](http://pan.baidu.com/s/1nt0WS8T)
|
||
|
||
---
|
||
|
||
## 其它
|
||
|
||
* [iOS Developer Library](https://developer.apple.com/library/ios/navigation/)
|
||
* [Chris Lattner](http://nondot.org/sabre/) Swift设计者
|
||
* [iOS 7.1 to iOS 8.0 API Differences](https://developer.apple.com/library/prerelease/ios/releasenotes/General/iOS80APIDiffs/index.html)
|
||
* [App Extensions Increase Your Impact](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/index.html)
|
||
* [Swift学习资源](http://blog.liulantao.com/SwiftBeginnersGuide/) Swift 学习资料汇总,比较详细总结了常用的资源。
|
||
|
||
### 因为重名躺枪的 Swift
|
||
|
||
* [Swift Lang](http://swift-lang.org) 一门很专业的并行编程语言,有苹果在Swift页面的链接,肯定带过去很多访问量。
|
||
* [OpenStack Swift](https://github.com/openstack/swift) OpenStack Object Storage (Swift)。
|
||
* [Swift 聊天工具](http://swift.im) 基于XMPP的聊天工具及服务端SDK。
|
||
* [Taylor Swift](http://en.wikipedia.org/wiki/Taylor_Swift) 美国乡村音乐女創作歌手、吉他歌手、演员。这位1989年出生的美女获得过数不清的格莱美奖及其它排行榜大奖。2014/05/30刚举办了泰勒•斯威夫特“红”巡演上海演唱会。WWDC2014之后三天,她从Google搜索结果首页被挤出,很受伤,歌迷们也很受伤。去[脸盆网](https://www.facebook.com/TaylorSwift)关注她,去音悦台[听她的歌](http://www.yinyuetai.com/fanclub/122)。
|
||
|
||
---
|
||
|
||
### 讨论区
|
||
* 【iOS开发者-开始Swift】QQ交流群32958950 申请时请说明身份。
|
||
|
||
---
|
||
|
||
[](https://starchart.cc/Lax/Learn-iOS-Swift-by-Examples)
|