What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder...

169
© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. App Frameworks #WWDC16 Session 236 What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer

Transcript of What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder...

Page 1: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

App Frameworks #WWDC16

Session 236

What’s New in Auto Layout

Jason Yao Interface Builder EngineerJesse Donaldson AppKit EngineerMarian Goldeen UIKit Engineer

Page 2: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Incrementally Adopting Auto Layout

Page 3: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental
Page 4: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Page 5: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Page 6: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Pins top, left, width and height

Page 7: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Pins top, left, width and height

Page 8: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Pins top, left, width and heightFor dynamic resize behavior

Page 9: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Pins top, left, width and heightFor dynamic resize behavior• Must add your own constraints

Page 10: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Can specify autoresizing masks

NEW

Page 11: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Can specify autoresizing masks • For simple resize behavior

NEW

Page 12: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Can specify autoresizing masks • For simple resize behavior

Works alongside views with constraints

NEW

Page 13: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Can specify autoresizing masks • For simple resize behavior

Works alongside views with constraintsAutoresizing masks will translate into constraints at runtime

NEW

Page 14: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Can specify autoresizing masks • For simple resize behavior

Works alongside views with constraintsAutoresizing masks will translate into constraints at runtime

NEW

Page 15: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with No Constraints

Can specify autoresizing masks • For simple resize behavior

Works alongside views with constraintsAutoresizing masks will translate into constraints at runtime

translatesAutoresizingMaskIntoConstraints == true

NEW

Page 16: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with Constraints

Show constraints in the size inspector

Page 17: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with Constraints

Show constraints in the size inspectorAutoresizing masks are ignored

Page 18: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Views with Constraints

Show constraints in the size inspectorAutoresizing masks are ignored

translatesAutoresizingMaskIntoConstraints == false

Page 19: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Incremental Adoption

Use autoresizing masks until ready for constraints

NEW

Page 20: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Incremental Adoption

Use autoresizing masks until ready for constraintsConstrain views by subtree

NEW

Page 21: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Incremental Adoption

Use autoresizing masks until ready for constraintsConstrain views by subtree

NEW

Page 22: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Incremental Adoption

Use autoresizing masks until ready for constraintsConstrain views by subtree

NEW

Page 23: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Incremental Adoption

Use autoresizing masks until ready for constraintsConstrain views by subtree Adopt Auto Layout on your terms

NEW

Page 24: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

DemoIncremental adoption

Page 25: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design and Runtime Constraints

Page 26: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Placeholder Constraints

Simulate constraint behavior at design time

Page 27: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Placeholder Constraints

Simulate constraint behavior at design time

Page 28: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Placeholder Constraints

Simulate constraint behavior at design timeAdd constraint at runtime

Page 29: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design Time Intrinsic Size

Good for custom controls

Page 30: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design Time Intrinsic Size

Good for custom controlsIntrinsic content size

Page 31: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design Time Intrinsic Size

Good for custom controlsIntrinsic content size• Size input not known to Auto Layout

Page 32: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design Time Intrinsic Size

Good for custom controlsIntrinsic content size• Size input not known to Auto Layout

Page 33: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design Time Intrinsic Size

Good for custom controlsIntrinsic content size• Size input not known to Auto Layout

Simulate content size

Page 34: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design Time Intrinsic Size

Good for custom controlsIntrinsic content size• Size input not known to Auto Layout

Simulate content sizeAt runtime, may need to

Page 35: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design Time Intrinsic Size

Good for custom controlsIntrinsic content size• Size input not known to Auto Layout

Simulate content sizeAt runtime, may need to

override var intrinsicContentSize: CGSize

Page 36: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Turn Off Ambiguity Per View

Arbitrary layout defined with runtime constraints

NEW

Page 37: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Turn Off Ambiguity Per View

Arbitrary layout defined with runtime constraints

NEW

Page 38: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Turn Off Ambiguity Per View

Arbitrary layout defined with runtime constraints

NEW

Page 39: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Turn Off Ambiguity Per View

Arbitrary layout defined with runtime constraints

NEW

Page 40: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

We Have Seen

Incrementally adopting Auto LayoutPlaying well with design and runtime constraints

Page 41: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

A new layout container for macOSNSGridView

NEW

Page 42: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

NSGridView

Maintenance on constraints is complicated

NEW

Page 43: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

NSGridView

Maintenance on constraints is complicated

NS/UIStackView• Arranging a sequence of items• Fine control over content size and spacing

NEW

Page 44: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

NSGridView

Maintenance on constraints is complicated

NS/UIStackView• Arranging a sequence of items• Fine control over content size and spacing

NEW

Page 45: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

NSGridView

Maintenance on constraints is complicated

NS/UIStackView• Arranging a sequence of items• Fine control over content size and spacing

