iOS : iOS is an operating system used for mobile devices manufactured by Apple Inc.

First question that comes in mind is , what is Swift ?

Swift 3.0, the first major release of Swift since it was open-sourced, is now officially released! Swift 3 is a huge release containing major improvements and refinements to the core language and Standard Library, major additions to the Linux port of Swift, and the first official release of the Swift Package Manager.

From <https://swift.org/blog/>

Keep it short, Swift language is developed by Apple Inc , for their Apple products. It is much safer as compared to Apple earlier version programming language Objective C. It follows Object-Oriented Design pattern. Swift is much more easier to use.

Swift 3.0, the first major release of Swift since it was open-sourced, is now officially released! Swift 3 is a huge release containing major improvements and refinements to the core language and Standard Library, major additions to the Linux port of Swift, and the first official release of the Swift Package Manager.

From <https://swift.org/blog/>

 

We could gear up with the iOS programming with the help of an IDE that is also developed by

Apple Inc and available in App Store is Xcode.

Currently, we are available with Xcode 8, Swift 3 (just launched recently with the release of iOS10).

 

If everything is fine, now lets jump off to some practicals :

Step 1 : Launch the Xcode
XCode Launch Screen

 

Step 2 : Create a new Xcode project
project-init





Step 3 : Enter the project name and sign in with the team that is using the Apple developer account. You may choose the desired organisation name and Devices. (If you want to develop the apps that can be run on boith the iPhone and iPad, then choose Universal. )

Choose the language as Swift only .

For now uncheck all 3 Use Core Data, Include UnitTests and UI Tests.

Step 4 : Now you are here in the main screen of Xcode IDE, where you have to start writing the codes.

You may observe the ViewController.swift and Main.storyboard. The default view of Main.storyboard has ViewController.swift as default class.

All set to write few lines of codes.
swift-code-structure

Before that press Command + R and run the proper simulator or deploy on proper devices that is being connected.

Step 5 : add this one line code
swift-code-hello-world

print("Hello World")

 

Now run the code again.

 

You will find the Hello World printed on the console bottom of the Xcode window.
swift-code-hello-world-output

You can download the whole source code for the same from my GitHub repository.

Load More By qwertyasvishwa
Load More In code corner

Check Also

Buil Your First Camera App – Swift

Today,  I will share how to make a Camera App, and store the clicked Selfie and upload the…