Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Auto Layout? Oh boy!

Auto Layout? Oh boy!

Cocoaconf Dallas 2013

Cesare Rocchi

April 06, 2013
Tweet

More Decks by Cesare Rocchi

Other Decks in Technology

Transcript

  1. 240x320 320x480 480x800 640x360 1280x720 1280x800 1080x1920 824x1200 768x1024 600x800

    960x640 960x540 1280x768 854x480 640x480 2560x1600 1136x768
  2. Frames UIView *newView = [[UIView alloc] initWithFrame: CGRectMake(10, 10, 100,

    100)]; [self.view addSubview:newView]; CGRect frame = newView.frame; frame.size.height = 200; frame.size.width = 200; frame.origin.x = 20; frame.origin.y = 20; newView.frame = frame;
  3. Frames UIView *newView = [[UIView alloc] initWithFrame: CGRectMake(10, 10, 100,

    100)]; [self.view addSubview:newView]; CGRect frame = newView.frame; frame.size.height = 200; frame.size.width = 200; frame.origin.x = 20; frame.origin.y = 20; newView.frame = frame; newView.center = newView.superview.center;
  4. Frames #define PADDING 20 CGRect supFrame = newView.superview.frame; CGRect frame

    = newView.frame; frame.size.height = supFrame.size.height - PADDING; frame.size.width = supFrame.size.width - PADDING; frame.origin.x = PADDING; frame.origin.y = PADDING; newView.frame = frame;
  5. Wife: “Honey are you still working with that auto layout

    thing?” Me: “Yeah, how do you know?”
  6. Wife: “Honey are you still working with that auto layout

    thing?” Me: “Yeah, how do you know?” Wife: “Because I am hearing more ‘f*ck’ and ‘sh!t’ than usual”.
  7. ?

  8. ax + by = c 2x + 2y = 4

    Linear equations
  9. ax + by = c 2x + 2y = 4

    => [x = 1, y = 1] Linear equations
  10. ax + by = c 2x + 2y = 4

    => [x = 1, y = 1] 2(x+5)-7 = 3(x-2) Linear equations
  11. ax + by = c 2x + 2y = 4

    => [x = 1, y = 1] 2(x+5)-7 = 3(x-2) => [x = 9] Linear equations
  12. One solution “Hey lady, you got the love I need

    ...” Over the Hills and Far Away - Led Zeppelin
  13. “Pleased to meet you hope you guess my name ...”

    No solution Sympathy For The Devil - The Rolling Stones
  14. Zen