Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Weather App with Swift Refreshing the Data Tricky Layouts

Contsraints

My view looks good across all devices. However, I am getting warnings stating that some of my labels are ambiguous. Should I worry about this and try to fix it?

Jo Albright
Jo Albright
5,199 Points

Could you post the warning here. It is best to always remove warnings. A warning basically notes that something is probably going to act weird or go wrong, but it won't normally crash the app. So even though it runs fine with the warning, it still may look or act poorly on a device you are not testing for.

If you open the "assistant editor" (top right 2 circles overlapping), the breadcrumb for the right side can be switched to preview. You can add new devices sizes with the "+" in the bottom left of that window. This will allow you to see how your constraints will react to different device sizes.

Yea Ive got it to look good on all device sizes already. Ive got 6 warnings. One says something like horizontal view ambiguous. I mean of course its ambiguous, I want my labels to be able to space out and shrink with the varying device sizes.

Jo Albright
Jo Albright
5,199 Points

You will need to attach it to the bottom or to another view that is attached to the bottom. If you have it attached to another view and they both don't have heights, then it becomes ambiguous, since it can't figure how much to spilt up the difference between the two view heights. So either you have to have the heights to equal each other, or you need to set a ratio between the two heights view1.height > view2.height ratio 1:3 (view1 will be 1 / 3 height of view2).