Kodeco Forums

New Course: Beginning Auto Layout

Learn how to make your apps work on any device size in our Beginning Auto Layout course. Covers autoresizing masks, stack views, constraints, and more.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/746-new-course-beginning-auto-layout
1 Like

You guys just rock. Thanks for all the hard work for bringing us these updated tutorials.

Is there a way I can continue watching the previous version of this series?. I was watching ‘Intro to Auto Layout Part 7: UILayoutGuide and NSLayoutAnchor’, but now I can’t find it here. Thank you for the update but I really want finish what I started.

1 Like

Hi,
I am also in the same boat. Can the old materials be allowed.

Me too, I was watching that series :cry:

Hey guys! Good point, hadn’t considered the case where people were in the middle of the old series :]

I’ve re-listed them on the site temporarily; please finish watching when you can, we’ll probably be taking them down again in a few weeks to prevent people from stumbling upon the old courses instead of the new/shiny/updated one. I hope that helps! :]

1 Like

Hi Jerry,

Thanks for the course and tying the concepts together. It’s been very confusing to say the least. Can you clarify one last thing
 It looked like the direction was moving towards adaptive layout. Now I see the tutorials are gone on it, and I’m not sure I even see it in Xcode. Could you briefly describe it, and when you would use it over auto layout? This is a big learning and time investment. I would rather refactor my apps to the correct techniques then finding out there was a preferred way after the fact.

Thanks
Vinnie

I’ve just watched through it and it was fantastic. Waiting on the advanced course now. Is there a hint on when that’s coming?

Thanks for the encouragement, glad it’s helpful!

That would be a question for @raywenderlich, but I think it’s “soon”

Good question. The old series on Adaptive Layout is back temporarily and the “Mastering Auto Layout” series that is coming soon will explain it also, but generally speaking adaptive layout builds on top of auto layout, so you can start there and then add support for size classes (the core concept of adaptive layout). Auto layout will handle the minor adjustments between screen sizes and different environments, and then adaptive layout will handle the major changes between environments.

Thank you so much. That helps a lot!!

That’s a very good explanation. Thank you!

I do see your new tutorial and the old adaptive layout tutorial. I have an app that’s been released and I used constraints for the whole thing. Your Auto Layout tutorial really clarifies many of the things I could have done to make things easier. I’ll watch it again or maybe more for the finer points, and then it’s off to refactoring for me! Thanks for the excellent work.

Vinnie

I’m currently working on Beginning Auto Layout and the copyright label doesn’t
center on any devices larger than the iPhone 7 using the suggested constraints.

It appears to center on the iPhone 7 but if you display the label on an iPhone 7 plus or
larger device, it’s off center to the left.

It works on all devices if I do the following:

  1. If I select the “Align” icon and choose “align horizontally”.
  2. Select the “Add new constraints” icon and choose the bottom spacing to
    nearest neighbor (20) and choose “width” and “height” and add 3 constraints,
    then the label text centers at the bottom on every device.
  3. I also did an “Auto Shrink” of the text and scaled it to 0.5.

Thanks,
Gary

The challenge with labels is that it can be hard to see what their actual frame is. The suggested constraints will cause the label to stretch the full width of the device (minus some spacing on each side). If you set the alignment of the label to centered, the text will be centered in the label - which is the full width of the device. But if the alignment is left at the default, left alignment, then the label will stretch on larger devices, but the text won’t move from its spot on the left.

Thanks Jerry.

I went back and looked at the label and realized that I hadn’t selected “center alignment” in the attributes
inspector. By selecting “center alignment” and following your steps, it now works and aligns properly on all devices.

I’m finding that you have to be careful about adding constraints because you can end up adding more
constraints then you need to correct constraints you didn’t need in the first place!

Also, is this the proper place to post any and all questions about this video course?

Gary

Dear Ray,
Can you please have old tutorials be there in the site as some of the old materials are good and have not been repeated.
Regards,
Gurminder