NSGridView• Places views in an explicitly defined grid• Content aligned across rows and columns

NEW

Page 46: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView NEW

Page 47: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn

NEW

Page 48: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing

NEW

Page 49: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing• Optional padding and spacing

NEW

Page 50: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing• Optional padding and spacing• Hidden rows and columns

NEW

Page 51: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing• Optional padding and spacing• Hidden rows and columns

NSGridCell

NEW

Page 52: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing• Optional padding and spacing• Hidden rows and columns

NSGridCell• Each cell manages a content view

NEW

Page 53: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing• Optional padding and spacing• Hidden rows and columns

NSGridCell• Each cell manages a content view• Adjustable placement

NEW

Page 54: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing• Optional padding and spacing• Hidden rows and columns

NSGridCell• Each cell manages a content view• Adjustable placement• Merged cells

NEW

Page 55: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

OverviewNSGridView

NSGridRow and NSGridColumn• Automatic or explicit sizing• Optional padding and spacing• Hidden rows and columns

NSGridCell• Each cell manages a content view• Adjustable placement• Merged cells

NEW

Page 56: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

Design

Page 57: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

Design

Page 58: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

Design Implementation

Page 59: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

Design Implementation

Page 60: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

Design Implementation

Page 61: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

Design Implementation

Page 62: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

Design Implementation

Page 63: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

Design Implementation

Page 64: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

Design Implementation

Page 65: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

let empty = NSGridCell.emptyContentView

let gridView = NSGridView(views: [

[brailleTranslationLabel, brailleTranslationPopup],

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

Design Implementation

Page 66: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

Design Implementation

Page 67: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

Design Implementation

Page 68: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

Design Implementation

Page 69: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

Design Implementation

Page 70: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[empty, showContractedCheckbox],

[empty, showEightDotCheckbox],

[statusCellsLabel, showGeneralDisplayCB],

[empty, textStyleCB],

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

Design Implementation

Page 71: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

Design Implementation

Page 72: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

Design Implementation

Page 73: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

Design Implementation

Page 74: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

Design Implementation

Page 75: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

[showAlertCB]

])

gridView.setContentHuggingPriority(600, for: .horizontal)

gridView.setContentHuggingPriority(600, for: .vertical)

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

Design Implementation

Page 76: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo:

textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 77: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo:

textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 78: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo:

textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 79: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo:

textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 80: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo:

textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 81: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo:

textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 82: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo:

textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 83: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design

Page 84: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design

No Padding

Page 85: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design

No PaddingNo Spacing

Page 86: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Design

No PaddingNo Spacing

No Spacing or Padding

Page 87: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 88: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 89: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// the first column needs to be right-justified:

gridView.column(at: 0).xPlacement = .trailing

// all cells use firstBaseline alignment

gridView.rowAlignment = .firstBaseline

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 90: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design ImplementationDesign Implementation

Page 91: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design ImplementationDesign Implementation

Page 92: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design ImplementationDesign Implementation

Page 93: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design ImplementationDesign Implementation

Page 94: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

// We need a little extra vertical space around the popup:

let row = gridView.cell(for: brailleTranslationPopup)!.row!

row.topPadding = 5

row.bottomPadding = 5

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design ImplementationDesign Implementation

Page 95: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 96: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 97: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

gridView.cell(for:statusCellsLabel)!.row!.topPadding = 6

// Special treatment for centered checkbox:

let cell = gridView.cell(for: showAlertCB)!

cell.row!.topPadding = 4

cell.row!.mergeCells(in: NSMakeRange(0, 2))

cell.xPlacement = .none

let centering = showAlertCB.centerXAnchor.constraint(equalTo: textStyleCB.leadingAnchor)

cell.customPlacementConstraints = [centering]

Design Implementation

Page 98: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Summary

Great for arranging static grid-like UI• Set up your content• Adjust to fit your design

Page 99: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

A special kind of layout bugLayout Feedback Loop Debugging

Page 100: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Layout Feedback Loop

Page 101: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Layout Feedback Loop

Page 102: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Layout Feedback Loop

Page 103: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

What’s happening?

Page 104: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

What’s happening?

Page 105: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Upstream setNeedsLayout()

Page 106: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Upstream setNeedsLayout()

Page 107: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Upstream setNeedsLayout()

What views are involved?

Page 108: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Upstream setNeedsLayout()

What views are involved?Where is the upstream setNeedsLayout()? ?

??

Page 109: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

NEW

Launch argumentThe Layout Feedback Loop Debugger

-UIViewLayoutFeedbackLoopDebuggingThreshold 100 // 50...1000

-NSViewLayoutFeedbackLoopDebuggingThreshold 100 // 50...1000

Logs to com.apple.UIKit:LayoutLoop or com.apple.AppKit:LayoutLoop

Page 110: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

NEW

