Demystifying Views in iOS · Nib Outlets | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4518-demystifying-views-in-ios/lessons/6

At lesson 6, I don’t understand how the CardSuperView choose the BackView as the primary view to show, why not FrontView showed first?

@jessycatterwaul @catie Can you please help with this when you get a chance? Thank you - much appreciated! :]

The Back covers up the front because both views are loaded with the nib, and the Back is the last element in the loaded array. You could move the Front to the end, by dragging in the document outline, resulting in this:

52%20PM

But in later videos, we just hide the Back view.

Hi, @jessycatterwaul,

I followed this tut months ago, now I am coming back to re-visit it. I have a quick question, for the label of the backcard view, there are only two position constraints and one size constraint (4/5 of the card width). I thought it needs another size constraint for height, but apparently it does not. I checked the IB and I saw that label has a pretty big height value.

image

I don’t quite understand how the autolayout works in this case. Could you please explain a little bit?

Thanks

Jing

It’s a combination of a couple of elements:

Apple Developer Documentation, which is set by “Autoshrink” in Interface Builder, in this video…

…and intrinsic content size:
https://www.raywenderlich.com/6849561-layout-in-ios/lessons/15

Hi, @jessycatterwaul

Thanks for get me back and the explanation. Ah, I see it now, both minimumScaleFactor and Lines serve the purpose.

Actually you read my mind, my next question is to ask you for some posts and tutorial. Definitely I will check them out. I really the enjoy the all tutorials that I took from you and Cathy.

Best

Jing

1 Like

@oaktree Really glad you like them! Cheers! :]