Because I am having issues with auto layout, I searched this forum and discovered Jerry Beers “Mastering Auto Layout” video tutorial. I was ready to subscribe, but saw that his tutorial was for iOS 10, Swift 3 and Xcode 8.
I have no idea what Apple has changed in their latest dev software with regards to auto layout, but until this video course is upgraded to the latest software upgrades, I will refrain from subscribing.
I totally understand that it is a constant battle trying to keep up with all of Apple’s yearly changes, but that’s the nature of the beast. I sincerely hope that Mr. Beers will upgrade his tutorial in the very near future. When he does I will be first in line to subscribe.
What I just wrote prompted this thought: If I were to subscribe to this dated tutorial, would I be notified when it was upgraded?
Jessy, the Video Team Lead, here. As shown on our Upcoming Courses page, Mastering Auto Layout is in the updating process right now. I’ve been working on that personally (Jerry is working on other courses shown there), and it will be recorded right after we return from the holiday break. I can tell you that you should find nearly all of what Jerry covered to still be applicable, but I can understand the desire to only want to take the time to watch the most up-to-date material.
Unfortunately, the best we offer in terms of notifications right now, is site-wide. That is, you can get notified about all new releases and updates, but not this one in particular.
Thanks for the quick feedback. I heard back from Jerry and he noted nearly all of the points you made in your post.
I am going to become a video subscriber and hope that it will help me overcome the AL issues I am currently experiencing. My app has zero warnings when launched on all the iPhones save for the iPhone SE. When the app is run on that iPhone I get overlapping and compressed views. I will find the solution to these issues.
Trust me when I say that I sincerely appreciate all that you do for dev’s such as myself. Trying to keep up with Apple is no easy task.
Thanks for your post. And, yes, you’re so right about AL being a “deeper topic than might be expected”, because it is indeed that and more. I forgot to note that one very key thing that made a HUGE difference for me was something that Catie pointed out - the Autoshrink feature as applied to Labels. That is SO important to know about.
However, … all was going well until I ran into the (apparently) not-so-well publicized bug in Xcode 9 and that is this. For some reason when adding labels, textfields, etc to a stack view, it will sometimes absolutely explode completely out of the scene or viewcontroller you used the stack view in. The error you get is as follows:
“Illegal Configuration. Interface Builder does not support UILabel sizes larger than 10,000 by 10,000”
This error is repeated for each view that you added to the stack view, ie, “… support UIStackView sizes …” and “… support UITextField sizes …”
Each of the label/textfield views that I add to make this happen are 100-125 in width and all have a height of 32. The weird thing is that this does not happen to all stack views. I have done the usual thing we do, re-launch Xcode and the computer. Regardless, the results are the same.
I posted the issue to the Apple forums yesterday and the sole responder noted that this was not new and linked me to another Apple forum thread noting the same problem. So, for the time being using stack views is not option for me which brings me to a screeching halt. Hopefully, Apple with fix this soon.
I suppose I should have sent a bug report to Apple. I will probably do that this evening.
I think I figured out what this UIStackView problem is all about and have submitted a bug report to Apple. The software in question is Xcode 9.2, Swift 3.2 and Swift 4.0.
The stack view ballooning is caused by adding a blank label to a stack view. If the label has text the stack view will accept the label and behave normally. If the label has no text and added to a (unconstrained) stack view, the stack view will balloon out of the view controllers UIView. This is followed by the error:
“Illegal Configuration. Interface builder does not support UILabel sizes larger than 10,000 by 10,000”
If you get sneaky and remove the text you added to the label after you added the label to the stack view, the stack view will still blow up. But, there may be a way to “constrain” this odd behavior. Read on.
If the stack view has been constrained to the right and left margins of the UIView and then the blank label is added, the ballooning will be downward within the contraints.
If the stack view is constrained on all four sides of the UIView BEFORE the blank label is added to the stack view, the stack view will behave normally. While this may appear to be a solution, I do not feel comfortable with it at all.
From my research this bug may not be that widely known, at least I found few places that it was reported. I - like many others I’m sure, use labels for computed results, which means they must be blank before their results can be displayed.
Hopefully, Apple engineer’s will code up a solution to this issue in the very near future.