This is a companion discussion topic for the original entry at https://www.raywenderlich.com/9051-beginning-ios-animations/lessons/9
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/9051-beginning-ios-animations/lessons/9
I think the line 102 of View Transitions - End/PackingList/ViewController.swift:
let imageHeight = imageView.heightAnchor.constraint(equalTo: imageView.widthAnchor)
Should be:
let imageHeight = imageView.heightAnchor.constraint(equalTo: containerView.widthAnchor)
@catie Can you please help with this when you get a chance? Thank you - much appreciated! :]
That would also work! What I intended to convey here was that the image view has a 1:1 aspect ratio, where the height of the image view is the same as its width. That’s actually a bit easier to express when setting up constraints in Interface Builder!
So, in this case, because we set the container view up to be square, you could alternatively say “the image view’s height is the same as the container view’s height”, or, as you suggest “the image view’s height is the same as the container view’s width” and get exactly the same result.