Launch argumentThe Layout Feedback Loop Debugger

Unified Logging and Activity Tracing Nob Hill Friday 5:00 PM

-UIViewLayoutFeedbackLoopDebuggingThreshold 100 // 50...1000

-NSViewLayoutFeedbackLoopDebuggingThreshold 100 // 50...1000

Logs to com.apple.UIKit:LayoutLoop or com.apple.AppKit:LayoutLoop

Page 111: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

(lldb) po [_UIViewLayoutFeedbackLoopDebugger layoutFeedbackLoopDebugger]

NEW

Launch argumentThe Layout Feedback Loop Debugger

Page 112: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Two examplesThe Layout Feedback Loop Debugger

Page 113: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Two examplesThe Layout Feedback Loop Debugger

Upstream geometry changes

Page 114: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Two examplesThe Layout Feedback Loop Debugger

Upstream geometry changesAmbiguous layout from constraints

Page 115: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 1: Upstream Geometry Change

Page 116: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 1: Upstream Geometry Change

Page 117: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 1: Upstream Geometry Change

Page 118: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 1: Upstream Geometry Change

The view in layout changes the bounds of its superview

.bounds = rect

Page 119: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 1: Upstream Geometry Change

The view in layout changes the bounds of its superviewBecause its superview is not in layout, that view receives setNeedsLayout()

.bounds = rect

setNeedsLayout()

Page 120: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 1: Upstream Geometry Change

The view in layout changes the bounds of its superviewBecause its superview is not in layout, that view receives setNeedsLayout()During its layout, it resets the bounds of its subview

.bounds = rect

.bounds = origRecttriggers layout

setNeedsLayout()

Page 121: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 1: Upstream Geometry Change

The view in layout changes the bounds of its superviewBecause its superview is not in layout, that view receives setNeedsLayout()During its layout, it resets the bounds of its subviewThe loop is sustained by the two views fighting over the bounds of the view in the middle

.bounds = rect

.bounds = origRecttriggers layout

setNeedsLayout()

Page 122: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Top-level view = <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > Views caught in loop: 23 <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > | <UIDimmingView: 0x10354c440; frame = (0 0; 1024 768); > | 11 <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > | | 12 <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants auto layout; tAMIC = YES; > | | | <UINavigationBar: 0x10fe52490; frame = (0 0; 604 44); wants AL; tAMIC = NO; > | | | | < snip uninvolved navigation bar hierarchy > | | | <UIView: 0x111077d00; frame = (0 44; 604 90); wants auto layout; tAMIC = NO; > | | | | < snip additional uninvolved hierarchy > | | | 1 <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > | | | | 2 <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > | | | | | 3 <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > | | | | | | 4 <UIView: 0x1034c9a60; fr… = (0 0; 540 489); wants AL; tAMIC = YES;> | | | | | | | 5 <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants AL; tAMIC = NO; > | | | | | | | | 6 <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > | | | | | | | | | 7 <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > | | | | | | | | | | 10 <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > | | | | | | | | | | | <_UIHighlightView: 0x103516400; frame = (399 91; 132 23); > | | | | | | | | | | 9 <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > | | | | | | | | | | 8 <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > | | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); >

Page 123: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Top-level view = <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > Views caught in loop: 23 <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > | <UIDimmingView: 0x10354c440; frame = (0 0; 1024 768); > | 11 <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > | | 12 <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants auto layout; tAMIC = YES; > | | | <UINavigationBar: 0x10fe52490; frame = (0 0; 604 44); wants AL; tAMIC = NO; > | | | | < snip uninvolved navigation bar hierarchy > | | | <UIView: 0x111077d00; frame = (0 44; 604 90); wants auto layout; tAMIC = NO; > | | | | < snip additional uninvolved hierarchy > | | | 1 <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > | | | | 2 <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > | | | | | 3 <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > | | | | | | 4 <UIView: 0x1034c9a60; fr… = (0 0; 540 489); wants AL; tAMIC = YES;> | | | | | | | 5 <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants AL; tAMIC = NO; > | | | | | | | | 6 <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > | | | | | | | | | 7 <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > | | | | | | | | | | 10 <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > | | | | | | | | | | | <_UIHighlightView: 0x103516400; frame = (399 91; 132 23); > | | | | | | | | | | 9 <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > | | | | | | | | | | 8 <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > | | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); >

