Learn Swift's content first
You can find some online videos to roughly explore the language features and use of Xcode, and then iterate over the official web-based learning
https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/ thebasics.html#//apple_ref/doc/uid/tp40014097-ch5-id309
Here is a list of iOS development commonly used knowledge points, do not have to learn all at once, language learning and iOS development should be mutually promote, gradually learn.
I. Declaring Constants and Variables
Type Annotations
var welcomemessage:string
Can use keyword for variables
var ' var ' = 1.0
Two
Three primary collection types, Array, Set, and Dictionary, as described in collection types.
Third, function
Define
Functions with no parameters, multiple arguments, and multiple return values
Func someFunction (Argumentlabel parametername:int) {
}
return value
Func Minmax (array: [Int]) (Min:int, max:int)? {
If Array.isEmpty
{return nil}
Else
{return (12,13)}
}
Default Parameter Values
In-out Parameters
Function parameters is constants by default.
Func swaptwoints (_ A:inout int, _ b:inout int) {
Let Temporarya = a
A = b
b = Temporarya
}
Function Types
Equivalent to a function pointer
var mathfunction: (int, int), int = addtwoints
Every function in Swift has a type, consisting of the function ' s parameter types and return type. You can use the this type if any other type in Swift, which makes it easy-to-pass functions as parameters to other functions , and to return functions from functions.
Iv. Enumeration Type
The original enumeration type there are so many to talk about.
Raw value, associated value, recursive definition
V. CLASSES and structures
Liu, protocol
Note: Good code style, notice the space position
iOS (i)