Swift introduction

Swift Introduction 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 Objective-c system on Mac OS and iOS, which enables Swift programs to run on many […]

Swift Optional Chaining

Swift Optional Chaining Swift Optional Chaining is a very useful feature. Optionals are a type in Swift that wrap primitive types and are typically used for preventing null values. Optional Chaining is the process of chaining calls on optional values such that it handles the unwrapping gracefully and concisely without giving runtime errors. As the […]

Swift Set

Swift Set Swift Sets are a data structure type that holds unique values of the same type in an unordered fashion. Set can only take types that conform to the Hashable protocol. Sets store the values based on the hashValue() thanks to the hashable protocol. Hence the access time is constant in sets. A hashValue is an Integer such […]

Swift String

Swift String String in Swift is an ordered collection of values that are of the type of Character. Similar to Arrays, String defined with var are mutable and strings defined with let keyword are immutable. import Foundation var title = “baluTutorial” let subTitle = “Programming is fun” //immutable From Swift 4 onwards Strings conform to the collections Protocols(Swift […]

Swift Tuple

Swift Tuple Tuples can hold zero or more values. The values need not be of the same type. Tuples in Swift are like mini Struct and should be used for storing temporary values only. 
Tuples are handy when we have to return multiple values from a function. Creating a Tuple Values in a tuple are […]

Swift Type Casting

Swift Type Casting Type Casting consists of two things Type Checking Changing the Type is an operator is used to check the type of an instance type? as an operator is used to casting the instance to another type. Swift Type Checking Swift gives a lot of priority to the readability of the code. No […]