关于此课程

Swift 是苹果公司专为 iOS 和 OS X 系统开发创建的一款语言。它快速、简洁,并配有工具,使代码可视化比以往任何时候都更加容易。

本课程重点介绍 Swift 编程语言的语法。完成此课程后,你将能够应用 Swift 基础要素来构建 iOS 应用,并能熟练地使用 Swift 更独特的元素,如可选类型和 switch 语句。

喜欢这门课程?加入“iOS 工程师”纳米学位,点此免费体验

学费
免费
学习时间
大约 3 weeks
难度
中级
你将获得

Rich Learning Content

Interactive Quizzes

Taught by Industry Pros

Self-Paced Learning

Student Support Community

开始你的旅程

学习这门免费课程,迈出通往编程入门职业道路的第一步。

免费课程

学习 Swift 编程语言语法

通过创新性的自主学习方式,掌握新技能,提升竞争力。

Icon steps 54aa753742d05d598baf005f2bb1b5bb6339a7d544b84089a1eee6acd5a8543d
 
 

课程讲师

Gabrielle Miller-Messner

Gabrielle Miller-Messner

讲师

你将学到什么

lesson 1

Swift Basics

  • An introduction to Swift types and operators.
  • Develop deftness in defining variables and constants.
  • Practice what you've learned with exercises in Swift playgrounds.
lesson 2

Optional Types

  • Declare explicitly and implicitly unwrapped optionals.
  • Unwrap optionals using both optional binding and optional chaining.
  • Practice safely unwrapping optionals and learn to avoid errors.
lesson 3

Swift Collections

  • Learn about the Swift Collection Types: Dictionaries, Arrays, and Sets.
  • Perform basic operations including: append, count, insert, remove, update, find, and retrieve.
  • Practice manipulating collections with exercises in Swift playgrounds.
lesson 4

Control Flow: Loops, If statements, and Switches

  • Practice fast iteration with for-in loops by iterating through items in Arrays and Dictionaries.
  • Create programming logic of increasing complexity with if-else statements.
  • Delight in the convenience and conciseness of Swift switch statements.
lesson 5

How to Write and Call Functions in Swift

  • Define and call functions.
  • Correctly use local and external parameters.
  • Identify parameter types and return types.
lesson 6

Classes, Properties, and Methods

  • Practice building custom classes with their own properties and methods.
  • Learn about type properties and computed properties.
  • See example use cases for type methods and instance methods.
lesson 7

Enums and Structs

  • Learn the difference between value types and references types.
  • Practice choosing when to use enums, structs, and classes.
  • Use enums to make your switch statements extra Swifty.
lesson 8

Protocols and Extensions

  • Learn how protocols and extensions can help keep your code DRY.
  • Given a series of code snippets, fix compiler errors by implementing protocols.
  • Edit the code in a sample app to see extensions in action.
lesson 9

Closure Expressions

  • Practice using Swift closures with the functions, sorted() and filter().
  • Learn shorthand closure expression syntax to make your closures super concise.
  • See how closures are used in animations in the method, animateWithDuration.

先修知识及要求

本课程要求学生之前有编程经验!具体来说,你要熟悉编程概念,如变量、if 语句和循环,以及面向对象的概念,如方法和类。

你还需要有一台运行 OS X 10.10 或更高版本的 Mac 计算机。

查看使用优达学城的技术要求

为什么学习这门课程?

  • 快速和有趣地了解 Swift 基础知识。
  • 通过 Playground 习题练习
  • 透彻地解释 Swift 某些不太直观的特性,如可选类型(Optionals)和闭包(Closure)表达式。
我将获得什么?
Instructor videos Learn by doing exercises Taught by industry professionals