پیشنهاد فرادرس

آموزش Enumerations و Optionals در سوئیفت

دسته بندی ها: آموزش های TreeHouse ، آموزش Swift

دوتا از ویژگی های برتر سوئیفت در مقابل Objective-C، قدرت گسترده ی enumerations و ویژگی های زبانی برای مقابله با مقادیر nil می باشد. در این دوره ما قصد داریم به بررسی enumerations در سوئیفت، تعریف مقادیر مرتبط، بررسی optionals و مقابله با مقادیر nil، کار با optionals و غیره بپردازیم. کار با optionals  می تواند بسیار گیج کننده باشد. در این دوره با Enumerations، مقادیر مرتبط، Optionals، باز کردن Optionals، بررسی Optional Chaining، تطبیق الگو و معرفی Enumerations آشنا می شوید.

سرفصل:

  • مشکل با Primitives
  • مدل سازی Finite Data
  • ایجاد Enum
  • خلاص شدن از Strings
  • Enums و Objects
  • Associated Enums
  • Enums با مقادیر مرتبط
  • متدهای Enum
  • معرفی Optionals
  • کار با Optional Types
  • مقادیر Nil در Collections
  • Objects و Optionals
  • Enumerations با مقادیر خام
  • و غیره
آیا این نوشته را دوست داشتید؟
Enumerations and Optionals in Swift Course Publisher:TeamTreeHouse Author:Pasan Premaratne Level:Beginner

Two of Swift’s most novel features over Objective-C are the extended power of enumerations and the language features to deal with nil values. In this course we’re going to start by exploring enumerations in Swift - how they can define a set of related values, how they can carry associated values and how they make our code much safer by bringing in some wonderful compiler support. After that we take a look at optionals and dealing with nil values. Working with optionals can get pretty confusing so we understand why we do this in the first place and how we can unwrap the values when we need them.
About this Course
Two of Swift’s most novel features over Objective-C are the extended power of enumerations and the language features to deal with nil values. In this course we’re going to start by exploring enumerations in Swift - how they can define a set of related values, how they can carry associated values and how they make our code much safer by bringing in some wonderful compiler support. After that we take a look at optionals and dealing with nil values. Working with optionals can get pretty confusing so we understand why we do this in the first place and how we can unwrap the values when we need them.
What you'll learn
Enumerations
Associated Values
Optionals
Unwrapping Optionals
Optional Chaining
Pattern MatchingIntroduction to Enumerations
Swift allows us to compose custom data types and in this course we take a look at a new language feature - enumerations, that allows us to model related sets of data. We’ll cover the syntax of enums, how we can add members for each data point and how we can associate information with each member.
9 steps
The Problem with Primitives
7:08
Modeling Finite Data
6:17
Creating an Enum
1 objective
Getting Rid of Strings
8:08
Enums and Objects
1 objective
Associated Enums
4:52
Enums with Associated Values
1 objective
Methods on Enumerations
9:37
Enum Methods
2 objectives
Introduction to Optionals
Most languages don’t have a built in way to deal with the absence of data. This can lead to some dangerous consequences where we write buggy code that crashes often. Swift introduces a language feature known as optionals to tackle this problem. In this stage, we'll look at what optionals are and why we use it, how to unwrap optional values and how to write safer code with fewer bugs.
9 steps
The Absence of Data
6:20
Working with Optional Types
6:29
Optional Values
1 objective
Optional Binding
9:16
Nil Values in Collections
1 objective
Downsides to Using If Let
7:51
Early Exits Using Guard
7:01
Initializing Optional Values
1 objective
Recap on Optionals
2:48
Objects and Optionals
Now that we know a bit about both enumerations and optionals, let's take a look at some topics at the intersection of the two. In addition, we'll look at some features in Swift that make it much easier to work with both enums and optionals including things like pattern matching and the nil coalescing operator.
8 steps
Enumerations With Raw Values
9:02
Initializing With Raw Values
4:52
Enums with Raw Values
1 objective
Optional Chaining
9:46
Pattern Matching With Enums
6:35
Nil Coalescing Operator
5:34
Conclusion
2:01
Recap: Enumerations and Optionals
12 questions

پیشنهاد فرادرس

لینک های دانلود حجم فایل: 253.0MB TeamTreeHouse Enumerations and Optionals in Swift Course_git.ir.rar