Group Group Group Group Group Group Group Group Group

State & Binding: Part 1

In the lesson show on this video:

The beginners project is not showing as it shows in the vide:

I’m using Xcode 12.

Can you please let me know why of the difference between what it shows in the video and the project?

Thanks

Hi @luisme, I’ve noticed the background color is not displaying the Color.catPurple on my end. Both on the simulator and canvas view. I do see the issue you are referring to for P03E02-Starter. This could possibly be due to a bug with Xcode 12.

Hi @isaacmendez (Laurie Gray), could you possibly check this out? Not sure if there is an update since it was lasted posted in October 2019.

Hello @gdelarosa,

Do you know if @isaacmendez has an ETA to take a look into this?, I really want to finish this course.

Thanks

Hey @gdelarosa! My sincere apologies this took me so long to figure out what was going wrong :slight_smile: Thank you so much for catching this one and messaging me! Much appreciated!

Short story - replace the Spacer layoutPriority modifier with .edgesIgnoringSafeArea(.bottom) to achieve the layout in the video.

Longer story - When we made the course there was a layout priority issue with the Spacer component where it didn’t act quite as expected (according to scant documentation and videos) between SwiftUI versions so we added the priority modifier to make sure it would appear - not ideal but it worked. However there has been a change to the component now whereby setting the priority to 1 would adversely affect the layout as ideally we should be shouldn’t really be using that anyway. Instead we should be using the edges modifier to allow the view to know how to report its size request to the parent.

Thank you for your patience on this one - good luck completing the course and we’ll get a code change pushed up with comments shortly for others to benefit.

Have a great day!

Laurie :slight_smile:

Did you update your implementation source is link in the tutorial ?

Its in review now and will be in merged shortly. In the meantime please use the one line fix above and it will work like a charm :slight_smile: Have a great day. Laurie.