Page 124: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Top-level view = <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > Views caught in loop: 23 <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > | <UIDimmingView: 0x10354c440; frame = (0 0; 1024 768); > | 11 <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > | | 12 <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants auto layout; tAMIC = YES; > | | | <UINavigationBar: 0x10fe52490; frame = (0 0; 604 44); wants AL; tAMIC = NO; > | | | | < snip uninvolved navigation bar hierarchy > | | | <UIView: 0x111077d00; frame = (0 44; 604 90); wants auto layout; tAMIC = NO; > | | | | < snip additional uninvolved hierarchy > | | | 1 <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > | | | | 2 <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > | | | | | 3 <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > | | | | | | 4 <UIView: 0x1034c9a60; fr… = (0 0; 540 489); wants AL; tAMIC = YES;> | | | | | | | 5 <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants AL; tAMIC = NO; > | | | | | | | | 6 <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > | | | | | | | | | 7 <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > | | | | | | | | | | 10 <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > | | | | | | | | | | | <_UIHighlightView: 0x103516400; frame = (399 91; 132 23); > | | | | | | | | | | 9 <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > | | | | | | | | | | 8 <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > | | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); >

Page 125: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Top-level view = <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > Views caught in loop: 23 <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > | <UIDimmingView: 0x10354c440; frame = (0 0; 1024 768); > | 11 <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > | | 12 <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants auto layout; tAMIC = YES; > | | | <UINavigationBar: 0x10fe52490; frame = (0 0; 604 44); wants AL; tAMIC = NO; > | | | | < snip uninvolved navigation bar hierarchy > | | | <UIView: 0x111077d00; frame = (0 44; 604 90); wants auto layout; tAMIC = NO; > | | | | < snip additional uninvolved hierarchy > | | | 1 <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > | | | | 2 <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > | | | | | 3 <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > | | | | | | 4 <UIView: 0x1034c9a60; fr… = (0 0; 540 489); wants AL; tAMIC = YES;> | | | | | | | 5 <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants AL; tAMIC = NO; > | | | | | | | | 6 <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > | | | | | | | | | 7 <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > | | | | | | | | | | 10 <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > | | | | | | | | | | | <_UIHighlightView: 0x103516400; frame = (399 91; 132 23); > | | | | | | | | | | 9 <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > | | | | | | | | | | 8 <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > | | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); >

Page 126: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Top-level view = <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > Views caught in loop: 23 <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > | <UIDimmingView: 0x10354c440; frame = (0 0; 1024 768); > | 11 <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > | | 12 <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants auto layout; tAMIC = YES; > | | | <UINavigationBar: 0x10fe52490; frame = (0 0; 604 44); wants AL; tAMIC = NO; > | | | | < snip uninvolved navigation bar hierarchy > | | | <UIView: 0x111077d00; frame = (0 44; 604 90); wants auto layout; tAMIC = NO; > | | | | < snip additional uninvolved hierarchy > | | | 1 <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > | | | | 2 <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > | | | | | 3 <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > | | | | | | 4 <UIView: 0x1034c9a60; fr… = (0 0; 540 489); wants AL; tAMIC = YES;> | | | | | | | 5 <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants AL; tAMIC = NO; > | | | | | | | | 6 <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > | | | | | | | | | 7 <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > | | | | | | | | | | 10 <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > | | | | | | | | | | | <_UIHighlightView: 0x103516400; frame = (399 91; 132 23); > | | | | | | | | | | 9 <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > | | | | | | | | | | 8 <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > | | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); >

Page 127: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Top-level view = <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > Views caught in loop: 23 <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > | <UIDimmingView: 0x10354c440; frame = (0 0; 1024 768); > | 11 <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > | | 12 <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants auto layout; tAMIC = YES; > | | | <UINavigationBar: 0x10fe52490; frame = (0 0; 604 44); wants AL; tAMIC = NO; > | | | | < snip uninvolved navigation bar hierarchy > | | | <UIView: 0x111077d00; frame = (0 44; 604 90); wants auto layout; tAMIC = NO; > | | | | < snip additional uninvolved hierarchy > | | | 1 <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > | | | | 2 <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > | | | | | 3 <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > | | | | | | 4 <UIView: 0x1034c9a60; fr… = (0 0; 540 489); wants AL; tAMIC = YES;> | | | | | | | 5 <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants AL; tAMIC = NO; > | | | | | | | | 6 <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > | | | | | | | | | 7 <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > | | | | | | | | | | 10 <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > | | | | | | | | | | | <_UIHighlightView: 0x103516400; frame = (399 91; 132 23); > | | | | | | | | | | 9 <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > | | | | | | | | | | 8 <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > | | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); >

Page 128: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

| | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants AL; hosts layout engine; tAMIC = YES; > <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > )

*** Views With Geometry Changes *** Geometry change records for <UIImageView: 0x110b9e8d0; >: ( "<frame = (598.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (598.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >",

Page 129: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

| | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants AL; hosts layout engine; tAMIC = YES; > <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > )

*** Views With Geometry Changes *** Geometry change records for <UIImageView: 0x110b9e8d0; >: ( "<frame = (598.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (598.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >",

Page 130: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

| | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants AL; hosts layout engine; tAMIC = YES; > <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > )

