2018-10-12 19:37:13 +00:00
|
|
|
---
|
|
|
|
title: Hello World Swift
|
|
|
|
---
|
|
|
|
|
|
|
|
## Hello World
|
|
|
|
|
2018-12-23 08:10:49 +00:00
|
|
|
We only have to add the method `print("Hello World")` (from the library UIKit) to the function `viewDidLoad()` of the class `ViewController`:
|
2018-10-12 19:37:13 +00:00
|
|
|
|
|
|
|
```Swift
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
class ViewController: UIViewController {
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
super.viewDidLoad()
|
|
|
|
// Do any additional setup after loading the view, typically from a nib.
|
|
|
|
|
|
|
|
print("Hello World")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Output:
|
|
|
|
```
|
|
|
|
>Hello World
|
|
|
|
```
|