Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 8 layout engine changes #21

Closed
alexandre-g opened this issue Sep 28, 2016 · 1 comment
Closed

Xcode 8 layout engine changes #21

alexandre-g opened this issue Sep 28, 2016 · 1 comment
Assignees
Milestone

Comments

@alexandre-g
Copy link

Due to some changes in how Autolayout works with new storyboard format in Xcode 8, CKTextField with constraints does not show unless misplaced on storyboard as gets 0,0, 1000, 1000 frame by default.

See http://stackoverflow.com/questions/39503572/xcode-8-uibuttons-with-constraints-not-showing-up/39548367#39548367

For my project I've solved by setting the frame in layoutSubviews: (mind the differences from repo)

if (self.acceptButton) {
    CGFloat width = self.bounds.size.height - 5;
    self.acceptButton.frame = CGRectMake(self.bounds.size.width - width - 3, 3, width, width - 1);
    self.acceptButton.layer.cornerRadius = (self.bounds.size.height - 6.0) / 2;
}

Is there a better way?

@JaNd3r
Copy link
Owner

JaNd3r commented Sep 28, 2016

I'm currently in the process of migrating an app from Swift 2 / iOS 9 to Swift 3 / iOS 10 and will have a look at it.

@JaNd3r JaNd3r added the bug label Sep 29, 2016
@JaNd3r JaNd3r added this to the 0.3.1 milestone Sep 29, 2016
@JaNd3r JaNd3r self-assigned this Sep 29, 2016
JaNd3r added a commit that referenced this issue Sep 29, 2016
@JaNd3r JaNd3r closed this as completed Sep 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants