iOhYes Retired

iOhYes

A podcast by iOS developers for iOS developers, delivering news, tips, and rants for professional iOS/Mac developers, with something for enterprise and indie developers alike.

Hosted by Darryl Thomas and John Sextro.



← Previous Episode   |   Next Episode →

81: Just Do It In Code

August 19, 2015 at 10:00AM • 42 minutes • Wiki Entry

Tweet Shoutouts

Discussion - UIStackView

  • Referred to by Apple as “your first stop for interfaces built with Auto Layout” in the description of WWDC15 Session 218
  • Manages the constraints of a vertical or horizontal linear layout
  • Easy migration of IB-based layouts using the new “Embed in Stack View” button
  • Subviews that are to be managed by the stack view are added to the arrangedSubviews property. This allows decorative views to be added directly to subviews without affecting the arrangement.
    • Potential pitfall: Removing a view from the arrangedSubviews array does not remove it as a subview. The stack view no longer manages the view’s size and position, but the view is still part of the view hierarchy, and will be rendered on screen if it is visible.
  • Multiple distribution styles
    • UIStackViewDistributionFill - A layout where the stack view resizes its arranged views so that they fill the available space along the stack view’s axis. When the arranged views do not fit within the stack view, it shrinks the views according to their compression resistance priority. If the arranged views do not fill the stack view, it stretches the views according to their hugging priority.
    • UIStackViewDistributionFillEqually - A layout where the stack view resizes its arranged views so that they fill the available space along the stack view’s axis. The views are resized so that they are all the same size along the stack view’s axis.
    • UIStackViewDistributionFillProportionally - A layout where the stack view resizes its arranged views so that they fill the available space along the stack view’s axis. Views are resized proportionally based on their intrinsic content size along the stack view’s axis.
    • UIStackViewDistributionEqualSpacing - A layout where the stack view positions its arranged views so that they fill the available space along the stack view’s axis. When the arranged views do not fill the stack view, it pads the spacing between the views evenly. If the arranged views do not fit within the stack view, it shrinks the views according to their compression resistance priority.
    • UIStackViewDistributionEqualCentering - A layout that attempts to position the arranged views so that they have an equal center-to-center spacing along the stack view’s axis, while maintaining the spacing property’s distance between views. If the arranged views do not fit within the stack view, it shrinks the spacing until it reaches the minimum spacing defined by its spacing property. If the views still do not fit, the stack view shrinks the arranged views according to their compression resistance priority.

Picks

Chad

Darryl

Alternative show title suggestions

  • Your first stop
  • Not your final destination
  • Beefing it up
  • Microphone Hungry

This episode of iOhYes is brought to you by Braintree. Thanks to Braintree for supporting iOhYes and 5by5. Check them out at braintreepayments.com/yes