1,a single statement can be broken into multiple lines ,For example, after an opening parenthesis is a good place:
print(
"world")
2,Swift is a compiled language, the syntax of message-sending is dot-notation. every noun is an object, and every verb is a message.
3,An object type can be extended in Swift, meaning that you can define your own messages on that type. For example, you can’t normally send the say- Hello message to a number. But you can change a number type so that you can:
extension Int { func sayHello() {
print("Hello, I‘m \(self)") }
} 1.sayHello() // outputs: "Hello, I‘m 1"
4, what “everything is an object” really means. ?
In Swift, then, 1 is an object. In some languages, such as Objective-C, it clearly is not; it is a “primitive” or scalar built-in data type. So the distinction being drawn here is between object types on the one hand and scalars on the other. In Swift, there are no scalars; all types are ultimately object types. That’s what “everything is an object” really means.
5,