Antroduction
In this article, we are going to study some basic concepts and fundamentals of Swift language, which is very important for the new programmers and developers who change their fields and move towards the iOS app development.
What Is a Variable?
- Variable is nothing but a place where you want to store your data, but you have to follow some rules when you store data.
- Swift language is similar to JavaScript and PHP; because when you need to declare any type of variable, you only need to declare Var keyword.
- We can change variable value at any point which means that we can assign a value, but later we change the value.
- By declaring variable name, Camel case is the best approach to declare a new variable.
- Declare a simple variable with name myVariableName and assign it integer and float value.
We change Variable Value
- Yes, if you assign one value to a variable or you want to change the value or assign it in a new value, then you will easily do it.
- In this image, we declare the variable and assign the value, but in the second or third line, we change the variable value and the compiler can’t prompt any error.

What Is Type Conversion?
- Type conversion is a mechanism, in which you can convert your data format into another format.

- You can see that we declare two variables, where one is an integer and the second is double. We want to convert the datatype of decimal variable, but we see that there is an error prompt because we can’t follow the right method to convert the datatype. Basically, in this step, we will assign the value not to convert the value.

- In this image, you can see that in the third line, we declare a new variable and then we will give the datatype in which we want to convert the variable and subsequently in the round brackets, we pass the variable name and in the fourth line; we add both the value s, which are now integers.





Shobana JPosted Jul 7, 2016, 7:23 AM
Nice one
Vignesh ManiPosted Jun 9, 2016, 5:17 AM
Nice
Santhakumar MunuswamyPosted Jun 9, 2016, 12:18 AM
Thank you for nice share
farooq smdPosted Jun 8, 2016, 8:02 AM
nice
Debasis SahaPosted Jun 7, 2016, 3:53 PM
Nice share..