重要更新
感谢 @JeffreyW2947 同学!这是一位正在美国读高中的计算机天才,将我的这个课程的所有内容都基于最新的Swift4语言进行了更新,传送门:Play with Swift 4
对swift感兴趣的同学,欢迎加我的个人微信:liuyubobobo(头像和github一致),一起加入swift微信群讨论:)请注明:swift交流
以下内容为原课程swift2代码,已停止更新。
Play with Swift 2 - 玩儿转 Swift 2
Support the newest Xcode7.3 and Swift2.2! 现已支持Swift最新版本 Xcode7.3 Swift2.2!
Welcome! This repo is based on the MOOC course <Play with Swift 2> on imooc.com, one of the toppest MOOC website in China. As the teacher of this brand new Swift course, I put all the demos' codes here for everyone to test and comment. If you find any bug, or have any suggestion, even brilliant ideas which can make this course better, please contact me:)
Personal Website: liuyubobobo.com
Email: [email protected]
Weibo: 刘宇波bobo http://weibo.com/liuyubobobo
Zhihu: 刘宇波 http://www.zhihu.com/people/liuyubobobo
大家好, 欢迎大家下载《玩儿转Swift2》课程的源代码。这些代码包含我在慕课网上的课程——《玩儿转Swift2》上的所有源码。大家可以下载、运行、测试、修改。如果你发现了任何bug,或者对课程中的任何内容有意见或建议,欢迎和我联系:)
个人网站:liuyubobobo.com
电子邮件:[email protected]
微博: 刘宇波bobo http://weibo.com/liuyubobobo
知乎: 刘宇波 http://www.zhihu.com/people/liuyubobobo
个人公众号:是不是很酷
Catalogue - 课程目录
中文版课程目录在英文版目录后,直接点击这里查看中文目录
Season One
-
Chapter One - Introduction CODE
- 1-1 Let's play with Swift 2 Course Video
- 1-2 Swift and iOS Development Course Video
- 1-3 Swift vs Objective-C Course Video
- 1-4 Preparation Course Video
- 1-5 Explore Playground Course Video
-
Chapter Two:Basic Types CODE
- 2-1 Declare Constants and Variables Course Video
- 2-2 Integer Course Video
- 2-3 Double, Float and Type Conversion Course Video
- 2-4 Boolean and
if
Statement Course Video - 2-5 Tuples Course Video
- 2-6 Variable Names, Function
print
and Comments Course Video
-
Chapter Three: Operator CODE
- 3-1 Basic Operators Course Video
- 3-2 Comparison Operator, Logic Operator and
if
-Statement again Course Video - 3-3 Ternary Condition Operator and Initialization Course Video
- 3-4 Range Operator and
for-in
Course Video
-
Chapter Four: Control Flow CODE
- 4-1 Loop -
for-in
andfor
Course Video - 4-2 Loop -
while
andrepeat
Course Video - 4-3 Conditional Statements -
if
,else
andswitch
Course Video - 4-4 Advanced
switch
Course Video - 4-5 Control Transfer Course Video
- 4-6
where
and Pattern Matching Course Video - 4-7
guard
and Code Style of Swift Course Video
- 4-1 Loop -
-
Chapter Five:String CODE
- 5-1 String Basics Course Video
- 5-2
Character
and Unicode Course Video - 5-3
String.Index
andRange
Course Video - 5-4
as
andNSString
Course Video - 5-5 Refer to the Documents Course Video
Season Two
-
Chapter Six: Optional CODE
- 6-1 Why Optional Course Video
- 6-2 Optional Unwrapping Course Video
- 6-3 Optional Chaining 和 Nil-Coalesce Course Video
- 6-4 Optional in Practice Course Video
- 6-5 Implicity Unwrapped Optional Course Video
-
Chapter Seven: Array CODE
- 7-1 Array Initialization Course Video
- 7-2 Array Basics Course Video
- 7-3 Array Manipulation Course Video
- 7-4 2D-Array Course Video
- 7-5 NSArray Course Video
-
Chapter Eight: Dictionary and Set CODE
- 8-1 Dicitonary Initialization and Basics Course Video
- 8-2 Manipulation in Dictionary Course Video
- 8-3 Set Initialization and Basics Course Video
- 8-4 Manipulation in Set Course Video
- 8-5 Choose Data Structure Properly Course Video
- 8-6
for-in
Again and Swift Advance Course Video
-
Chapter Nine: Function CODE
- 9-1 Function Basics and the Style of Function Name Course Video
- 9-2 Return Mutiple Values with Tuple Course Video
- 9-3 Internal and External Parameter Names, and Naming Swift Function Course Video
- 9-4 Default Parameter and Variadic Parameter Course Video
- 9-5 Constant, Variable and inout Parameter Course Video
- 9-6 Using Function Types Course Video
- 9-7 Introduction to Function Programming Course Video
- 9-8 Return a Function Type and Nested Functions Course Video
-
Chapter Ten: Closure CODE
- 10-1 Closure Basics Course Video
- 10-2 Closure Syntax Simplification Course Video
- 10-3 Trailing Closure Course Video
- 10-4 Capture Value Course Video
- 10-5 Function and Closure are Reference Types Course Video
Season Three
-
Chapter Eleven: Enumeration CODE
- 11-1 Welcome to the Swift OOP World Course Video
- 11-2 Why Enumeration Course Video
- 11-3 Enumeration Basics Course Video
- 11-4 Raw Value Course Video
- 11-5 Associate Values Course Video
- 11-6 Optional Type is Actually Enumeration Course Video
- 11-7 Recursion in Optional Type Course Video
-
Chapter Twelve: Structure CODE
- 12-1 Structure Basics Course Video
- 12-2 Initializer Course Video
- 12-3 Failable Initializer Course Video
- 12-4 Methods in Structure and Enumeration Type Course Video
- 12-5 Structures and Enumerations are Value Type Course Video
- 12-6 Structures are Everywhere in Swift Course Video
-
Chapter Thirteen: Class CODE
- 13-1 Class Basics Course Video
- 13-2 Classes are Reference Type Course Video
- 13-3 The Characteristics of Reference Type Course Video
- 13-4 Object Identity Course Video
- 13-5 Class or Structure? That's a question. Course Video
-
Chapter Fourteen: Properties and Methods CODE
- 14-1 Computed Properties Course Video
- 14-2 Type Properties Course Video
- 14-3 Type Methods Course Video
- 14-4 Property Observers Course Video
- 14-5 Lazy Properties Course Video
- 14-6 Access Control Course Video
- 14-7 A Peep of Pattern Designing: Singleton Course Video
-
Chapter Fifteen: Inheritance and Initialization CODE
- 15-1 Inheritance Basics Course Video
- 15-2 Polymorphism Course Video
- 15-3 Override Course Video
- 15-4 Two Phase Initialization Course Video
- 15-5 Convenience Initializer and Designated Initializer Course Video
-
Chapter Sixteen: Documentation CODE
- 16-1 Markdown Basics Course Video
- 16-2 Parameters, Returns and Throws in Documentation Course Video
- 16-3 More Documentation Keywords Course Video
- 16-4 MARK, TODO and FIXME Course Video
Season Four
-
Chapter Seventeen: Subscript and Operator Overloading CODE
- 17-1 Subscript Basics Course Video
- 17-2 Subscript with More Dimensions Course Video
- 17-3 Operator Overloading Basics Course Video
- 17-4 Overloading Comparison Operator Course Video
- 17-5 Custome Operator Course Video
-
Chapter Eighteen: Extension and Generic CODE
- 18-1 Extension Basics Course Video
- 18-2 Nest Types Course Video
- 18-3 Extending Buildin Library Course Video
- 18-4 Generic Functions Course Video
- 18-5 Generic Types Course Video
-
Chapter Nineteen: Protocol CODE
- 19-1 Protocol Basics Course Video
- 19-2 Protocol and Initializers Course Video
- 19-3 Why Protocols Course Video
- 19-4
typealias
andassociatetype
Course Video - 19-5 Useful Protocols in Standard Library Course Video
-
Chapter Twenty: Protocol-Oriented Programming CODE
- 20-1 Protocol Extension and Default Implementations Course Video
- 20-2 Protocol Extension Dispatching Course Video
- 20-3 Protocol Composite Course Video
- 20-4 Generic Constraints Course Video
- 20-5 Swift is a Protocol Oriented Programming Language Course Video
- 20-6 Delegation in UIKit Course Video
- 20-7 Delegation in Practice Course Video
- 20-8 Optional Protocol Requirements Course Video
-
Chapter Twenty-One: Error Handling CODE
- 21-1 Exit the Programming Forcefully Course Video
- 21-2 Error Type Course Video
- 21-3 Error Handling Course Video
- 21-4
defer
Course Video
-
Chapter Twenty-Two: Memory Management CODE
- 22-1
deinit
Course Video - 22-2 Reference Count and ARC Course Video
- 22-3 Strong Reference Cycle and
weak
Course Video - 22-4
unowned
Course Video - 22-5 Using Implicity Unwrapped Optional Property Course Video
- 22-6 Strong Reference Cycles in Closures Course Video
- 22-7 Resolving Strong Reference Cycles for Closures Course Video
- 22-1
-
Chapter Twenty-Three: Type Casting CODE
- 23-1 Type Checking Course Video
- 23-2 Downcasting Course Video
- 23-3 Type Casting for Protocol Conformation Course Video
- 23-4
NSObject
,AnyObject
andAny
Course Video
-
Chapter Twenty-Four: The Ending
- 24-1 Hello, Swift3! Course Video
- 24-2 What's Next? Course Video
###第一季
-
第一章:玩儿转 Swift 2 源码
-
第二章:基本类型 源码
-
第三章 运算符 源码
-
第四章:逻辑控制 源码
-
第五章:字符串 源码
###第二季
-
第六章 可选型 源码
-
第七章 数组 源码
-
第八章 字典和集合 源码
-
第九章 函数 源码
-
第十章 闭包 源码
###第三季
-
第十一章 枚举 源码
-
第十二章: 结构体 源码
-
第十三章: 类 源码
-
第十四章: 属性和方法 源码
- 14-1 计算属性 课程视频
- 14-2 类属性 课程视频
- 14-3 类方法 课程视频
- 14-4 属性观察器 课程视频
- 14-5 懒属性 -
lazy
关键字 Course Video - 14-6 访问控制 Course Video
- 14-7 设计模式初探:单例设计模式 Course Video
-
第十五章: 继承与构造 源码
-
第十六章: 文档注释 源码
第四季
-
第十七章: 下标和运算符重载 源码
-
第十八章: 扩展和泛型 源码
-
第十九章: 协议 源码
-
第二十章: 面向协议的编程 源码
-
第二十一章: 错误处理 源码
-
第二十二章: 内存管理 源码
-
第二十三章: 类型转换 源码
-
第二十四章: 结语
- 24-1 迎接 Swift3 Course Video
- 24-2 学完Swift语言之后,应该学什么?大家加油! Course Video
Contributors and Acknowledgements 贡献者.致谢
感谢每一名学习这个课程的同学。感谢每一名在慕课网留言的同学。批评也好,鼓励也罢,都是对我的肯定:)
特别感谢以下github用户,帮助完善了这个课程的代码:
最后,感谢这个时代。