*** Views With Geometry Changes *** Geometry change records for <UIImageView: 0x110b9e8d0; >: ( "<frame = (598.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (598.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >",

Page 131: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

| | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants AL; hosts layout engine; tAMIC = YES; > <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > )

*** Views With Geometry Changes *** Geometry change records for <UIImageView: 0x110b9e8d0; >: ( "<frame = (598.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (598.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >",

Page 132: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

| | | | | | | <UIButton: 0x10ec7d180; frame = (97 399; 410 44); wants AL; tAMIC = NO; > | | | | | | | | <UIButtonLabel: 0x10d262260; frame = (8 1; 394.5 42); > Views receiving layout in order: ( <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants AL; hosts layout engine; tAMIC = YES; > <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > )

*** Views With Geometry Changes *** Geometry change records for <UIImageView: 0x110b9e8d0; >: ( "<frame = (598.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (598.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >",

Page 133: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UIDropShadowView: 0x110870e50; frame = (242 20; 540 620); > <UIView: 0x1110a72f0; frame = (0 0; 540 620); wants AL; hosts layout engine; tAMIC = YES; > <UILayoutContainerView: 0x1110afab0; frame = (0 134; 540 489); > <UINavigationTransitionView: 0x110caf8f0; frame = (0 0; 540 489); > <UIViewControllerWrapperView: 0x1110ba000; frame = (0 0; 540 489); > <UIView: 0x1034c9a60; frame = (0 0; 540 489); wants AL; hosts layout engine; tAMIC = YES; > <UIView: 0x1110ba8a0; frame = (0 0; 604 391); wants auto layout; tAMIC = NO; > <UIWebView: 0x1034d5c60; frame = (0 0; 604 391); > <_UIWebViewScrollView: 0x10387b800; frame = (0 0; 604 391); > <UIImageView: 0x110b9e8d0; frame = (598.5 3; 2.5 99); > <UIImageView: 0x1034165d0; frame = (3 174.5; 598 2.5); > <UIWebBrowserView: 0x10390b400; frame = (0 0; 604 460); > <UITransitionView: 0x110bbce40; frame = (0 0; 1024 768); > )

*** Views With Geometry Changes *** Geometry change records for <UIImageView: 0x110b9e8d0; >: ( "<frame = (598.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (598.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 153.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<frame = (534.5, 3; 2.5, 99); in -layoutSubviews of <UIView: 0x1034c9a60; >; >",

Page 134: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

)

*** Call stacks where -setNeedsLayout is sent to the top-level view *** {( ( 0 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger _recordSetNeedsLayoutToLayerOfView:] + 864 1 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willSendSetNeedsLayoutToLayerOfView:] + 72 2 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willChangeGeometryForLayerOfView:] + 372 3 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willSendSetBounds:toLayerOfView:] + 88 4 UIKit 0x1… -[UIView(Geometry) setBounds:] + 468 5 UIKit 0x1… -[UIDropShadowView setBounds:] + 128 6 Looper 0x1… Looper + 396932 7 UIKit 0x1… -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1200 8 QuartzCore 0x1… <redacted> + 148 9 QuartzCore 0x1… <redacted> + 292 10 UIKit 0x1… -[UIView(Hierarchy) layoutBelowIfNeeded] + 1772 11 UIKit 0x1… -[UIView(Hierarchy) layoutIfNeeded] + 56 12 UIKit 0x1… __82-[_UIFormSheetPresentationController _changeLayoutModeToAvoidKeyboard:withOrigin:]_block_invoke + 84 13 UIKit 0x1… +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations: start:animationStateGenerator:completion:] + 1024 14 UIKit 0x1… +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:] + 108 15 UIKit 0x1… -[_UIFormSheetPresentationController _changeLayoutModeToAvoidKeyboard:withOrigin:] + 468 16 UIKit 0x1… -[_UIFormSheetPresentationController _keyboardWillShow:] + 204 17 CoreFoundation 0x1… <redacted> + 20 18 CoreFoundation 0x1… <redacted> + 400 19 CoreFoundation 0x1… <redacted> + 60 20 CoreFoundation 0x1… <redacted> + 1504 21 CoreFoundation 0x1… _CFXNotificationPost + 376 22 Foundation 0x1… <redacted> + 68 23 UIKit 0x1… 0x0000000101ddd2dc -[UIInputWindowController postStartNotifications:withInfo:] + 672 24 UIKit 0x0000000101de0594 __77-[UIInputWindowController

Page 135: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

)

