4 Replies
      Latest reply on Mar 23, 2019 10:56 AM by macuser1984
      macuser1984 Level 1 Level 1 (0 points)

        I have a UIViewController subclass that I made in a regular app, and I tried moving it over to my playground, but there are some layout issues happening in the playground that weren't in the regular app (and there were no Auto Layout-related messages in the console when running the app). I've got a UIStackView pinned to the bottom of the view controller's view (meaning the UIView at the highest level of the view hierarchy), and that seems to be where most of the issues are happening.

         

        In the playground, the live view is set to an instance of my UIViewController subclass. I'm also seeing different (but both incorrect) results when running the playground on my Mac vs. in the Swift Playgrounds app. When running on the Mac in Xcode, the live view looks more like the size of an iPhone, but the size reported by the view controller instance's view's bounds is 768x1024, which is an iPad screen size.

         

        All of this UI setup is done in code - no Interface Builder files involved since I've had so many issues with external files in playgrounds.

         

        Any suggestions on how to fix this and/or if this is a common issue?