1
00:00:07,900 --> 00:00:09,070
Everybody what's going on.

2
00:00:09,070 --> 00:00:14,650
This is Caleb with slopes dot com and in this video we're going to create our code project and we're

3
00:00:14,650 --> 00:00:19,210
also going to install the Eric swift and Arctic's cocoa cocoa pods.

4
00:00:19,330 --> 00:00:25,540
So go ahead and open X code and when you get to the Welcome to X code window go ahead and click Create

5
00:00:25,540 --> 00:00:26,990
new X code project.

6
00:00:27,220 --> 00:00:31,390
We're going to go ahead and just choose a single view application.

7
00:00:31,390 --> 00:00:31,890
All right.

8
00:00:31,960 --> 00:00:34,210
And I'm going to call this our.

9
00:00:34,240 --> 00:00:38,680
Well how about our X namer because it's kind of what the app does.

10
00:00:38,680 --> 00:00:45,010
We kind of you know pass in names and submit them so our X namer click next and save that wherever you'd

11
00:00:45,010 --> 00:00:52,690
like awesome and I'm going to pull it open and full screen and let's go ahead and we're actually going

12
00:00:52,690 --> 00:00:57,730
to close this now because we need to set it up to work with cocoa pods so you can actually go ahead

13
00:00:57,730 --> 00:01:02,170
and just quit X code and go ahead an open terminal.

14
00:01:02,200 --> 00:01:03,050
All right.

15
00:01:03,130 --> 00:01:14,050
And I'm also going to open my little project here where I saved this source code which is right here

16
00:01:14,770 --> 00:01:15,480
really cool.

17
00:01:15,490 --> 00:01:16,010
OK.

18
00:01:16,210 --> 00:01:21,340
So I'm going to CD into our X namer like so very cool.

19
00:01:21,460 --> 00:01:28,780
And what I'm going to do is in order to set up the cocoa pods we need to type pod in that case and if

20
00:01:28,780 --> 00:01:32,470
you get an error that means that you don't have cocoa pods installed.

21
00:01:32,470 --> 00:01:38,740
So what you need to do then zoom in here so you can see what you need to do then is to type sudo gem

22
00:01:38,830 --> 00:01:47,050
install cocoa pots press enter enter in your password and then it'll install cocoa pods which basically

23
00:01:47,050 --> 00:01:51,100
allows you to install third party functionality which can be really helpful.

24
00:01:51,100 --> 00:01:59,080
So assuming you have cocoa pods installed go ahead and type pod in it and press enter and you'll notice

25
00:01:59,320 --> 00:02:02,590
a pod file is initialized in the directory.

26
00:02:02,590 --> 00:02:03,910
Pretty cool.

27
00:02:03,940 --> 00:02:09,900
So we're going to edit this POD file by right clicking and opening it with Adam.

28
00:02:09,940 --> 00:02:14,750
Adam is the third party text editor that works with code related files.

29
00:02:14,900 --> 00:02:21,970
Sometimes in text edit certain characters can get converted into a different type and it ends up corrupting

30
00:02:21,970 --> 00:02:28,660
your file so it's best to use a text editor like Adam or sublime text to whichever one you have.

31
00:02:28,690 --> 00:02:34,960
Adam just happens to be free so open it with Adam and as soon as it pops open here we'll pull it up.

32
00:02:35,290 --> 00:02:37,130
And this is what our pod file looks like.

33
00:02:37,270 --> 00:02:37,810
OK.

34
00:02:38,050 --> 00:02:41,840
Now don't worry about any of this it just as the target is our X namer.

35
00:02:41,860 --> 00:02:44,350
K that's the project that it's related to.

36
00:02:44,350 --> 00:02:51,670
Since we're using Swift we need to have use frameworks and uncommented and then beneath this comment

37
00:02:51,670 --> 00:02:59,710
Pod's for our X namer go ahead and press tab and then type pade and we're going to do the little single

38
00:02:59,710 --> 00:03:03,390
quotes there and we're going to type our x.

39
00:03:03,430 --> 00:03:08,830
Swift make sure that you type it the right way with the proper capital letters beneath that.

40
00:03:08,830 --> 00:03:10,460
Go ahead and type.

41
00:03:10,970 --> 00:03:14,290
Whoops Podd are x Ko-Ko.

42
00:03:14,340 --> 00:03:15,290
All right.

43
00:03:15,580 --> 00:03:18,160
Now you're probably wondering what is our cocoa.

44
00:03:18,160 --> 00:03:20,740
I haven't heard about that until just now.

45
00:03:20,890 --> 00:03:26,770
And so I'm going to go ahead and pull open the get hub page for our X Cocco to show you what our X Ko-Ko

46
00:03:26,830 --> 00:03:27,570
is.

47
00:03:27,850 --> 00:03:28,150
All right.

