Hey everybody this is Caleb with Debs Lopes dot com and in this video we're going to go ahead and install
some cocoa pods Alamo fire and Alamo fire image to give us the capability to easily make network request
as well as download images.
So very very cool to get started.
I actually want to show you the Alamo fire get hub page where there is tons of very very detailed and
incredible documentation which you can read through your own time.
We'll we'll go through a bit of it but there is a lot here guys that can do a lot of stuff which is
really really cool Alamo fire.
Image is a library that comes from the Alamo fireteam as you can see here but it is specifically for
image components.
So it helps you to to download images really easily and convert them into instances of image that you
can use in your apps which is really cool.
So in order to actually set up cocoa pods for our app what we're going to do is we're going to need
to go and find our project folder which mine is right here.
Then you're going to need to open a terminal window like I have here.
So you're going to need to CD into your directory.
So what I like to do is just type CD space and then drag my folder into the terminal just a little faster
then press enter and we have now changed directories to be inside pixel city and I open it up here so
you can see what happens.
But in order to set up cocoa pods all you need to do is type pod in it.
Now this assumes that you have cocoa pods installed.
If you don't all you need to type is pseudo gem install Coke cocoa pods like that pseudo gem install
cocoa pods run through all of that and you'll have cocoa pods on your system.
And after that all you need to do is type pod in it to initialize an empty pod file press enter and
you'll see that a pod file was created in my project folder.
Now we need to set this up so that we can install both Alamo fire and Alamo fire image.
And so go ahead and right click and I like to use ATOM.
That's just the text editor that I like to use.
There are plenty of them out there but I would advise against using text edit because sometimes the
formatting can get a little screwed up so I like to use ADOM.
It's free and you can download it on online of course.
So pull open that file here and you'll notice there is a blank space called pods for pixel city.
That is where we're going to declare what cocoa pods we want to install.
So let's go ahead and head over to Safari again and we're going to see what we need to do to install
Alamo fire should be here under installation.
Cocoa pods and you'll see it tells you how to install Cocoa Puffs just like I showed you.
But what we need to do is we need to add this line into our pod file.
You notice here it says target your target name.
Do we go to our file.
Here we have target pixel city.
That's the target this POD file is affecting.
And then do.
OK very cool.
Use framework's is here because we're using swift and we want to use dynamic frameworks.
Otherwise it should be commented.
But for this app of course we want that and for the pods all we need to do is to copy Podd Alamo fire
version 4.4.
Copy that in and paste it.
And I like to put a tab there so it's in the right space with everything else.
Very cool.
So that's Alamo fire.
That's good to go.
Now for Alamo fire image.
It's basically the same thing pod alum of fire image version 3.1.
So I'm going to copy that and I'm going to press return then paste it into my pod file.
And at this point I can go ahead and press command s to save my pod file quit Adam and then go back
into your terminal window.
Now we're going to install those two cocoa pods we have just added so to do that all you need to do
is type pod pod install and press enter and you'll notice that it says Downloading dependencies installing
Alamo fire installing Alamo fire image and everything now is good to go.
Although your project photo looks a bit different.
There's a pod file lock file as well as an X C workspace.
When you're using cocoa pods that is what happens is your project gets converted into an extra workspace
and you have to open that.
In order for your project to work with the cocoa pots.
All right.
So go ahead and click pixel city Doxey workspace and I'm going to make mine full screen.
And you'll notice there are two projects in here now one called pods and one called pixel city.
Don't worry about pods for now but go ahead and take a look.
Everything else is the same as it was.
But when you install pods you need to go ahead and do a clean and build.
So go ahead and hold shift command k that will clean your project.
Shift command B and it'll build your project and right now it's analyzing those new libraries but you'll
see it's going to give us some errors.
That is because we're dealing with swift for an ex code Bayda.
But Alamo fire requires swift 3.2.
So let's change that.
Go to your project here click on POD's.
And then what we're going to do is we're going to go to build settings.
OK.
Now these are the build settings for Alamo and fire.
These are the build settings for Alamo fire image.
Now what we need to do is to search for swift language version and if you search for it you'll notice
it's asking for swift for but Alamo fire is not yet updated to swift for so Clix with 3.2.
Then for Alamo fire image do the same thing change it to swift 3.2.
Now when we build the app you'll notice we will have no problems.
Those errors will go away because it's basically kind of like you know on the Nintendo Wii if you wanted
to play Game Cube games you could put a game cube game in even though it was the previous system or
like on the PlayStation 2 if you wanted to play banjo Kazumi you could put in the piece X game into
the tray and it would work.
It's called Backwards compatibility and that's basically what we're doing is we're giving our app the
ability to be backwards compatible with swift 3.2.
So you'll notice all those errors went away.
And if we go into Matt Visi if we tried to import Alamo fire let's give it a shot.
You'll notice that this Alamo fire and Alamo fire image are both in their rightful place.
So that is all we need to do to get Alamo fire and Alamo fire image properly installed and compatible
with X code beta X code 9 beta.
Awesome.
So in the next video we're going to start building out the user interface for Matt Visi and I'm really
excited to get started.
So let's go ahead and zip on over to the next video.
I'll see you there.