What's everyone joining be here with slopestyle and we are about to embark on this journey of creating
this chat up hope you guys are as excited as I am.
So let's go ahead and just jump right into it in this video.
We're just going to do some project set up.
We're going to put our assets set up our Coco paws take a look at the designs and figure out the direction
that we want to go.
All right.
So we're going to start out creating our brand new project.
Going to open up X code I'm in current using the X couldn't find Bayda to build it too.
Been out for a couple of weeks so hopefully we'll be getting a new one pretty soon here.
And I'm just going to go to file new project is going to drag this over to my screen here and we're
going to do a single view app is fine go the next product name.
I'm going to call this Mac and team is none is fine organization is whatever you want to call it organization
identifier.
If you have a web site then they encourage you to use that in DNS which is the reverse domain name service
for that com dot whatever your web site is and then so that's that and then so then your bundle identifier
will be com dot dot SMAC in my case.
So if you don't have a Web site that's fine.
Just put a unique identifier.
Languages of course going to be swift and we are not using Core data or unit tests or tests in this
project.
So then we can just go ahead and say next.
And I'm going to just create this here on the desktop make sure that you have create good repository
checked because you should always always be using version control right.
So when I say create and we're just going to set up a few things to get going here I'll go ahead and
put in a team here here in the deployment info.
We're only going to be using this in portraits.
Uncheck the landscape left and landscape right just so we don't have to worry about landscape auto layout
and constraints and that kind of stuff.
And then the next thing that I'm going to do is actually set up this project with our depth slopes bitbucket
repo Okay.
So I'm not going to be able to show you that but I will show you how to do it with a test project here
in just a second so I'll be right back home and I'm going to set this up with our get with our bitbucket
repo.
All right he's fallen back.
I just set the remote repo for this project to our team of slopes a repository on that bucket.
But like I said I am going to show you how to do that for yourself.
So here I have a an empty new brand new repo.
So I'm going to show you how to do it for yourself.
Ok Sue Well we're going to do is I'm going to create a quick little test project here to say new project
single you get Project say next create get repository.
OK so this is just to show you how to set up your repository for the very first time.
So the team.
So what you can do is you're going to go to the terminal and they pump this up you get a CD into your
repo for your project Tarrant's CD to get to the desktop.
LS and CD and what did we call this get project so a little tip here.
If you start typing in the name of your directory and then press tab once you get to the point where
your directory is unique it will automatically fill it out.
If for instance you instance you have a bunch of files that begin with the same word like I have I have
several folders here.
When I was creating the smack app if I do smack you see that it will auto correct up to the point where
it becomes an unique so that you can see that I have Smack smack assets smack Alpha et cetera.
So then from there you need to do a little bit more to get to a unique position.
So here if I do smack space OK and then do that doesn't work because of the space but you smack dash
smack and then do it then I get it back out.
But anyways that's just a little tip.
They're going to come back here and you get project.
So now we are inside of the directory for this test project that I just created.
And if we do get status you'll see that we have some changes that we could commit.
So I'm going to say Get add that I get to commit him and I'm going to say start her project again and
then if I do get branch that will show the branch that we are currently on.
All right.
So this is a master branch now when you create your repository with or when you initialize using get
with your project you start out with a master branch and that's just local All right.
So you have a local master branch but you know you don't always want to just rely on having things locally.
So that's why services like get hub and bitbucket exist.
You could do all of the Get version control on your own computer and have that be you know that's still
a good thing to do version control on your own computer.
But if you want to share or you want to collaborate or just have for security reasons you know if your
computer crashes and you still you could still have all of your code up on on an online repository.
So that's what we're going to do here.
So we are currently in our directory.
We know we have a master branch and it's got all of its changes up to date and everything so it gets
status it'll say you had nothing to commit working tree clean.
So we are ready to upload our local master branch to our online repo.
And that's what I did with the deciles one.
But I'm sure you had to do that here as well to come back here to the bucket and I just created a throwaway
project repo here and it says here get started with command line.
So step one is to switch to your repositories directory which we have just done.
And step two is to add a to connect your existing repository to bitbucket.
So that's called having an origin.
OK.
So the remote is the bitbucket part and then the origin is this repots I want to say get remote and
origin and then they give us right here the U R L that we're going to use for this particular repo when
it impacted the terminal.
And I'm going to add to that.
All right so now we should have.
So that makes the connection between our local and our online repo here.
So then I can actually push up our master branch to our online repo's and we say get push Dasch you
origin.
So the saying push to origin and then you say which branch you want to push.
So we're going to push our master press get pushed at you origin faster and then it's going to ask you
to put in.
If you set this up with SS h I'll ask you for your password.
So you just enter that and you won't see any dots or anything show up.
So don't worry if you're if you're not seeing any of that just entered in like normal then press enter
all Linus's branch master was set up to track remote branch master from origin.
So if we come back over here and we do a refresh that you'll see that we have successfully added it.
We have one branch here and there isn't to read me.
So you could create a read me on this but if we come over here to our Master branch we can click on
that and you see here you can look at your source code and we just have I mean there's not a whole lot
because this is just the dummy project.
You can see your commits and see what was added and what was changed.
All right so yeah just kind of a little side track to show you how to set up your own online repositories
and link them up with your local projects.
OK.
So hope that was a good little sidetrack for you guys.
So I'm going to close out that repo and then I'm also going to close out this test project and we will
continue on with our SMAC app.
OK.
All right so we've got our projects set up you know opened up.
So next thing we're going to do is we're going to look at our assets.
Okay.
So with this section you should get a pretty big folder of assets called SMAC assets.
And here inside of it we have the app icons we have the mockups we have a couple of supporting files
in the form of our host w reveal new controller files and we have our actual x code assets.
All right.
So let's go ahead and take a look at our mockups first so I'm just going to add these are just some
screenshots.
I'm just going to open them all up and we'll take a look at them and talk about it.
All right so you saw how it works in our in the in the last video.
So this is just kind to kind of look through the screenshots and kind of talk about what we're going
to be looking at.
So you know we're going to be we're going to be working with two main controllers for for most of the
app which is going to be the chat window which you see right here.
And then the other one is the is the channels and the menu window.
OK.
So in the in the chat we're going to have a table view we going have a label down here so that you can
enter messages.
If we click here it's going to open up the open up the side menu where we have a list of the channels
as well as a profile info.
We can log in using your email and password.
We are able to create accounts and then when we create account we have the option of using creating
it with an avatar with a background color as well.
We have a screen that will show the profile info and also let you log out.
And then we have a screen that we can use to create channels.
All right.
And then this kind of just shows what it looks like when you're actually typing.
We have a custom button that will let us send the messages.
So take take a look at these.
Take a look through these and this will help you orient yourself into what it is exactly that we're
going to be working on throughout these videos.
OK.
So that looks good.
Next thing I want to do is actually import our X code assets.
So I'm going to go over here and back into our project click on the assets folder and then come back
in here X code assets and go ahead and just select all of these and drag them right into here.
All right.
That looks good.
Now we have all of our assets that we're going to be using throughout the project imported.
And I just wanted to make a quick note of the naming of our avatars.
So they are named dark and then an integer from 0 to 27.
So there are in total 28 and they are in dark and light formats.
Okay.
And so we named them dark because 0 through 28 and like 0 328 on purpose because we'll be able to use
that naming convention to add them to our collection view very easily.
All right.
So the next thing that we're going to do is talk about our cocoa pods that we're going to be using.
All right so there are two different ways that we can initiate or add our cocoa pods.
There's using the old school way with terminal and cocoa pods and then there and Bakugan has actually
just recently released a cocoa pods app that you can get at Cocoa pods.
Dot org let me see if I can just pull it up real quick.
Let's see here go to copal PASOK org and then go to app and you can download the iPad app is actually
pretty nice and makes it really easy to quickly add cocoa pods.
So I'm going to actually show you how to do it with this app.
OK.
So go ahead and download that.
And then once you got to go to just open it up.
Cocoa pods right here.
And then what you're going to do is you going to come up here to file new pod files from X code project.
OK and then what we're going to do is we're going to go to our desktop and go to our folder and select
the XCode project.
So if you're not familiar with cocoa pods what they are is kind of plug it in.
Basically what it does is that it's a pre-compiled or a pre-configured library of code that does a specific
thing usually that you can add into your project and take advantage of all of that code that has been
written and tested and and done by someone else.
Now that's being said you do want to be careful about how many and the quality of the cocoa pods that
you add to your project some of them are not super well maintained.
Some of them you know aren't trustworthy.
So just make sure that you're look that you're getting Capozzi that are you know have good ratings look
like they are well-maintained etc. are going to be using three in this project and they're all very
well maintained and documented Okay.
So I'm going to click on open here and the three Coke buzz that we're going to be using is Alamo fire
Swiftie Jaison and socket IO.
OK.
So each of those do L.M. fire is a library built on top of you or else.
That makes it a lot easier to work with web requests doing things like downloading data posting data
to web sites etc..
And the next one is Swiftie Jason which really makes it nice and easy to work with on data.
And then the last is the socket dot I O framework that we're going to be using to make our app work
in real time.
OK so that's simplifies working with web sockets and having an open line of communication between our
client and our API on the client on the web server side.
OK.
So if you just do pod and then Cocoa Puffs tries to help you out if you do.
If you do a and then if you do Alamo fire it tries to tries to autocomplete for you.
I find it's just easier to type it in and then go back and put the colon.
What does that apostrophe.
That's what it is.
An apostrophe.
Well my goodness.
I suspect pages are respect to Cocoa pods.
So the next one is Podd and that's going to be so with the J some groups those are capital J songs and
put your apostrophe.
And then we're going to do the last ones a little bit more wordy socket dot I O dash client dash swift
and that's all you got to do then you just press install.
Well go ahead and close this project because from now on after you install cocoa pods you will use the
workspace.
So an open backup your folder and then open the workspace.
So from now on we're going to always be working in this workspace here.
All right so next thing that we're going to do is talk a little bit about X code 9 and swift 4 and how
that works with some of these other libraries.
So in the dark days of the swift to two swift 3 migration and X code 8 beta it was a nightmare because
the changes that they made going to switch 3 were so drastic and huge that everything broke lots of
cocoa pods lots of libraries everything broke and so there was this huge scramble to try and get things
in line with two or three but they continue to make breaking changes all through the beta period.
And so it was a really hard time to be teaching and to be using these types of things.
Fortunately as you probably know since you're taking this course X code 9 and swithe 4 just came out
but they made it they made this a lot easier to to to have this migration because what they've done
is they allowed to have your working project be in swift for your targets for instance your cocoa pods
they can be in swift three point two.
And so these cables that we just use they are into a three point two.
If you're taking this course well into the future and we'll make an update video.
Now these co-habiting might have migrated to swift for by then but right now they make it really nice
to be able to have your project in with for huge swift three point two for your for your Capozzi and
other targets.
And it works seamlessly it works perfectly.
All right so what but we do need to specify which language we want to use.
So here in SMAC This is our current project which we won't be coding into for.
And so we're going to do is go to build settings and way down here at the bottom where sits with compiler
language.
It's already set to four.
And so that's good.
But our pods.
So come here and click on pods and then under targets we have Alamo fire.
And but we want we want our pods to be working with swift 3.2.
I said Come down here to fling with your version and change it to 3.2 for Alamo fire socket.
Oh and Swiftie Jaison.
All right so now when I build this.
Fingers crossed this should compile just fine and should build just fine.
That we go build succeeded.
So that's all working well.
The last thing that we're going to do and get configured here in this set up video is we are going to
add the S-W reveal files that we are going to need to make that awesome slide out menu.
All right.
So go ahead and open up the browser and search for S-W reveal.
Drag this over here and the top result should be the get hub of John luge.
Sorry if I'm saying your name incorrectly but all you got to do is go to clone or download.
Or alternately inside of the assets that we have provided you.
There is a folder for S-W reveal and the two files that you need are also right here.
But if you want to get them from the get hub repository just do clone download and download the Ziph
and then see here.
Open up the folder.
All right so once you got it open let's jump back into X code and then back to Finder.
And what we're going to do is actually create a new group real quick so when we create a new group called
supporting files where we're going to add these files.
OK.
So if you downloaded it then you're going to come here to review if you controller and open that up
and you're going to grab these two files and you're going to drag them into your excellent project here
under supporting files.
And then we're going to say copy items if needed at targets and say finish.
And then is going to pop up and say Would you like to configure an Objective-C bridging header.
So this is very important.
You want to create a bridging headers.
Click on Create bridging.
Header.
OK.
So what this does is the bridging header allows X code to seamlessly work with code and Objective-C
code in the same project.
OK.
And but one more thing that we need to do to allow that to work is in our bridging header.
Here we are going to do an important hoodoo pound or hash tag import and then you're going to say code
quoting and say S-W reveal the you can troller dot each.
And what this does is this just lets us get access to the methods and functions that the that are programmed
in the objective c files.
All right.
Let's just say that and let's do one more test to build this.
Make sure everything is looking good.
And we have a successful build.
Got a bunch of warnings here because the S-W reveal controller is not with Swit for its objective sees
CS was asking hey do you want to convert this to us before.
No we don't.
So I'm just going to click on this and I'm going to say convert later and I'm going to uncheck the Remind
me convert later on already.
So we are all set up.
We have added our assets.
We have set up our bit bucket repo and we have added our cocoa pods set this with version added to our
review all files.
So we are good to go to jump into our next lesson.
And at the end of each lesson hopefully I remember I'm going to commit our changes and just to just
to get you guys into the practice of constantly using version control.
OK so we really encourage you to be using version control.
And so I'm going to jump out of our.
This is what this was our start a project so I'm going to only clean this.
We're going to go to our desktop and then CD into this.
Oops smack.
And if you do get status you'll see what we've changed you can see here we added a bridging header a
bunch of pop stuff to say get and get commit dash em and I'm going to say end of less than 1 game.
So what does get add do add adds all of the changes and any new files that we have created or added
and the period just says added all and then committing is kind of like saving those changes and the
dash em is just a message to make it easier for if you're going back through your different commits
that you've made you can easily figure out which one you want to rewind back to.
And so just a couple more words on the importance of version control.
You know why do we do it.
Because it's for safety you know sometimes you'll have you'll be working on a project and you made a
whole bunch of changes.
And everything is looking good but then you do something that breaks everything and you can't figure
out what went wrong.
And so now your project is just screwed.
So if you haven't been doing frequent comments and using version control you might and you might be
totally out of luck with that project you might have to start completely over.
But if you've been using version control like a good little programmer then you can just get rid of
those.
Get rid of some of those changes and rewind to a working commit that you know is actually working well.
All right.
So right now we're on master and just a couple more words.
You shouldn't actually be working your development changes in master.
You should create a new branch off of master called develop and then develop you should actually be
creating new branches for each new feature that you're implementing.
This way you have your protecting your master branch and you're protecting your develop branch.
And so once you make a bunch of changes then you'll change then you'll do.
Then you have a code review and you'll merge that into develop and eventually when you're ready to make
like a new release on your app then you'll merge all of those changes from development to master and
you'll release your app off of that.
So just just a little bit of you know some some some reasons for why we use version control and why
it's so important.
OK.
So hope you guys are ready for the next VDU and getting working on this.
All right so I'll see you then.