1
00:00:08,070 --> 00:00:10,340
Hey everybody this is Caleb with slopestyle.

2
00:00:10,530 --> 00:00:15,290
And in this video we're going to talk about how you can get our act Swift in a playground.

3
00:00:15,360 --> 00:00:15,920
OK.

4
00:00:16,110 --> 00:00:22,260
Now it's actually much easier than you might be thinking to install a cocoa pod like arke swift into

5
00:00:22,260 --> 00:00:23,220
a playground.

6
00:00:23,610 --> 00:00:28,980
And we can think the actual Rick swift team or whoever is behind our swift.

7
00:00:28,980 --> 00:00:31,230
It is a community supported project.

8
00:00:31,440 --> 00:00:36,360
We can thank them for making it easy for us to get an arc swift playground.

9
00:00:36,360 --> 00:00:43,560
Now it is possible to do this by yourself but there have been a ton of issues with Xcode 9 especially

10
00:00:43,550 --> 00:00:45,180
X code 9 beta.

11
00:00:45,180 --> 00:00:52,020
It does not like the swift for version of our swift it recognizes it as the wrong type.

12
00:00:52,020 --> 00:00:59,700
There's all kinds of issues with our with X code 9 beta but thankfully our swift team has already compiled

13
00:00:59,770 --> 00:01:03,020
in our ex-wifes playground that does work with X code beta.

14
00:01:03,030 --> 00:01:10,200
So if you go to get hub and you search for Ark's Swift all you need to do is to either clone or download

15
00:01:10,650 --> 00:01:14,280
the swift repository.

16
00:01:14,280 --> 00:01:18,880
And you'll notice that right here there is something called our X playground.

17
00:01:18,990 --> 00:01:19,450
OK.

18
00:01:19,680 --> 00:01:21,780
I'm going to show you how to use that in just a second.

19
00:01:21,780 --> 00:01:27,330
But for now I'm just going to go ahead and pull open the one that I downloaded here and I want to show

20
00:01:27,330 --> 00:01:28,710
you how it's done.

21
00:01:28,710 --> 00:01:33,750
So let's go ahead and let's open up our X-Com playground.

22
00:01:33,870 --> 00:01:36,360
So when you open it it'll come up like this.

23
00:01:36,360 --> 00:01:37,700
And it gives you some instructions.

24
00:01:37,700 --> 00:01:38,700
Check it out.

25
00:01:38,760 --> 00:01:46,500
It says open our ex-cult workspace k then build the ark swift Macko s scheme then find the playground

26
00:01:46,500 --> 00:01:47,630
in the project navigator.

27
00:01:47,640 --> 00:01:51,270
Then show the debug area so let's go ahead and let's close this.

28
00:01:51,390 --> 00:01:53,970
Let's open our X workspace.

29
00:01:54,560 --> 00:01:55,180
OK.

30
00:01:55,290 --> 00:02:03,660
And I'm going to pull it up here and like it said we go let's see we need to find our X swift Mac OS

31
00:02:04,050 --> 00:02:05,570
we need to build it.

32
00:02:05,890 --> 00:02:06,740
And there we go.

33
00:02:06,840 --> 00:02:12,390
And now we can open up the X playground and there's the same directions that we just saw.

34
00:02:12,390 --> 00:02:15,960
So now of course it gives us all kinds of documentation information.

35
00:02:15,960 --> 00:02:17,870
This is from the swift team.

36
00:02:17,940 --> 00:02:23,770
But what you can do is you can right click new playground page and check this out.

37
00:02:23,780 --> 00:02:31,320
Let's let's name this demo what you can do is you can go in and I'm going to select all press delete

38
00:02:31,380 --> 00:02:33,140
and it gets rid of those buttons.

39
00:02:33,360 --> 00:02:38,730
Now what I can do is I can import and watch this are x swift.

40
00:02:38,880 --> 00:02:41,070
Now when I build it you'll notice there are no errors.

41
00:02:41,070 --> 00:02:43,180
We have access to our swift.

42
00:02:43,230 --> 00:02:48,150
There's something else though that we need to implement and it's going to give us the ability to basically

43
00:02:48,150 --> 00:02:50,670
let our playground run indefinitely.

44
00:02:50,670 --> 00:02:51,010
OK.

45
00:02:51,030 --> 00:02:52,980
And using re-active we need to do that.

46
00:02:52,980 --> 00:02:57,620
So go ahead and type import playground support.

47
00:02:58,040 --> 00:03:01,470
OK and of course you might have to build it maybe clean it.

48
00:03:01,470 --> 00:03:09,170
Now of course we can import playground support and we can type playground page dot current.

49
00:03:09,510 --> 00:03:16,080
And then this right here needs indef. execution basically meaning it's just going to execute our playground

50
00:03:16,140 --> 00:03:19,470
indefinitely and we'll set that to be equal to true.

51
00:03:19,470 --> 00:03:21,950
So we have now imported our ex Swift.

52
00:03:22,050 --> 00:03:27,720
We have now imported playground support and we have set it to indefinitely execute now we need to check

53
00:03:27,720 --> 00:03:30,990
to make sure that all of our Good Stuff is in here.

54
00:03:30,990 --> 00:03:33,580
So let's go ahead and let's create an observable.

55
00:03:33,870 --> 00:03:42,290
Let's just say var observe a bowl of type observable and we can give it a specific type of string.

56
00:03:42,570 --> 00:03:47,600
It looks like it's there all of our arcs swift stuff is here ready for us to use.

57
00:03:47,640 --> 00:03:54,900
So that is how you're going to basically get a playground that works with Eric swift for just playing

58
00:03:54,900 --> 00:03:56,480
around with it seeing how it works.

59
00:03:56,490 --> 00:04:01,830
And we're going to dive in a little bit deeper in the next section where we talk about observables we

60
00:04:01,830 --> 00:04:05,160
talk about subscriptions and disposables.

61
00:04:05,160 --> 00:04:10,000
So let's head over to the next section now that we have a playground set up and ready for us to go.

62
00:04:10,020 --> 00:04:10,940
So Ossie over that.