*** Call stacks where -setNeedsLayout is sent to the top-level view *** {( ( 0 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger _recordSetNeedsLayoutToLayerOfView:] + 864 1 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willSendSetNeedsLayoutToLayerOfView:] + 72 2 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willChangeGeometryForLayerOfView:] + 372 3 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willSendSetBounds:toLayerOfView:] + 88 4 UIKit 0x1… -[UIView(Geometry) setBounds:] + 468 5 UIKit 0x1… -[UIDropShadowView setBounds:] + 128 6 Looper 0x1… Looper + 396932 7 UIKit 0x1… -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1200 8 QuartzCore 0x1… <redacted> + 148 9 QuartzCore 0x1… <redacted> + 292 10 UIKit 0x1… -[UIView(Hierarchy) layoutBelowIfNeeded] + 1772 11 UIKit 0x1… -[UIView(Hierarchy) layoutIfNeeded] + 56 12 UIKit 0x1… __82-[_UIFormSheetPresentationController _changeLayoutModeToAvoidKeyboard:withOrigin:]_block_invoke + 84 13 UIKit 0x1… +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations: start:animationStateGenerator:completion:] + 1024 14 UIKit 0x1… +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:] + 108 15 UIKit 0x1… -[_UIFormSheetPresentationController _changeLayoutModeToAvoidKeyboard:withOrigin:] + 468 16 UIKit 0x1… -[_UIFormSheetPresentationController _keyboardWillShow:] + 204 17 CoreFoundation 0x1… <redacted> + 20 18 CoreFoundation 0x1… <redacted> + 400 19 CoreFoundation 0x1… <redacted> + 60 20 CoreFoundation 0x1… <redacted> + 1504 21 CoreFoundation 0x1… _CFXNotificationPost + 376 22 Foundation 0x1… <redacted> + 68 23 UIKit 0x1… 0x0000000101ddd2dc -[UIInputWindowController postStartNotifications:withInfo:] + 672 24 UIKit 0x0000000101de0594 __77-[UIInputWindowController

Page 136: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

)

*** Call stacks where -setNeedsLayout is sent to the top-level view *** {( ( 0 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger _recordSetNeedsLayoutToLayerOfView:] + 864 1 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willSendSetNeedsLayoutToLayerOfView:] + 72 2 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willChangeGeometryForLayerOfView:] + 372 3 UIKit 0x1… -[_UIViewLayoutFeedbackLoopDebugger willSendSetBounds:toLayerOfView:] + 88 4 UIKit 0x1… -[UIView(Geometry) setBounds:] + 468 5 UIKit 0x1… -[UIDropShadowView setBounds:] + 128 6 Looper 0x1… Looper + 396932 7 UIKit 0x1… -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1200 8 QuartzCore 0x1… <redacted> + 148 9 QuartzCore 0x1… <redacted> + 292 10 UIKit 0x1… -[UIView(Hierarchy) layoutBelowIfNeeded] + 1772 11 UIKit 0x1… -[UIView(Hierarchy) layoutIfNeeded] + 56 12 UIKit 0x1… __82-[_UIFormSheetPresentationController _changeLayoutModeToAvoidKeyboard:withOrigin:]_block_invoke + 84 13 UIKit 0x1… +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations: start:animationStateGenerator:completion:] + 1024 14 UIKit 0x1… +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:] + 108 15 UIKit 0x1… -[_UIFormSheetPresentationController _changeLayoutModeToAvoidKeyboard:withOrigin:] + 468 16 UIKit 0x1… -[_UIFormSheetPresentationController _keyboardWillShow:] + 204 17 CoreFoundation 0x1… <redacted> + 20 18 CoreFoundation 0x1… <redacted> + 400 19 CoreFoundation 0x1… <redacted> + 60 20 CoreFoundation 0x1… <redacted> + 1504 21 CoreFoundation 0x1… _CFXNotificationPost + 376 22 Foundation 0x1… <redacted> + 68 23 UIKit 0x1… 0x0000000101ddd2dc -[UIInputWindowController postStartNotifications:withInfo:] + 672 24 UIKit 0x0000000101de0594 __77-[UIInputWindowController

Page 137: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

"<frame = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", ) Geometry change records for <UIDropShadowView: 0x110870e50; >: ( bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, ) Geometry change records for <UIView: 0x1110ba8a0; >: ( "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", )

Page 138: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

"<frame = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", ) Geometry change records for <UIDropShadowView: 0x110870e50; >: ( bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, ) Geometry change records for <UIView: 0x1110ba8a0; >: ( "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", )

Page 139: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

"<frame = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", ) Geometry change records for <UIDropShadowView: 0x110870e50; >: ( bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, ) Geometry change records for <UIView: 0x1110ba8a0; >: ( "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", )

Page 140: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 3: Upstream Geometry Change

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

