Category: swift Tutorials

Chapter 13 : Swift Loops

Sometimes we need to execute a piece of code several time. For example if need to print counting from 1,2….100 then instead of writing print statement 100 times we prefer to add a loop of for and print in a single line. We have below loops statement to be used in swift for-in : This

Chapter 12 : Swift Decision Making Statement

Sometimes in coding we need to make a decision, such decisions are made using decision making structures. We have below decision making structures if statement : It consists of a boolean expression either true or false. We can use if statement one after another for multiple condition handling. if else statement : It contain either

Chapter 11 : Swift Operators

Operator are used for mathematical and logical manipulation with variables. We have below operators that supports Objective-C included with swift support Arithmetic Assignment Bitwise Comparison Logical Misc Range Arithmetic Operator If A = 10 , B = 11 +  Adds two operands A + B will give 21 − Subtracts second operand from the first

Chapter 10 : Swift Literals

As per wikipedia meaning of Literal in computer programming is a notation for representing a fixed value in source code. Almost all programming languages have notations for atomic values such as integers, floating-point numbers, and strings, and usually for booleans and characters; some also have notations for elements of enumerated types and compound values such

Chapter 9 : Swift Constants

  Constants is the fixed value of a program that may not be changed during the program execution, means we cannot change or modified its value after its definition. Constant can be a Enumeration/character / String / Float / Integer type .  Syntax:  we have to use let keyword for it let Name_of_constant =  initialize_value

Chapter 8 : Swift Tuples

As per definition of english word Tuple – A data structure consisting of multiple parts. So tuples are used to group multiple values in a single value.Its of any type. Syntax : var Tuple_name = (Tuple_value1, Tuple_value2, Tuple_value1….to any number of values) For Example : 1) Single value tuple var errorType = (404) we can

Chapter – 7 Optionals

  Optionals type is used to handle if there is no value , it says there is a value and it is equal to x or there is not a value at all. It has two value None or SomeValue(T) where T is an associated value For Example : for string var someStr: String? or

Chapter 6 : Swift Variables

A variable is a storage location name, identified by a memory location , paired with its associative name or identifier having some quantity of information or value. Swift 4 have below basic variable As discuss in last Chapter – 5 Int or Uint Float Double Bool Character NOTE: There are few more types of variables

Chapter 5 : Swift Data types

In programming language we need to use different type of variables to store and transfer information from one view to another. Whenever a variable is  created we reserve some space to the memory,So variable are the reserved memory locations to store values. There are different type of variables in swift like character , string ,float

Chapter 4 : Swift Basic Syntax

In last chapter we have create simple default playground Hello world Code Now in this chapter we learn about basic syntax which we can use further in our Code. use of import and UIKit 1.import statement is used to import any framework or library of Objective-C or C library. 2.print  statement is used to print