Hey everybody what's going on this is callup with slopes dot com and in this video we're going to go
ahead and build the subclass for our parallax cell which is pretty cool.
We're going to go ahead and configure it with the proper information that we need.
We're going to go ahead and connect it to the proper Iby outlets that it needs as well so go ahead and
pull open your project here and what we're going to do let's create some groups.
We need a group for our controller as well as our view folders.
So click newgroup and type controller.
Drag your view controller file in there should be in there and then create a new group and type view
now inside view click and right click and then click new file.
And this is going to be a Cocco touch class.
It's going to be a subclass of UI table view cell.
And we're just going to call it parallax cell.
OK.
So click next then click Create.
And now we have a code file.
So while we're at it let's go back to main storyboard let's select our table view click on the table
view cell and let's go ahead and set up the parallax cell subclassed there type it and then press enter
and then I'm actually going to copy the name there go back to the assistant editor and for the reuse
identifier paste in parallax cell but drop the P at the front to be lowercase.
OK.
So awesome that is now properly linked.
Get rid of the assistant editor here and get rid of set selected as well.
So this is our subclass inside awake from NIB is where we're going to actually set up our parallax code
later like that.
And that's going to be in a function down here called phunk setup parallax.
Without the two Rs they will fix that in just a second.
There we go.
And this is where we're going to go ahead and set up you know the amount that our screen will scroll
and we can customize that however we want we can do a little bit or a lot.
You can even set it up so that the user themselves could set up the amount of parallax which is kind
of cool.
We're going to set up the different kinds of motion and the different values that it's going to pay
attention to and then add it to the UI image view in our cell.
But we have not yet linked up that image view to our subclass.
So let's do that now.
Click on Main storyboard and pull open the assistant editor K..
And if you click on parallax cell you should be able to go to automatic and it should appear here.
But as you can see in my case it is not showing up.
So you're going to have to maybe select it then go back in.
Go to manual and try again.
And if that doesn't work go back to your class.
Go back to your story.
Select it again and if it still doesn't appear you're gonna have to you know save and quit X code actually.
This is a frustrating bug where the proper proper code does not show up or the I guess the proper access
to what you want doesn't show up.
And so we have to go back in.
Reopen it Resul Act are parallax cell and wow and we still do not have access to the project.
That's really frustrating.
So as you can see there it is boom.
So select parallax sell then what we're going to do is we're going to go ahead and right click on our
image view and drag into our parallax cell and just call this image view because no need to really name
it anything else.
Then we need to go ahead and create an outlet for our label as well.
So go ahead and just call this maybe a description label and I'm going to get rid of that.
Second our description label and connected.
OK.
So what we're going to do.
Oh you know what.
It is not like the name image.
I believe that a table view cell already has a property called Image view so we need to name something
else.
How about item image view.
Cool but this is still linked to that old outlet.
So right click on it and get rid of it then go ahead and drag and link that to the image there.
Now it's called item image view and it's referencing the proper outlet.
So that's great.
Our cell is set up now with the proper outlets.
We can then set up parallax and now we just need to actually feed some data into these cells to get
them showing up in our table view at the moment.
We're not actually you know returning anything to our table view so the cells aren't going to show up.
So in the next video we're going to go ahead and create a helper file and in that help file We're going
to actually create an array of images and an array of names that goes with this hand and hand.
And then we're going to be able to configure our cell.
So we're going to head over to that video in just a second.
But before we do that let's go ahead and let's configure our cell with a function.
So in parallax cell type phunk configure cell K and a cell is going to have an image so with image Canham
to are used to an internal predator image meaning we can use the word image in our function.
We don't have to use with image but when we call our function with images the parameter that will show.
So that makes more sense when we're calling it.
But when we're actually implementing it image makes more sense.
OK.
So configure cell with image and description can we'll just do desk for description.
And that's going to be a string then inside the function go ahead and set item image view item image
view image and use our internal parameter of image.
Then go ahead and type description label text and pass in description.
So then back in our table view here when we create our instance of our cell we'll be able to pass in
an image and a description for our label and then we can show all that data dynamically so let's head
to head over to the next.
So let's head over to the next video where we're going to go ahead and create an array of images and
an array of names to go with ourselves.
Just static data.
I'll see you there.