SwiftSwipeView icon indicating copy to clipboard operation
SwiftSwipeView copied to clipboard

Sizing View Controllers

Open davidtperk opened this issue 9 years ago • 6 comments

Hey Brendan, thanks for the repo. Your code works perfectly with .xibs, but when I try to substitute view controllers for .xibs, the sizes are all thrown off. The only code I changed was:

This: var AVc :AViewController = AViewController(nibName: "AViewController", bundle: nil); var BVc :BViewController = BViewController(nibName: "BViewController", bundle: nil); var CVc :CViewController = CViewController(nibName: "CViewController", bundle: nil);

To this: var AVc = storyboard!.instantiateViewControllerWithIdentifier("VC1") as! UIViewController var BVc = storyboard!.instantiateViewControllerWithIdentifier("VC2") as! UIViewController var CVc = storyboard!.instantiateViewControllerWithIdentifier("VC3") as! UIViewController

img_2706 img_2707 img_2708

davidtperk avatar May 14 '15 23:05 davidtperk

@dtp5 were you able to get the original code working correctly? I just grabbed a fresh copy of master, added 3 view controllers to the storyboard and placed in ne Storyboard IDs to each view controller and then used the same three lines that you had, and it worked correctly for me.

lbrendanl avatar May 14 '15 23:05 lbrendanl

Yeah I added view controllers to your project and it ran fine. Only in my project are the sizes distorted. I've tried everything. One thing I'm thinking about is that I have an iPhone 6, and your project doesn't have native resolution on my phone. My project has native resolution, but the sizes are all off. Could that be it?

I've even copy+pasted view controllers from your project into mine and had the same problems.

UPDATE: So I tried the view controller method from within your project, and it worked fine, although without native resolution. I built a brand new project, copy+pasted everything in the new project, and was faced with the same issues. So, what's different about your project?

davidtperk avatar May 15 '15 00:05 davidtperk

I've been having the same issue, try as I might, the Views won't go edge to edge (5 fine, 6 has a gap) but the original Repo does this fine - it's so strange! I've been hunting for strange settings in the plist and all sorts.

chanc-ee avatar May 15 '15 09:05 chanc-ee

@lbrendanl I did the same above and was having the same issue at first. Resolve the issue by removing the "auto size classes" and by making sure that all my labels and items on the view controller had appropriate constraints.

LuAndreCast avatar Jun 17 '15 02:06 LuAndreCast

I'm having the exact same issue as the initial post. Has a solution been found? It's driving me nuts. It's copy paste identical!

PS: Thanks for the awesome repo despite the issue :)

desduvauchelle avatar Aug 23 '15 03:08 desduvauchelle

Was there any solution to this problem? I'm facing the same issue.

sudeepag avatar Dec 17 '15 09:12 sudeepag