State & Binding: Part 1

In the lesson show on this video:

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

Screen Shot 2020-09-28 at 10.04.04 AM

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?


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.

Screen Shot 2020-09-28 at 10.16.36 AM

Hello @gdelarosa,

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


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.

Simulator Screen Shot - iPhone 11 Pro Max - 2020-10-07 at 09.34.20

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.


It looks better but still looks weird

Screen Shot 2020-10-30 at 12.11.58 PM

Yeah something is wrong in the implementation here. Did you pull down the latest source files? They have a completed example with comments showing where it went wrong. See my screenshot above.

Did you so my post in here Accessibility: Part 2

This topic was automatically closed after 166 days. New replies are no longer allowed.