6. iOS 11 and Swift 4 Application Development Course Free in Hindi - HelloWorld ! Program
About this article
In this article, we are going to take a look at the hello world program in XCode9. This will be very basic video and thus won't include much of the code explanation.
The Code
As I told in the first episode, the code is in the ViewController.swift. You can switch between files on the left side in the navigation bar. Here the class name is ViewController and the code goes inside the class, inside {} these brackets
5. iOS 11 and Swift 4 Application Development Course Free in Hindi - Text-Fields in XCode 9
Comments
Comments are lines that won't be executed and are ignored by the compiler. These lines are for information and to provide guidelines to developers and for reference. You can add comments by using these symbols and the lines will turn green - // Comments here
5. iOS 11 and Swift 4 Application Development Course Free in Hindi - Text-Fields in XCode 9
Modules
Modules are kind of extensions that can add functionality to the application for eg. the user interface eg buttons etc is part of the UIKit module. Importing modules will add more features to the application. Modules can be imported using the 'import' statement before the name of the module.
5. iOS 11 and Swift 4 Application Development Course Free in Hindi - Text-Fields in XCode 9
Functions / Method
Everything after the 'func' is a function also known as a method. It can be used to execute code it contains the main chunk of the code. Here the name of the function is ViewDidLoad. More information can be passed or sent to the function by adding it in the circle brackets () Everything inside {} brackets is the code of the function.
5. iOS 11 and Swift 4 Application Development Course Free in Hindi - Text-Fields in XCode 9
Print Statement
We have added the following code in viewDidLoad() function
print("Priyank Gada ! Subscribe ")
to print everything between double quotes in the output window once the application is built.
5. iOS 11 and Swift 4 Application Development Course Free in Hindi - Text-Fields in XCode 9