Everyone Johnny B here with slopes dot com and I am here with a quick X code 9 Bayda for update.
All right.
Most of the Course is done in either Beta 2 or 3 and so Beta 4 recently came out and there have been
a couple of minor changes that we're going to talk about.
Nothing too drastic.
But first off is something called this safe area feature right.
And so we bring in a lot of questions about this and it looks like it comes standard with any new projects
that are created with Beta 4.
So if you open up any of the finished source source code files from any of the other sections you aren't
going to see this safe area because they were created with betas prior to 4.
All right but so if you were starting the course new with Beta 4 and you start a new project then you
are going to see this and maybe be confused why your Says it and ours does not.
But yeah so this is new and it's not a big deal.
Basically what it is is what it's doing is it's showing the area that is safe for you to put UI elements
basically.
So for instance if we throw in a label here and I put in a label and I'm going to put it up or right
at the top.
OK.
And so you'll see here that it is right at the upper most bounds of the safe area.
Right.
And so if I can stream this and see it from the left and zero from the top what it is constrained to
is constraining to the bottom of the sea area bounds or the top of the safe area bounds.
So I would add two constraints and you can see here that it is right at the top and if I run this right
so it's built and you'll see now that the label is actually right under our status bar.
Kim meaning the carrier signal time and battery and so it is safely being in the area that you'll be
able to see it.
But if we didn't have the safe area and it's totally an option for you to turn off so if you click here
on the View Controller and you come over here to the file information and you come down here to the
interface build a document.
You can check or uncheck you safe area layout guide.
So if I uncheck this and get rid of its top constraint and then just move it up to the top and then
delete that constraint too you guys don't need to be following along with this or anything just to kind
of show you and then change it set it equal to zero for the top and add two constraints.
You know you might think oh yeah this is.
This is totally going to be fine because I can you know this this whole area should be fine for me to
build in but it is not.
So now you see when we build it because we didn't have the safe the safe area guidelines on we didn't
know exactly where we could or could not place UI elements.
And now our label is right up in the carrier signal area.
So that's that's kind of the reason for the safe area.
We're going to move this back down to the that and just to kind of show you one other thing if I embed
this view controller in a navigation controller then the safe area is a little bit different.
So I'm going to come back and turn the area on.
So here in view controller here in the file inspector and turning the USAFE area back on so that will
get it back.
So now the safe area is a little bit is a lot smaller than it was with the regular controller because
now it's the area underneath the whole navigation bar.
All right.
So that's that's the safe feature.
That's the safe area feature if you guys want to follow along exactly with us then go ahead and just
turn off the safe area.
Lay out guide right here in the file inspector OK.
Not a big deal yet just turn it off and follow along with us like normal.
All right the next thing that I want to talk about that is kind of a little bit different in Beta 4
is if you were to go ahead and just download our source code and then open it.
So this is a freshly downloaded source code file.
And if you see in the storyboard you're going to see that we got a whole bunch of localization issues.
And so what this means is if you were doing localization in your app meaning like you know this this
says user name in English but if you wanted to be able to have a localized to different countries and
nationalities and languages I currently have a fixed width on it of two hundred and fifty.
But what if you know in German or some language it's like super duper long and doesn't actually fit
in this label anymore.
Well that could cause bad you experience and since storyboard is by default set to be able to do localization
then you're going to get all these issues is going to say certain Tullio constraint combinations may
result in in an appropriate lay out in the current development language but will pose issues in other
languages and regions.
So it's going to tell you some things that you can do.
And so you have a few options you can either ignore these issues.
It's not going to cause any problem in your in your run time.
You could follow the suggestions and clicking on here will give you a few options.
For instance you could set the constraint to greater than or equal to the current with.
And this allows the label to extend in with longer text while preserving the current layout.
So you can say Sure that sounds good and that will take care of that issue.
So you could follow those prompts for for these and that will get rid of your issues.
So that's their second option.
Your third option is to not care about localization.
And so if you don't care about localization then here is what you can do which you have to do is you
have to tell X code that you don't care about it being localized.
And so far the only way that I found of doing this was on a stack overflow post and I'll show you the
steps to do that.
So what we got to do is we're going to take our minute storyboard file out of the we're going to move
it up one level in this project hierarchy.
So if you right click on the main storyboard and say show in Finder and then what we're going to do
is we're going to just take it from here and we're just going to drag it out one level up one level
just like that and then we're going to come back into our project and we're going to.
And now ex-coach won't know where to find it so it's lost so we're going to we're in a Right-Click say
delete and then we're going to come back into our finder where we just moved it and we're going to drag
it back in and we're going to say copy items if needed to create all the references add to target and
say finish.
And then we've been having some issues with adding to target.
So let's see if that worked for us here.
Yes so see even though we said at the target is not it's not checked here.
So we need to make sure to say Target membership is back right.
And then we're going to save that and now you'll see that the that those localization errors went away.
All right so basically all we did was we we took it from its we took it out of its base tile project
folder which tells us that the stuff in here is going to be subject to localization and pulled it out
and put it here and then we put it back into our project said its target and now we are good to go.
So if you don't care about localization those are the steps to get rid of those errors.
All right.
So hope this was an informative little update and these changes will apply to the forthcoming sections.
So remember them and if you run into those areas in the future and you forget how to fix those problems
just jump back into this one and watch it again.
All right.
So I will see you guys later.