Swift Tutorial - Tutorialspoint

(backadmin) #1
i

About the Tutorial


Swift is a new programming language developed by Apple Inc for iOS and OS X
development. Swift adopts the best of C and Objective-C, without the constraints of C
compatibility.


Swift uses the same runtime as the existing Obj-C system on Mac OS and iOS, which
enables Swift programs to run on many existing iOS 6 and OS X 10.8 platforms.


Audience


This tutorial is designed for software programmers who would like to learn the basics of
Swift programming language from scratch. This tutorial will give you enough
understanding on Swift programming language from where you can take yourself to higher
levels of expertise.


Prerequisites


Before proceeding with this tutorial, you should have a basic understanding of Computer
Programming terminologies and exposure to any programming language.


Execute Swift Online


For most of the examples given in this tutorial, you will find a Try it option, so just use
this option to execute your Swift programs on the spot and enjoy your learning.


Try the following example using Try it option available at the top right corner of the
following sample code box:


import Cocoa

/* My first program in Swift */
var myString = "Hello, World!"

println(myString)

Disclaimer & Copyright


 Copyright 2015 by Tutorials Point (I) Pvt. Ltd.


All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd.
The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a
part of contents of this e-book in any manner without written consent of the publisher.


We strive to update the contents of our website and tutorials as timely and as precisely as possible,
however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no
guarantee regarding the accuracy, timeliness or completeness of our website or its contents
including this tutorial. If you discover any errors on our website or in this tutorial, please notify us
at [email protected].

Free download pdf