News for hackers. Stuff that matters.
Re:Laying Out iOS UIs in Code by agildehaus on Sunday March 02, 2014 @05:31PM (#7331052)
Why not just use Auto Layout in pure code?

buttonView = [[UIButton alloc] init];

buttonView.translatesAutoresizingMaskIntoConstraints = NO;

[self.view addSubview:buttonView];

[self.view addConstraint:[NSLayoutConstraint constraintWithItem:buttonView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0f constant:0.0f]];

... etc

It's certainly better than the stress you'll have with UIView+Positioning or IB.

Re:Laying Out iOS UIs in Code by smileyborg on Sunday March 02, 2014 @06:29PM (#7331228)
Apple's options for Auto Layout in code aren't the best. Check out some of the fantastic third party APIs available.

I'm the developer of UIView+AutoLayout, which is designed to provide the API that Apple should have in the first place (it's inspired heavily by the IB options): https://github.com/smileyborg/UIView-AutoLayout

Re:Laying Out iOS UIs in Code by cschneid on Sunday March 02, 2014 @09:06PM (#7331657)
I've used a similar one myself. Same name but different project: https://github.com/jrturton/UIView-Autolayout/blob/master/So...

Thank you for making this area of ios dev less painful. :)

Re:Laying Out iOS UIs in Code by vially on Sunday March 02, 2014 @07:49PM (#7331455)
Damn, I was just getting ready to write a comment recommending UIView+AutoLayout to steal some karma from iOS developers who are not using it yet.

Seriously though, thanks for this! It really makes working with AutoLayout so much easier.

Re:Laying Out iOS UIs in Code by wattson12 on Monday March 03, 2014 @02:57AM (#7332567)
Agreed, I've been using https://github.com/dkduck/FLKAutoLayout to simplify the constraint creation