Creating this topic to create any typos and bugs in the 1st Edition of Auto Layout by Tutorials.
At the bottom of page 59 you have the following code sample for creating the tap gestures:
I think this should just be:
Thanks @sironfoot. The correction is on the way.
Quick issues with the starter file
Chapter 2 - The starter file Messaging app has a group Views/ContactsPreview listed but it does not exist, so in the exercise that has you add a view, you have to first delete the group ContactsPreview, add it new so it creates the underlying folder and then you can create the file.
Chapter 2 - pg 54 - not a error but in the code example there is use of NSLayoutContstraint, I followed along but then was surprised that there was no explanation of its use looks like it is covered in Chp 4 so maybe a reference to say it will be covered in Chp 4.
Chapter 2 - pg. 58 has you connect an outlet from the connections inspector to the view and the imageView , its listed as Content View and Photo Image View but the views has not been named so it’s sort of misleading if you look at the way it looks vs. the screen shot as it will look as follows instead.
Chapter 2 - Page 59 references to add
to viewDidLoad but at the point no function called configureGestures has been created. I checked the final project and its even more confusing as there is no configureTapGestures() function but there is a configureGestures.
Hope these are helpful!
Thank you for your feedback @pavelar! Really appreciate it. The corrections are on the way.
In chapter 8, although the second “label” has the number of lines set to 2, only one line is displayed and terminated with “…”. I use the iPhone SE simulator. If I set the Row height for the tableview to a higher value (e.g. 85) all works fine. The “final” project also works.
@thebelg Thank you for your feedback. Make sure you are adding the constraints to the superview, and the option “Contrains to margin” is unchecked".
I just added the note and will be on the next release.
Thanks, will try it. Also some of the sample start-projects have a problem with the “groups” in the projects. the associated directory in the filesystem isn’t created.
Some comments about Chapter 4, I have read it a couple of times as some parts were hard to sink in for me anyways
Pg 90 it describes the difference between using NSLayoutConstraints with initializers vs. using layout anchors, the snippet of code on pg. 90 would be easier to understand if it included the full NSLayoutConstraint declaration as opposed to just a snippet of the anchors, I had to go through the section a couple of times and finally googled to understand what was happening, maybe its just me.
Pg 91 we code setupProfileHeaderView() and then the next step is I think redoing it but because it says “You can now refactor the code you added earlier” I kept looking for other code but I am believing all you mean to do is rewrite the code we just wrote.
Pg. 93 codes the ProfileImageView(), in the explanation it keeps referring to code from somewhere else that makes it hard to follow for example in 1. “Notice that the access modifier for BorderShape is no longer private” ? When was it ever private? similarly 2. “which has changed from a string type to use the enum” ? we literally just wrote the code so it was never a string type or if it was, where?
Took me some time but I learned a lot, was thinking it would have been helpful to have a better explanation of the code, for example the code for the stackview is about a page long and uses, contentCompression which I cannot find previous introduction but the explanation of the code is very brief.
Also in the layout priorities it used 251 for contentHugging and 751 for compression but there is no explanation of why I would do that as opposed to using 250 and 750? is there a significance when doing it in code to having +1?
Chapter 5, hey guys can I make a suggestion, Chapter 5 talks about scroll views, it would be great if the book described how to use scroll view using interface builder and auto layout, I always have problems in this area so it would be great for coverage that describes the correct way to set them up.
Chapter 6: CollectionView. I tried the example ( also the solution ) but the image is NOT centered iwhen I switch from Portrait to landscape mode
Just a missing word on p. 294, 3rd sentence of 1st paragraph should begin, “For instance, your layout may have too few…”
Hello, @krouncha! Thank you for submitting this! I’ve recorded it and we’ll update it for the next edition.
This will, definitely, be part of the next edition. Thanks for your feedback
I’m on page 41, no iphone 8 listed, using iPhone 8 plus. Logo is aligned horizontally and vertically, leading and trailing constraints constants = 20. Everything works fine up to this point. I then set orientation = landscape, logo is also expanding over the vertical edges as expected. I then set the top and bottom constraint constants = 20 and nothing happens, the logo does not rescale and there are no warnings. I have repeated the same process 3x already. Maybe buggy Xcode? Using Xcode 12.0 beta
Looks like a refresh problem. It’s working now.
Hi @pavelar, thanks for the feedback! The next edition will include clarifications to help address the points mentioned for chapter 4.
Hi @thebelg and thanks for your feedback! Suppose you’re referring to
StoryEventCollectionViewCell, may I know how I may go about recreating this problem? Mention of Xcode version and device model may also help.