48
00:03:28,150 --> 00:03:32,560
So here we go this is the R X Cocco page of Ark's Swift.

49
00:03:32,560 --> 00:03:40,240
And if you go into the iOS folder you'll notice there is a list of all of the different UI kit elements

50
00:03:40,270 --> 00:03:46,220
K UI page control UI slider you search bar you I textfield you I view.

51
00:03:46,480 --> 00:03:49,530
But after every one it says Plus are x.

52
00:03:49,690 --> 00:03:55,240
If you click on one of these you can see that this allows you to use some of the properties of you view

53
00:03:55,570 --> 00:03:58,210
as reactive observer components.

54
00:03:58,270 --> 00:04:05,830
So that allows us to create UI elements that are observable or that can be observers that can be subscribed

55
00:04:05,830 --> 00:04:06,040
to.

56
00:04:06,040 --> 00:04:12,550
So that is the cool thing about our X Ko-Ko is that it gives us the ability to add our X functionality

57
00:04:12,550 --> 00:04:14,240
to Cocco touch controls.

58
00:04:14,440 --> 00:04:21,860
So we're going to save the pod file here so do command s and quit Atam then back in the terminal go

59
00:04:21,860 --> 00:04:28,380
ahead and type pod install press enter and you'll see it will download install.

60
00:04:28,390 --> 00:04:34,160
Create a pod file and you'll notice some new files over here in your folder.

61
00:04:34,210 --> 00:04:41,260
We can actually quit terminal what you need to do is not open the XCode project but instead open the

62
00:04:41,260 --> 00:04:49,670
X-C workspace and when you do that watch what happens K you'll see that there are now two projects one

63
00:04:49,670 --> 00:04:52,090
for Pod's and one for our X namer.

64
00:04:52,250 --> 00:04:58,760
So don't worry about Pod's necessarily just yet but your project is still here.

65
00:04:58,760 --> 00:05:04,820
We just now have the ability to use those cocoa pods we just installed our swift but watch what happens

66
00:05:04,820 --> 00:05:07,160
if I try to build the project right now.

67
00:05:07,820 --> 00:05:13,640
You'll notice we get a lot of errors lots of read and it'll just continue and continuing continue.

68
00:05:13,640 --> 00:05:19,730
That's because Arik Swift at the recording of this video is not yet compatible with swithe four point

69
00:05:19,730 --> 00:05:20,500
zero.

70
00:05:20,630 --> 00:05:28,110
So in order to use this we need to basically set the build settings to compile our swift as swift 3.2.

71
00:05:28,280 --> 00:05:34,460
So to do that click on the project navigator select the POD's project and what we're going to do is

72
00:05:34,460 --> 00:05:38,990
go into build settings and search for swift language.

73
00:05:39,000 --> 00:05:39,780
OK.

74
00:05:40,100 --> 00:05:46,520
Now it's not going to show up for the pods dash or X namer but for Ark's cocoa we can change the swift

75
00:05:46,520 --> 00:05:48,980
language version just with 3.2.

76
00:05:48,980 --> 00:05:50,130
Same with our ex-wife.

77
00:05:50,140 --> 00:05:51,280
We can do that as well.

78
00:05:51,290 --> 00:05:56,600
And when we build and run now you'll notice those errors are going to go away.

79
00:05:56,660 --> 00:06:04,280
There are some warnings still but the errors will go away and we are totally able to use our ICs with

80
00:06:04,280 --> 00:06:04,800
now.

81
00:06:05,000 --> 00:06:07,160
So go into your view controller.

82
00:06:07,160 --> 00:06:10,330
Let's just make sure that we do have access.

83
00:06:10,370 --> 00:06:23,070
So once it's done building I'm going to search or not search but try to import our swift and our X cocoa.

84
00:06:23,320 --> 00:06:23,660
OK.

85
00:06:23,680 --> 00:06:30,530
So now watch if I type import are x swift and our X Cocco they show up right there.

86
00:06:30,580 --> 00:06:31,320
Let's do that again.

87
00:06:31,330 --> 00:06:34,110
Import our X Ko-Ko.

88
00:06:34,150 --> 00:06:40,710
So now in our view controller we have access to our swift and we have access to our X Ko-Ko.

89
00:06:40,840 --> 00:06:43,390
So our project is now ready.

90
00:06:43,540 --> 00:06:48,040
We're going to go ahead and head over to the next video where we're going to build the user interface

91
00:06:48,310 --> 00:06:49,230
for our app.

92
00:06:49,420 --> 00:06:54,550
And then following that we're going to dive in to using our ex-wifes and our X Ko-Ko to make this a

93
00:06:54,550 --> 00:06:55,870
reactive application.

94
00:06:55,960 --> 00:06:57,940
OK let's head over to the next video now.
