Welcome to Swift Tutorial. In this series of Swift Tutorials, you will learn all the basics of Swift programming language with detailed examples.
Introduction to Swift
- Swift is a new programming language developed by Apple Inc.
- Swift is used to develop applications for iOS and OS X.
Pre-requisites for Swift Tutorial
This Swift Tutorial is targeted for beginners. So, every topic shall be explained in detail. You will find it better if you know basic programming concepts or any other programming language.
In this Swift Tutorial series, we shall go through the following topics.
Swift Basic Tutorials
These basic Swift Tutorials gets you introduced with the datatypes available in Swift, how to declare variables, constants, etc, what are the keywords available in swift, and operators like logical, arithmetic, boolean, etc.
- Swift Hello World Program
- Swift Data Types
- Swift Variables
- Swift Comments
- Swift Optionals
- Swift Tuples
- Swift Keywords
- Swift Constants
- Swift Literals
- Swift Operators
- How to create an Integer variable in Swift?
- How to create a String variable in Swift?
- How to get Type of variable in Swift?
The following Swift Tutorials deal with each of the datatype in Swift separately with examples.
The following Swift Tutorials deal with each of the operator in Swift separately with examples.
Swift Decision Making Tutorials
The decision making statements are those that execute a block of statements based on the evaluation of an expression (or condition).
Swift Loops Tutorials
Looping statements help to execute a set of statements repeatedly based on the evaluation of a condition. Also, there are loop control statements like break and continue to break a loop abruptly and continue with the other statements or skip the execution of statements for an iteration.
- Swift for loop
- Swift while loop
- Swift repeat while loop
- Swift continue
- Swift break
- Swift fallthrough
- Swift forEach
- Swift forEach – break
Swift Integer Tutorials
Swift Strings Tutorials
Strings are the basic data types that one uses for most of the real-time applications. Following series of Swift Tutorials help you on how to work with Strings in Swift, how to find the length of a string, how to check if two strings are equal, how to convert a string to integer or vice-versa, and other useful string operations.
- How to find String Length in Swift?
- How to Concatenation Strings in Swift?
- How to Append a String to Another String in Swift?
- How to check if two Strings are Equal in Swift?
- How to check if String is Empty in Swift?
- How to find Sub-String in Swift?
- How to check if a String contains Another String in Swift?
- How to Split a String by Character Separator in Swift?
- How to Reverse a String in Swift?
- How to Insert a Character in String at Specific Index in Swift?
- How to Remove a Character in String at Specific Index in Swift?
- How to check if a String starts with Another String in Swift?
- How to check if a String ends with Another String in Swift?
- How to convert a String to Uppercase in Swift?
- How to convert a String to Lowercase in Swift?
- How to Convert String to Integer in Swift?
- How to include Double Quotes inside a String in Swift?
Swift Array Tutorials
Arrays store like kind of elements in a sequential manner and can be accessed using a single variable name and of-course the index. Following Swift Tutorials deal with how to work with Arrays in Swift, starting from initialization and proceeding with different operations like printing, checking, appending, removing elements from the array.
Creating Swift Arrays
- Swift Array
- Create Empty Array in Swift
- Create Empty String Array in Swift
- Create an Array of Specific Size in Swift
- Create an Array with Default Value for Each Item in Swift
- Create an Array with Initial Values in Swift
- Swift Array Initialisation
- Swift Integer Array
- Swift String Array
- Print Swift Array
- Check if an Array is Empty
- Get Swift Array Size
Modify Swift Arrays
- Swift Array – Append an Element
- Swift Array – Append Another Array
- Append an integer to the Swift Array
- Append String to Swift Array
- Concatenate two Swift Arrays using Addition (+) Operator
- Remove an element from Swift Array
Accessing Swift Arrays
- Swift Array – Access Elements using Index
- Swift Array – Loop over Elements using For Loop
- Swift Array – Loop over Elements using While Loop
- Swift Array – Loop over Elements using forEach Loop
Swift Set Tutorials
Sets are collection of items that are stored not necessarily in sequential manner.
- Swift Set
- Check if an element is present in a Set
- Add or insert an element to Swift Set
- Get Set Size
- Print elements of Set
Swift Dictionary Tutorials
- Swift Dictionary
- Create Swift Dictionary
- Create Dictionary using Arrays for keys and values
- Convert Dictionary into Arrays of keys and values
- Get Dictionary Size
- Iterate Swift Dictionary
- Append Element to Dictionary
- Get Value using Key in Dictionary
- Check if a specific key is present in the Dictionary
- Check if the Dictionary is empty
- Print all keys in a Dictionary
- Merge Dictionaries
Other Useful Swift Tutorials
- Swift Characters
- Swift Functions
- Swift Closures
- Swift Enum
- Swift Structures
- Swift Classes
- Swift Properties
- Swift Methods
- Swift Subscript
- Swift Inheritance
- Swift Initialization
- Swift Deinitialization
- Swift ARC
- Swift Optional Chaining
- Swift Type Casting
- Swift Extensions
- Swift Protocols
- Swift Generics
- Swift Access Control