1
00:00:08,150 --> 00:00:11,320
Everybody what's going on this is Kayla with slopes dot com.

2
00:00:11,330 --> 00:00:17,420
And welcome to Section 5 where you're going to learn how to use observables and subjects in real life

3
00:00:17,450 --> 00:00:18,920
in a real application.

4
00:00:18,980 --> 00:00:20,990
And I'm going to show you the app we're going to build.

5
00:00:20,990 --> 00:00:22,610
It's pretty simple.

6
00:00:22,640 --> 00:00:29,570
But remember Eric Swift is sort of a new way of thinking about programming and SWIP So the app is simple

7
00:00:29,630 --> 00:00:34,730
and it's a good way to showcase some of the features of our swift and some of the things we can do.

8
00:00:34,730 --> 00:00:38,960
So I'm going to pull it open here and just show you a brief demonstration.

9
00:00:39,050 --> 00:00:44,510
Now in this app what you can do is you can select this text field here and you can type your name.

10
00:00:44,510 --> 00:00:52,040
Now what I've done is I've set up this text field to be an observable and the label has subscribed to

11
00:00:52,040 --> 00:00:56,840
the observable and now watch what happens when I pass in new information watch.

12
00:00:56,990 --> 00:01:02,110
Do you see how it updated there with my name just like that.

13
00:01:02,120 --> 00:01:08,150
So as I am changing the data that's going in the label is reacting to that data.

14
00:01:08,150 --> 00:01:09,630
It's really cool.

15
00:01:09,680 --> 00:01:15,080
Now when I click Submit I have set up this label there's a hidden label down here.

16
00:01:15,080 --> 00:01:20,900
I have set that up to observe what is in this text field and when I press submit I trigger that watch

17
00:01:20,900 --> 00:01:22,100
what happens.

18
00:01:22,100 --> 00:01:23,960
Boom it adds it in.

19
00:01:23,960 --> 00:01:27,410
It clears my text field and clears my label back to the default message.

20
00:01:27,410 --> 00:01:34,070
Now I could do another one Samantha and I could push submit and it adds it down there.

21
00:01:34,070 --> 00:01:34,600
OK.

22
00:01:34,730 --> 00:01:39,950
So you might be thinking wow this isn't that really that's not that impressive of an app and you're

23
00:01:39,950 --> 00:01:43,880
right it's not an amazing app that you would put on the App Store and reach the top of the App Store

24
00:01:43,880 --> 00:01:44,390
charts.

25
00:01:44,390 --> 00:01:49,600
But it does demonstrate some very important core arcs swift principles.

26
00:01:49,670 --> 00:01:57,110
So we're going to build this app so that you could pass in a name you can create observables of UI elements

27
00:01:57,260 --> 00:01:58,630
in X code.

28
00:01:58,760 --> 00:02:05,000
You can subscribe to then using other UI elements or alternatively you could use subjects like a published

29
00:02:05,000 --> 00:02:08,710
subject behavior subject or other types of observables.

30
00:02:08,900 --> 00:02:12,320
And we could also trigger actions using our swift.

31
00:02:12,320 --> 00:02:14,090
It's really really cool.

32
00:02:14,090 --> 00:02:20,360
So let's go ahead and let's dive into building the UI of this app in the next video and I'll see it

33
00:02:20,360 --> 00:02:21,300
there.

34
00:02:38,140 --> 00:02:42,310
Let's go ahead and let's head over to the next video where we're going to start creating our XCode project

35
00:02:42,340 --> 00:02:46,920
and installing the Orrick swift and our cocoa cocoa pots.

36
00:02:46,930 --> 00:02:48,700
And we'll explain what that is in the next video.

37
00:02:48,730 --> 00:02:50,280
I'll see you there.
