1
00:00:00,180 --> 00:00:05,960
So I come back again in these three lessons we are going to talk about of variables.

2
00:00:06,060 --> 00:00:10,860
How do we declare variables avoid the static and dynamic variables.

3
00:00:10,860 --> 00:00:12,930
How do we deal with annotations.

4
00:00:12,960 --> 00:00:18,070
And finally we learn interpellation for printing or converting diapers.

5
00:00:18,090 --> 00:00:26,670
So let's go to school and in here I'm going to make you let's make a new playground actually for this

6
00:00:26,670 --> 00:00:29,400
lesson for the next one I will do a new command tool.

7
00:00:29,400 --> 00:00:38,540
So Neo-Pagan all I'm going to call this one very bad is our playground.

8
00:00:38,620 --> 00:00:43,910
So variables to take out.

9
00:00:43,960 --> 00:00:45,910
So let's see how we do.

10
00:00:45,910 --> 00:00:57,420
These are four things essentially variables let's howl but otherwise inter relations and annotations.

11
00:00:57,430 --> 00:00:58,670
Let's see what do they mean.

12
00:00:58,990 --> 00:01:07,060
So for declaring any variable in sway if you have to use the term voucher or you have to use the term

13
00:01:07,060 --> 00:01:13,480
left and then immediately after either of those you come up with the name of your right.

14
00:01:13,540 --> 00:01:17,760
Imagine I want to integer somebody on my end.

15
00:01:17,770 --> 00:01:22,570
Now there are two ways of declaring this to be an integer.

16
00:01:22,570 --> 00:01:30,160
One of them is explicitly telling that there is going to be an int that is voicing column int and let's

17
00:01:30,160 --> 00:01:31,870
say that's going to be 5.

18
00:01:32,170 --> 00:01:38,940
And the other way is saying let my int 2 is 5.

19
00:01:39,250 --> 00:01:48,360
So in the first method you have explicitly used annotation to tell the compiler that this variable or

20
00:01:48,380 --> 00:01:53,380
is constant is off the typed integer in the second one.

21
00:01:53,410 --> 00:01:59,230
You have actually allowed it to defer from the value that you have initialized it from.

22
00:01:59,380 --> 00:02:04,990
My suggestion to you and anyone who is just starting with is always do it like this.

23
00:02:04,990 --> 00:02:07,110
So you know what you are doing.

24
00:02:07,120 --> 00:02:16,540
So if you're going to ever open a string let's say let's apply a string string that says Hello.

25
00:02:16,660 --> 00:02:20,550
So this would give you a lot more confidence at early stages.

26
00:02:20,560 --> 00:02:26,050
Of course you could also rely on the naming that you are using but a lot of time that naming will not

27
00:02:26,050 --> 00:02:26,890
be like this.

28
00:02:26,890 --> 00:02:34,510
So for instance you might have something called a username and then that doesn't necessarily tell you

29
00:02:34,510 --> 00:02:36,310
that it is of the type of string.

30
00:02:36,310 --> 00:02:39,480
It just tells you it is a variable.

31
00:02:39,490 --> 00:02:45,190
So I started a string and then I'm going to introduce an empty string for instance.

32
00:02:45,190 --> 00:02:51,830
At this point so so far we saw are three things we saw what are all variables.

33
00:02:51,830 --> 00:02:59,030
Variables are the values that you want them to change in Objective C terms you can imagine the value

34
00:02:59,060 --> 00:03:08,590
bet is something like N.S. a string y Let which is a constant is something like an S mutable string.

35
00:03:08,690 --> 00:03:12,290
It's about the mutability of the values of course.

36
00:03:12,290 --> 00:03:15,440
So the next thing you have to talk about is the annotations.

37
00:03:15,440 --> 00:03:17,730
How would they print these values.

38
00:03:17,900 --> 00:03:20,000
So I could go ahead and say print.

