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 Frame vs. Bounds

Kevin Murphy
Kevin Murphy
24,380 Points

Observation for users of Xcode8 Beta/Swift 3

Wanted to share an observation that may save others some time that had me scratching my head. For some reason both my imageView frame and bounds size (width and height) were returned as (0, 0) using a print command. This also occurred with the project files. i eventually fired up Xcode 7 as a comparison and the issue did not occur.

I don't know if this a temporary detail related to Beta but it seems that viewDidLoad() sequences/reads the view hierarchy differently than Xcode7 (?). As a workaround I used viewDidAppear() and the print/log showed the proper dimensions for the imageView frame and bounds properties.