"<frame = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", ) Geometry change records for <UIDropShadowView: 0x110870e50; >: ( bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, bounds = (0, 0; 604, 584); in -viewWillLayoutSubviews of LooperVC with <UIView: 0x1110a72f0;>, bounds = (0, 0; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, frame = (242, 20; 540, 620); in -layoutSublayersOfLayer: of <UITransitionView: 0x110bbce40;>, ) Geometry change records for <UIView: 0x1110ba8a0; >: ( "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 604, 391); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (302, 195.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<bounds = (0, 0; 540, 427); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", "<center = (270, 213.5); in -layoutSubviews of <UIView: 0x1034c9a60; >; >", )

Page 141: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 2: Ambiguous Layout

Page 142: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 2: Ambiguous Layout

Update-constraints pass precedes layout

Page 143: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Example 2: Ambiguous Layout

Update-constraints pass precedes layoutAmbiguous layout may result in oscillating solutions

Page 144: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Looper: (UIKit) [com.apple.UIKit.LayoutLoop] Ambiguous layout suspected as a cause of this layout feedback loop. Top-level view = <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > Views caught in loop: 8 <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > | 6 <LLRepresentationView: 0x15be15b30; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 7 <LLActionView: 0x15be8f540; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be767b0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8f9c0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 4 <LLRepresentationView: 0x15be56b00; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 5 <LLActionView: 0x15be8fc20; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be59db0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8fea0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 1 <LLSeparatorView: 0x15beb6240; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 3 <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > | | 2 <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > Views receiving layout in order: ( <LLSeparatorView: 0x15beb6240; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > <LLRepresentationView: 0x15be56b00; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8fc20; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLRepresentationView: 0x15be15b30; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8f540; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120",

Page 145: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Looper: (UIKit) [com.apple.UIKit.LayoutLoop] Ambiguous layout suspected as a cause of this layout feedback loop. Top-level view = <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > Views caught in loop: 8 <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > | 6 <LLRepresentationView: 0x15be15b30; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 7 <LLActionView: 0x15be8f540; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be767b0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8f9c0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 4 <LLRepresentationView: 0x15be56b00; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 5 <LLActionView: 0x15be8fc20; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be59db0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8fea0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 1 <LLSeparatorView: 0x15beb6240; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 3 <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > | | 2 <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > Views receiving layout in order: ( <LLSeparatorView: 0x15beb6240; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > <LLRepresentationView: 0x15be56b00; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8fc20; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLRepresentationView: 0x15be15b30; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8f540; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120",

Page 146: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Looper: (UIKit) [com.apple.UIKit.LayoutLoop] Ambiguous layout suspected as a cause of this layout feedback loop. Top-level view = <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > Views caught in loop: 8 <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > | 6 <LLRepresentationView: 0x15be15b30; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 7 <LLActionView: 0x15be8f540; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be767b0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8f9c0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 4 <LLRepresentationView: 0x15be56b00; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 5 <LLActionView: 0x15be8fc20; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be59db0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8fea0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 1 <LLSeparatorView: 0x15beb6240; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 3 <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > | | 2 <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > Views receiving layout in order: ( <LLSeparatorView: 0x15beb6240; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > <LLRepresentationView: 0x15be56b00; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8fc20; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLRepresentationView: 0x15be15b30; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8f540; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120",

Page 147: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Looper: (UIKit) [com.apple.UIKit.LayoutLoop] Ambiguous layout suspected as a cause of this layout feedback loop. Top-level view = <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > Views caught in loop: 8 <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > | 6 <LLRepresentationView: 0x15be15b30; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 7 <LLActionView: 0x15be8f540; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be767b0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8f9c0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 4 <LLRepresentationView: 0x15be56b00; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 5 <LLActionView: 0x15be8fc20; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be59db0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8fea0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 1 <LLSeparatorView: 0x15beb6240; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 3 <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > | | 2 <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > Views receiving layout in order: ( <LLSeparatorView: 0x15beb6240; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > <LLRepresentationView: 0x15be56b00; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8fc20; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLRepresentationView: 0x15be15b30; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8f540; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120",

Page 148: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Looper: (UIKit) [com.apple.UIKit.LayoutLoop] Ambiguous layout suspected as a cause of this layout feedback loop. Top-level view = <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > Views caught in loop: 8 <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > | 6 <LLRepresentationView: 0x15be15b30; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 7 <LLActionView: 0x15be8f540; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be767b0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8f9c0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 4 <LLRepresentationView: 0x15be56b00; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 5 <LLActionView: 0x15be8fc20; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be59db0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8fea0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 1 <LLSeparatorView: 0x15beb6240; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 3 <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > | | 2 <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > Views receiving layout in order: ( <LLSeparatorView: 0x15beb6240; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > <LLRepresentationView: 0x15be56b00; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8fc20; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLRepresentationView: 0x15be15b30; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8f540; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120",

Page 149: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

Looper: (UIKit) [com.apple.UIKit.LayoutLoop] Ambiguous layout suspected as a cause of this layout feedback loop. Top-level view = <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > Views caught in loop: 8 <LLTopView: 0x15be52b60; frame = (0 0; 470.667 57); wants AL; tAMIC = YES; > | 6 <LLRepresentationView: 0x15be15b30; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 7 <LLActionView: 0x15be8f540; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be767b0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8f9c0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 4 <LLRepresentationView: 0x15be56b00; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 5 <LLActionView: 0x15be8fc20; . . . wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > | | | <UIView: 0x15be59db0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | | | <UILabel: 0x15be8fea0; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | 1 <LLSeparatorView: 0x15beb6240; . . . wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > | | 3 <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > | | 2 <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > Views receiving layout in order: ( <LLSeparatorView: 0x15beb6240; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <UIView: 0x15beb96a0; frame = (0 0; 0.66… 0); > <UIView: 0x15beb9510; frame = (0 0; 0.66… 0); > <LLRepresentationView: 0x15be56b00; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8fc20; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLRepresentationView: 0x15be15b30; frame = ...; wants AL; tAMIC = NO; AMBIGUOUS LAYOUT; > <LLActionView: 0x15be8f540; frame = ...; wants AL; tAMIC = YES; AMBIGUOUS LAYOUT; > <LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120",

Page 150: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

)

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Page 151: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

)

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Page 152: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

)

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Page 153: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

)

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Page 154: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Page 155: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Page 156: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Representation

RepresentationContainer

Label

Action

Page 157: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Representation

RepresentationContainer

Label

Action

Page 158: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Representation

RepresentationContainer

Label

Action

Page 159: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Representation

RepresentationContainer

Label

Action

Page 160: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Representation

RepresentationContainer

Label

Action

Page 161: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

SubtitleExample 2: Ambiguous Layout

Sed ut perspiciatis unde omnis iste natusError sit voluptatem accusantium• Doloremque laudantium, totam rem • Aperiam, eaque ipsa quae ab illo inventore

<LLTopView: 0x15be52b60; frame = ...; wants auto layout; hosts layout engine; tAMIC = YES; > )

*** Views With Variable Changes Triggering Layout *** Variable change records for <LLRepresentationView: 0x15be15b30; >: ( "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -60", "<LLRepresentationView:0x15be15b30.minX{id: 2114} = -120" ) Constraints affecting value of LLRepresentationView:0x15be15b30.minX{id: 2114}: ( <NSLayoutConstraint:… LLLabelCntainrVw.centerX == LLActionView.centerX priority:250>, <NSLayoutConstraint:… LLLabel.trailing <= LLLabelCntainrVw.trailing>, <NSLayoutConstraint:… H:|-(>=0)-[LLLabel] ('|':LLLabelCntnrVw:0x15be767b0 )>, <NSARMaskLayoutConstraint:… h=--& v=--& LLActionView.midX == + 0.33…>, <NSLayoutConstraint:… LLRep…View-0x15be15b30.leading == LLRep…View-0x15be56b00.leading> ) Variable change records for <UIView: 0x15be767b0; >: ( "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60", "<_labelContainerView.minX{id: 1672} = 60", "<_labelContainerView.minX{id: 1672} = -60",

Representation

Action

Container

Label

Representation

RepresentationContainer

Label

Action

Page 162: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

NEW

Launch argumentThe Layout Feedback Loop Debugger

-UIViewLayoutFeedbackLoopDebuggingThreshold 100 // 50...1000

-NSViewLayoutFeedbackLoopDebuggingThreshold 100 // 50...1000

Logs to com.apple.UIKit:LayoutLoop or com.apple.AppKit:LayoutLoop

NEW

Page 163: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Summary

Page 164: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Summary

New in Interface Builder: Incrementally adopt Auto Layout

Page 165: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Summary

New in Interface Builder: Incrementally adopt Auto LayoutNew for AppKit: NSGridView for grid-like layouts

Page 166: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Summary

New in Interface Builder: Incrementally adopt Auto LayoutNew for AppKit: NSGridView for grid-like layoutsNew for debugging: NS/UIViewLayoutFeedbackLoopDebuggingThreshold

Page 167: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

More Information

https://developer.apple.com/wwdc16/236

Page 168: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental

Related Sessions

Making Apps Adaptive, Part 1 Presidio Thursday 11:00AM

Making Apps Adaptive, Part 2 Presidio Friday 9:00AM

Unified Logging and Activity Tracing Nob Hill Friday 5:00PM

Mysteries of Auto Layout, Part 1 WWDC 2015

Mysteries of Auto Layout, Part 2 WWDC 2015

Page 169: What’s New in Auto Layout€¦ · What’s New in Auto Layout Jason Yao Interface Builder Engineer Jesse Donaldson AppKit Engineer Marian Goldeen UIKit Engineer. ... Demo Incremental