1
00:00:08,150 --> 00:00:16,230
Everyone Johnny B here with slopes dot com and I am here with a quick X code 9 Bayda for update.

2
00:00:16,240 --> 00:00:16,690
All right.

3
00:00:16,690 --> 00:00:25,510
Most of the Course is done in either Beta 2 or 3 and so Beta 4 recently came out and there have been

4
00:00:25,510 --> 00:00:30,070
a couple of minor changes that we're going to talk about.

5
00:00:30,280 --> 00:00:31,990
Nothing too drastic.

6
00:00:32,030 --> 00:00:36,040
But first off is something called this safe area feature right.

7
00:00:36,220 --> 00:00:42,070
And so we bring in a lot of questions about this and it looks like it comes standard with any new projects

8
00:00:42,070 --> 00:00:44,020
that are created with Beta 4.

9
00:00:44,050 --> 00:00:51,460
So if you open up any of the finished source source code files from any of the other sections you aren't

10
00:00:51,460 --> 00:00:56,820
going to see this safe area because they were created with betas prior to 4.

11
00:00:56,830 --> 00:01:02,590
All right but so if you were starting the course new with Beta 4 and you start a new project then you

12
00:01:02,590 --> 00:01:08,160
are going to see this and maybe be confused why your Says it and ours does not.

13
00:01:08,150 --> 00:01:11,830
But yeah so this is new and it's not a big deal.

14
00:01:11,830 --> 00:01:20,110
Basically what it is is what it's doing is it's showing the area that is safe for you to put UI elements

15
00:01:20,110 --> 00:01:20,860
basically.

16
00:01:21,010 --> 00:01:30,320
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

17
00:01:30,550 --> 00:01:32,060
at the top.

18
00:01:32,220 --> 00:01:32,850
OK.

19
00:01:33,820 --> 00:01:39,520
And so you'll see here that it is right at the upper most bounds of the safe area.

20
00:01:39,520 --> 00:01:40,290
Right.

21
00:01:40,360 --> 00:01:45,960
And so if I can stream this and see it from the left and zero from the top what it is constrained to

22
00:01:46,010 --> 00:01:53,820
is constraining to the bottom of the sea area bounds or the top of the safe area bounds.

23
00:01:53,910 --> 00:02:02,050
So I would add two constraints and you can see here that it is right at the top and if I run this right

24
00:02:02,050 --> 00:02:09,810
so it's built and you'll see now that the label is actually right under our status bar.

25
00:02:09,970 --> 00:02:16,900
Kim meaning the carrier signal time and battery and so it is safely being in the area that you'll be

26
00:02:16,900 --> 00:02:17,950
able to see it.

27
00:02:18,250 --> 00:02:26,470
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

28
00:02:26,470 --> 00:02:34,930
on the View Controller and you come over here to the file information and you come down here to the

29
00:02:34,930 --> 00:02:36,480
interface build a document.

30
00:02:36,610 --> 00:02:40,700
You can check or uncheck you safe area layout guide.

31
00:02:40,720 --> 00:02:54,730
So if I uncheck this and get rid of its top constraint and then just move it up to the top and then

32
00:02:55,010 --> 00:02:58,910
delete that constraint too you guys don't need to be following along with this or anything just to kind

33
00:02:58,910 --> 00:03:04,490
of show you and then change it set it equal to zero for the top and add two constraints.

34
00:03:04,760 --> 00:03:07,240
You know you might think oh yeah this is.

35
00:03:07,280 --> 00:03:12,410
This is totally going to be fine because I can you know this this whole area should be fine for me to

36
00:03:12,410 --> 00:03:15,440
build in but it is not.

37
00:03:15,470 --> 00:03:22,730
So now you see when we build it because we didn't have the safe the safe area guidelines on we didn't

38
00:03:22,730 --> 00:03:25,760
know exactly where we could or could not place UI elements.

39
00:03:25,850 --> 00:03:30,830
And now our label is right up in the carrier signal area.

40
00:03:30,830 --> 00:03:36,020
So that's that's kind of the reason for the safe area.

41
00:03:36,170 --> 00:03:42,500
We're going to move this back down to the that and just to kind of show you one other thing if I embed

42
00:03:42,500 --> 00:03:51,960
this view controller in a navigation controller then the safe area is a little bit different.

43
00:03:52,010 --> 00:03:55,860
So I'm going to come back and turn the area on.

44
00:03:55,860 --> 00:04:04,890
So here in view controller here in the file inspector and turning the USAFE area back on so that will

45
00:04:05,160 --> 00:04:05,990
get it back.

46
00:04:06,000 --> 00:04:12,330
So now the safe area is a little bit is a lot smaller than it was with the regular controller because

47
00:04:12,330 --> 00:04:16,550
now it's the area underneath the whole navigation bar.

48
00:04:16,820 --> 00:04:17,400
All right.

49
00:04:17,580 --> 00:04:19,770
So that's that's the safe feature.

50
00:04:19,770 --> 00:04:26,070
That's the safe area feature if you guys want to follow along exactly with us then go ahead and just

51
00:04:26,070 --> 00:04:28,250
turn off the safe area.

52
00:04:28,260 --> 00:04:31,530
Lay out guide right here in the file inspector OK.

53
00:04:31,770 --> 00:04:36,180
Not a big deal yet just turn it off and follow along with us like normal.

