Everybody what's going on.
This is Caleb with slopes dot com and in this video we're going to create our code project and we're
also going to install the Eric swift and Arctic's cocoa cocoa pods.
So go ahead and open X code and when you get to the Welcome to X code window go ahead and click Create
new X code project.
We're going to go ahead and just choose a single view application.
All right.
And I'm going to call this our.
Well how about our X namer because it's kind of what the app does.
We kind of you know pass in names and submit them so our X namer click next and save that wherever you'd
like awesome and I'm going to pull it open and full screen and let's go ahead and we're actually going
to close this now because we need to set it up to work with cocoa pods so you can actually go ahead
and just quit X code and go ahead an open terminal.
All right.
And I'm also going to open my little project here where I saved this source code which is right here
really cool.
OK.
So I'm going to CD into our X namer like so very cool.
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
you get an error that means that you don't have cocoa pods installed.
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
install cocoa pots press enter enter in your password and then it'll install cocoa pods which basically
allows you to install third party functionality which can be really helpful.
So assuming you have cocoa pods installed go ahead and type pod in it and press enter and you'll notice
a pod file is initialized in the directory.
Pretty cool.
So we're going to edit this POD file by right clicking and opening it with Adam.
Adam is the third party text editor that works with code related files.
Sometimes in text edit certain characters can get converted into a different type and it ends up corrupting
your file so it's best to use a text editor like Adam or sublime text to whichever one you have.
Adam just happens to be free so open it with Adam and as soon as it pops open here we'll pull it up.
And this is what our pod file looks like.
OK.
Now don't worry about any of this it just as the target is our X namer.
K that's the project that it's related to.
Since we're using Swift we need to have use frameworks and uncommented and then beneath this comment
Pod's for our X namer go ahead and press tab and then type pade and we're going to do the little single
quotes there and we're going to type our x.
Swift make sure that you type it the right way with the proper capital letters beneath that.
Go ahead and type.
Whoops Podd are x Ko-Ko.
All right.
Now you're probably wondering what is our cocoa.
I haven't heard about that until just now.
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
is.
All right.
So here we go this is the R X Cocco page of Ark's Swift.
And if you go into the iOS folder you'll notice there is a list of all of the different UI kit elements
K UI page control UI slider you search bar you I textfield you I view.
But after every one it says Plus are x.
If you click on one of these you can see that this allows you to use some of the properties of you view
as reactive observer components.
So that allows us to create UI elements that are observable or that can be observers that can be subscribed
to.
So that is the cool thing about our X Ko-Ko is that it gives us the ability to add our X functionality
to Cocco touch controls.
So we're going to save the pod file here so do command s and quit Atam then back in the terminal go
ahead and type pod install press enter and you'll see it will download install.
Create a pod file and you'll notice some new files over here in your folder.
We can actually quit terminal what you need to do is not open the XCode project but instead open the
X-C workspace and when you do that watch what happens K you'll see that there are now two projects one
for Pod's and one for our X namer.
So don't worry about Pod's necessarily just yet but your project is still here.
We just now have the ability to use those cocoa pods we just installed our swift but watch what happens
if I try to build the project right now.
You'll notice we get a lot of errors lots of read and it'll just continue and continuing continue.
That's because Arik Swift at the recording of this video is not yet compatible with swithe four point
zero.
So in order to use this we need to basically set the build settings to compile our swift as swift 3.2.
So to do that click on the project navigator select the POD's project and what we're going to do is
go into build settings and search for swift language.
OK.
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
language version just with 3.2.
Same with our ex-wife.
We can do that as well.
And when we build and run now you'll notice those errors are going to go away.
There are some warnings still but the errors will go away and we are totally able to use our ICs with
now.
So go into your view controller.
Let's just make sure that we do have access.
So once it's done building I'm going to search or not search but try to import our swift and our X cocoa.
OK.
So now watch if I type import are x swift and our X Cocco they show up right there.
Let's do that again.
Import our X Ko-Ko.
So now in our view controller we have access to our swift and we have access to our X Ko-Ko.
So our project is now ready.
We're going to go ahead and head over to the next video where we're going to build the user interface
for our app.
And then following that we're going to dive in to using our ex-wifes and our X Ko-Ko to make this a
reactive application.
OK let's head over to the next video now.