Swift - How to learn Swift fast

About this article:

1. Explain the purpose of writing this article

2. Organized the basic syntax tree of Swift

3. Look at pictures and write


 The purpose of writing

I read a knowledge column yesterday, and the author talked about "how to research learning". The whole course took 1 hour and 9 minutes and cost me 19 RMB. There is one point of view that I like. That is, "Learning new knowledge as a study". So I'm going to put it into action today, apply what I've learned, and study how to learn Swift.

By looking up the information, I organized the basic syntax of Swift into the following, which is easy to see clearly.

Second, the organized Swift basic syntax tree

3. Look at pictures and write

Then I found that Swift and Objective-C are basically the same. Through analysis and comparison, I divided the next learning content into three parts:

1. Common knowledge of OC, but a different way of writing in Swift, or adding/deleting some rules. This kind of knowledge is usually used frequently, as long as you pay attention to the comparison when learning, you will master it immediately when you actually use Swift later.

For example: NSArray --> Array

For example: the elements in NSArray can be inconsistent, but the elements in the Array must be consistent.

2. There is a type of knowledge, although it also exists in OC, but it is not often used in the project development process, but it is in the "can use, but the theoretical knowledge is not deep". For this kind of knowledge, you need to find a similar prototype in OC first, and then do some serious theoretical study again, and combine the theory with the usual development experience, and then learn the corresponding content in Swift and compare it.

For example, the concept of "subscript script" in Swift is not handled in the same way as Swift syntax in OC. Although there is a subscript operation like for NSArray, the subscript script is placed in a more important and standardized position in Swift.

3. The third category is definitely the new knowledge in Swift that is not in OC. For this kind of knowledge, it is still recommended to compare learning. The first thing to understand is why this is not available in Objective-C, and now in Swift? Once this is understood, the knowledge architecture system of OC will be further consolidated, and Swift will learn faster.

Next, I will write three articles based on the three points summarized above.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324977238&siteId=291194637