54
00:04:36,180 --> 00:04:42,120
All right the next thing that I want to talk about that is kind of a little bit different in Beta 4

55
00:04:42,600 --> 00:04:49,540
is if you were to go ahead and just download our source code and then open it.

56
00:04:49,650 --> 00:04:52,970
So this is a freshly downloaded source code file.

57
00:04:53,240 --> 00:05:01,520
And if you see in the storyboard you're going to see that we got a whole bunch of localization issues.

58
00:05:01,620 --> 00:05:08,640
And so what this means is if you were doing localization in your app meaning like you know this this

59
00:05:08,900 --> 00:05:14,120
says user name in English but if you wanted to be able to have a localized to different countries and

60
00:05:14,120 --> 00:05:21,950
nationalities and languages I currently have a fixed width on it of two hundred and fifty.

61
00:05:21,980 --> 00:05:29,780
But what if you know in German or some language it's like super duper long and doesn't actually fit

62
00:05:29,780 --> 00:05:31,060
in this label anymore.

63
00:05:31,280 --> 00:05:41,420
Well that could cause bad you experience and since storyboard is by default set to be able to do localization

64
00:05:41,900 --> 00:05:46,610
then you're going to get all these issues is going to say certain Tullio constraint combinations may

65
00:05:46,610 --> 00:05:52,100
result in in an appropriate lay out in the current development language but will pose issues in other

66
00:05:52,100 --> 00:05:53,900
languages and regions.

67
00:05:53,990 --> 00:05:55,960
So it's going to tell you some things that you can do.

68
00:05:56,240 --> 00:06:00,590
And so you have a few options you can either ignore these issues.

69
00:06:00,590 --> 00:06:04,240
It's not going to cause any problem in your in your run time.

70
00:06:04,430 --> 00:06:10,970
You could follow the suggestions and clicking on here will give you a few options.

71
00:06:11,210 --> 00:06:14,530
For instance you could set the constraint to greater than or equal to the current with.

72
00:06:14,750 --> 00:06:19,300
And this allows the label to extend in with longer text while preserving the current layout.

73
00:06:19,580 --> 00:06:23,740
So you can say Sure that sounds good and that will take care of that issue.

74
00:06:23,780 --> 00:06:31,280
So you could follow those prompts for for these and that will get rid of your issues.

75
00:06:31,340 --> 00:06:32,880
So that's their second option.

76
00:06:33,200 --> 00:06:37,040
Your third option is to not care about localization.

77
00:06:37,110 --> 00:06:41,510
And so if you don't care about localization then here is what you can do which you have to do is you

78
00:06:41,510 --> 00:06:46,720
have to tell X code that you don't care about it being localized.

79
00:06:46,820 --> 00:06:52,040
And so far the only way that I found of doing this was on a stack overflow post and I'll show you the

80
00:06:52,040 --> 00:06:53,670
steps to do that.

81
00:06:54,020 --> 00:07:01,820
So what we got to do is we're going to take our minute storyboard file out of the we're going to move

82
00:07:01,820 --> 00:07:04,470
it up one level in this project hierarchy.

83
00:07:04,610 --> 00:07:11,330
So if you right click on the main storyboard and say show in Finder and then what we're going to do

84
00:07:11,510 --> 00:07:16,880
is we're going to just take it from here and we're just going to drag it out one level up one level

85
00:07:17,660 --> 00:07:22,220
just like that and then we're going to come back into our project and we're going to.

86
00:07:22,220 --> 00:07:27,080
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

87
00:07:27,080 --> 00:07:36,290
delete and then we're going to come back into our finder where we just moved it and we're going to drag

88
00:07:36,290 --> 00:07:42,240
it back in and we're going to say copy items if needed to create all the references add to target and

89
00:07:42,280 --> 00:07:45,300
say finish.

90
00:07:45,810 --> 00:07:49,000
And then we've been having some issues with adding to target.

91
00:07:49,230 --> 00:07:53,020
So let's see if that worked for us here.

92
00:07:53,370 --> 00:07:57,560
Yes so see even though we said at the target is not it's not checked here.

93
00:07:57,570 --> 00:08:02,020
So we need to make sure to say Target membership is back right.

94
00:08:02,070 --> 00:08:10,390
And then we're going to save that and now you'll see that the that those localization errors went away.

95
00:08:10,390 --> 00:08:16,140
All right so basically all we did was we we took it from its we took it out of its base tile project

96
00:08:16,170 --> 00:08:23,250
folder which tells us that the stuff in here is going to be subject to localization and pulled it out

97
00:08:23,250 --> 00:08:29,690
and put it here and then we put it back into our project said its target and now we are good to go.

98
00:08:29,910 --> 00:08:34,500
So if you don't care about localization those are the steps to get rid of those errors.

99
00:08:34,500 --> 00:08:35,290
All right.

100
00:08:35,670 --> 00:08:44,330
So hope this was an informative little update and these changes will apply to the forthcoming sections.

101
00:08:44,520 --> 00:08:50,970
So remember them and if you run into those areas in the future and you forget how to fix those problems

102
00:08:51,420 --> 00:08:53,550
just jump back into this one and watch it again.

103
00:08:53,550 --> 00:08:54,030
All right.

104
00:08:54,150 --> 00:08:55,570
So I will see you guys later.

