Everyone welcome back to class.
JOHNNY B who with those slopes dot com and this lesson we are going to get our project all set up.
All right we are going to create our firebase project.
We are going to import some assets.
We're going to add our cocoa pods and yes let's get to it.
I got myself a brand new project here just go to file new project.
OK.
And we are going to be working with in Iowa's single view app.
So when saying next and put in our product name and call mine random R and D M because the cool thing
to do these days is just get rid of all those vowels right.
All right.
So we got random and putting your team organization name your identifier and you're going to do com.
JOHNNY B.
And languages of course Swift and you can leave these unchecked.
I'm going to say next I'm going to put mine right here on the desktop and I'm going to create a good
repository and just create.
All right.
Here we are now right off the bat.
I'm going to go ahead and uncheck the landscape left and landscape right because we're just going to
be working with portrait mode here and I'm going to change devices to iPhone.
All right we're just going to simplify things a little bit here and we're going to put these constraints
on it.
All right.
So we got our brand new project here.
Now let's go ahead and get ready to use firebase with it.
All right.
So I'm going to open up a browser here Safari.
And if you just go to fire based on Google dot com and then go to sign and you can sign in with any
of your Google accounts and you will already be able to start using firebase.
OK so here I am signed in.
And you'll see something like this on your console this is that console that firebase based on Google
dot com.
All right.
This is welcome to firebase tools from Google for developing great apps engaging with your users and
earning more through mobile ads.
All right so there is so much that firebase offers.
There are so many tools more going to be working with of course.
And this app is fire store all right.
So it's going add a project to me to say add project and review of the project name going to R and D
M and that's all goodsome to say create project
already so here we are in our dashboard here and we've got a whole bunch of stuff here.
We have different tools like authentication and database storage hosting functions.
Test Lab Houlton this stuff and all of these right here analytics authentication.
Wow so much stuff.
We're going to be working with like I said fire store but first we need to add Firebrace to our app
are those gwet and click right here on the Iowa since that's what we're working with right now and we
need our Iowas bundle ID.
I'm just going jump back into X code here and I'm going to copy our bundle ID right here.
Then I'm going to jump back into safari and just paste it right here.
Then we can give it an app nickname which is optional.
I'm just going to say her and the M and AppStore idea is optional as well and is going to leave that
as is going to say register app.
Ok so now we're going to get a Google service dash Infocom history and this is going to have a whole
bunch of information that is specific to our firebase account and app.
All right.
So when I say download all right and that has downloaded so I'm just going to jump back into X code
and then open my downloads folder here and it's going to bring that over here.
And you just grab it and drag it right on in.
OK.
And then say copy items if needed create for the references and make sure you have add two targets checked.
All right to say finish.
Now before I forget I'm currently at the time of this recording in code nine and there is a bug here
that if you click on the file that we have added Google service there and put up a list and you click
right here on the file inspector.
Often more often than not the target membership is unchecked meaning that even though we said to add
it to target when we imported it it did not do it.
So you need to make sure that this is checked so I'm just going to check that right there.
All right.
All right so now I'm going to jump back into safari.
We have completed the steps I'm going to say continue.
All right so now we need to add that the firebase SDK the software development kids to our tax code
project and we're going to use.
We're going to do this using cocoa pods.
All right.
So we're just going to follow the instructions here.
We're going to create a pod file and then we're going to add firebase core.
And then we're ready to save the file and run roughly also going to add a fire base fire store as well
OK.
So let's go ahead and do this.
I'm going to open up my terminal here and I'm going to bump up the size here for you guys to be able
to see it easier.
And we're just going to see you to the desk and say see the desktop and then we want random here.
OK.
And then I'm going to say pod in it right there.
OK so now if we go to our full they're here on the desktop.
See here.
Random.
That's our project.
And now we have a POD file here right.
So if you haven't used cocoa pots before check out some of our other courses where we go into depth
on cocoa pods.
Basically it's a plug in.
It's an addition to your code that you can kind of just add right on to your project and use a whole
bunch of awesome functionality that you can get out of it.
All right.
So to add them we need to edit our pod file and.
And tell our project which cocoa pods which plug ins we want to add to our project.
OK.
So when I right click on pod file and you can open it with whatever your favorite code editor is like
Adam or sublime but not like Microsoft Word or pages or something like that needs to be coded at or.
So I've just opened it up and I'm going to drag it over here and we're going to uncomment this right
here.
Make sure that it has platform Iowa's nine point O or above.
And then here under Pod's for random we were right to just save pod and then single quote.
And we're went to see firebase slash core.
We're going to say pod single quote firebase slash fire store.
OK.
So those are the two pods that we want to install in our project.
I want to save that then I'm going to open the terminal back up and then went to save pod install.
All right.
So this is going to take just a minute and I'll be back once we have finished installing these cocoa
pods all ready so our cocoa pods have finished installing.
So now let's go back to X code and we need to close this.
Once you have installed cocoa pods you no longer work in the project.
We work in our X-C workspace.
OK so we're going to get back to our desktop and if we open up our project folder here now you'll see
that we were in the random Dalek's code project this blue icon.
But now once we have installed cocoa pods we always work in the White Dot X-C workspace.
OK so when I double click that and just open that up over here.
All right.
So just take a look at our project so now you'll see here that we have a folder called POD's.
All right and we have under here framework's and Pod's in case we have a whole bunch of awesome firebase
functionality right at our fingertips that we can now use just by adding in these cocoa bother.
So that is pretty sweet.
So let's zoom back into safari and see where we are in our process here.
So we have added our firebase SDK so that's good so that we can see it continue.
And now we need to add some initialization code.
All right.
So here in the delegate We are going to say import firebase and then we're going to say firebase app
dot configure OK.
And all this is going to do is just initialiser are apt to be ready to use firebase when I copy this
bit of code right here the firebase app that configure and we're going to see finish and then jump back
into X code.
Okay.
And going to come over here to our project and find you or delegate nuts with the file.
And here are the imports we're going to say import firebase and then right here and the did finished
launching with options.
We're going to paste what we had from our setup wizard which is firebase and configure and that is it.
We are about ready to start using firebase that is going to build this.
Just make sure that it builds properly.
All right Awesomes we have a successful build so things are looking good.
All right the last thing that I want to do is add some of the assets that we are going to be using throughout
this project.
Okay.
So go ahead and open up our assets that X-C assets folder right here.
And then as part of this project in either the previous lesson of when before that you can download
some of the assets.
Okay so I'm here on the desktop.
I have our assets in case I'm going to open it up.
All right.
That looks good.
And you'll have a couple of folders here we have our app icon assets and then our assets right here
so go ahead and open up the assets folder and just select all of those and drag them in.
Okay that looks good.
And then select our app icon right here and then we're going to go back to our Finder window and go
back and go to our app icon assets and I'm going to go ahead and in our iPhone icons OK I'm not going
to worry about the iPad settings or the App Store or anything like that.
I mean you have all of those at your disposal if you want to add them.
Right now I'm just going to add the iPhone ones because that's what's going to be most important to
us when we are viewing them in the simulator.
All right so we want the twenty point two and three x case twenty point two x twenty point at most twenty
point at 3 x 2 x at 29 to 29 to X and 29 at 3 x and then 40 point at 2 and 3 x 2.
And there's the three and then sixty point and two and three x sixty point two and sixty point at three.
All right very nice.
So it's going to run this and just see how it's looking so far make sure everything is running well.
All right.
So we got it up and running it's just a blank screen right now of course.
What if we go to the home screen we can see our awesome icon right here.
And so it's it's up and running and we have installed the firebase SDK.
We got our Google service list we have.
We have created our project in the firebase console and this is where we're going to be spending quite
a bit of time throughout the next the lessons.
And I know we didn't do a whole lot of firebase fire store specific stuff in this lesson this was just
to get our project up and running and in preparation for our next lessons and the next lesson we are
going to talk about at a high level.
Exactly what is fire store and why you should use it.
And yes this is going to be awesome and I'll see you in the next one.