39
00:03:20,230 --> 00:03:23,340
And in my print I would say print my string.

40
00:03:23,570 --> 00:03:27,310
And that's something that you know you have seen before as well.

41
00:03:27,500 --> 00:03:34,420
So if I execute my play and art This one says hello and then that one says hello the way we expected

42
00:03:34,430 --> 00:03:34,730
it.

43
00:03:34,850 --> 00:03:36,920
But how would they print my integer.

44
00:03:36,920 --> 00:03:38,900
How would they do the formatting.

45
00:03:38,990 --> 00:03:45,740
Now for my thing in is a lot easier than what we used to do in Objective-C in Strief you would only

46
00:03:45,740 --> 00:03:50,450
do this you would say I want to get a strange result.

47
00:03:50,540 --> 00:03:52,130
I want to do an interpolation.

48
00:03:52,320 --> 00:03:58,280
Then you say for one of the slash privacy's practices in your practices you type whatever you're trying

49
00:03:58,280 --> 00:03:58,780
to get.

50
00:03:58,820 --> 00:04:04,500
In this case my ins and there you have it it prints five.

51
00:04:04,500 --> 00:04:13,760
So for instance I could say My aunt is as usual put a column and then do this little format and then

52
00:04:13,760 --> 00:04:21,790
say execute and it says my intice five any value would be essentially the same thing if not a variable

53
00:04:21,800 --> 00:04:27,010
might float of the type float to be three point five.

54
00:04:27,330 --> 00:04:36,360
Then I would say well print fantasies between the practice Zeitz I'm going to say sorry I'm going to

55
00:04:36,360 --> 00:04:45,000
say quotation marks for a string and then a forward slash and burn practices and my fruit and that's

56
00:04:45,000 --> 00:04:46,030
about that.

57
00:04:46,050 --> 00:04:52,110
So any value would be printed Similarly in here I would say my float is

58
00:04:54,990 --> 00:04:55,660
perfect.

59
00:04:55,710 --> 00:05:03,120
So now that we are here let's quickly talk about two very simple things that actually have one.

60
00:05:03,330 --> 00:05:06,630
So commenting is something you already saw it.

61
00:05:06,630 --> 00:05:09,890
It's exactly identical to what we had in Objective-C.

62
00:05:10,080 --> 00:05:12,480
So you do common things like that.

63
00:05:12,480 --> 00:05:19,380
And finally if you notice you don't need to put the semicolon at the end of your lines so you could

64
00:05:19,710 --> 00:05:26,100
optionally if you like to stick to the same programming format but more and more programming languages

65
00:05:26,100 --> 00:05:31,610
are going towards an era of their semicolon is not necessary anymore.

66
00:05:32,100 --> 00:05:33,910
Swift certainly doesn't need it.

67
00:05:33,920 --> 00:05:38,360
Cosmoline the new programming language for Android development doesn't need it.

68
00:05:38,370 --> 00:05:45,360
So you could just not have them and get used to the format that Swift is by default.

69
00:05:45,360 --> 00:05:49,060
And that's kind of the recommended way by Apple itself.

70
00:05:49,140 --> 00:05:54,310
So that's allotted for variables and Konstanz in interest.

71
00:05:54,450 --> 00:06:00,750
I actually recommend that before you go to the next lesson which is about the optionals just play around

72
00:06:00,750 --> 00:06:05,880
a little bit with these and get a sense of how they are trying to take one of the apps that you have

73
00:06:05,910 --> 00:06:07,070
within the past.

74
00:06:07,150 --> 00:06:13,860
One of the projects that we did earlier on and tried to come in here just the just a valuable part of

75
00:06:13,860 --> 00:06:14,130
it.

76
00:06:14,280 --> 00:06:19,680
So you get a sense of what could go wrong before we go to next lesson and we're going to talk about

77
00:06:19,680 --> 00:06:21,090
the options.

78
00:06:21,180 --> 00:06:22,050
So I see that.
