Top Banner
#WWDC17 © 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Raleigh Ledet, AppKit Engineer Troy Stephens, AppKit Engineer Choosing the Right Cocoa Container View App Frameworks
244

•Choosing the Right Cocoa Container View

Jan 21, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: •Choosing the Right Cocoa Container View

#WWDC17

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

Raleigh Ledet, AppKit Engineer Troy Stephens, AppKit Engineer

•Choosing the Right Cocoa Container View

App Frameworks

Page 2: •Choosing the Right Cocoa Container View

•Let’s Play a Game

Page 3: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

Page 4: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

Page 5: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

Page 6: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

NSTableView NSTableView NSTableView NSTableViewNSOutlineView

Page 7: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

Page 8: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

Page 9: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

Page 10: •Choosing the Right Cocoa Container View

Which of These is Not Like the Other….

NSCollectionView NSGridView NSCollectionView

Page 11: •Choosing the Right Cocoa Container View

Agenda

Container view tour • NSStackView, NSGridView • NSTableView, NSOutlineView, NSBrowser, NSCollectionView

Choosing the right container view

Case studies

Page 12: •Choosing the Right Cocoa Container View

Troy Stephens, AppKit Engineer

•Let’s Unpack Some Container Views

Page 13: •Choosing the Right Cocoa Container View

Fundamentals

Page 14: •Choosing the Right Cocoa Container View

Fundamentals

Present content

Page 15: •Choosing the Right Cocoa Container View

Fundamentals

Present content

Apply desired layout

Page 16: •Choosing the Right Cocoa Container View

Fundamentals

Present content

Apply desired layout

Keep it simple, reuse common solutions

Page 17: •Choosing the Right Cocoa Container View

Fundamentals

Present content

Apply desired layout

Keep it simple, reuse common solutions

Accommodate arbitrary content

Page 18: •Choosing the Right Cocoa Container View

0

1

2

3

4

Page 19: •Choosing the Right Cocoa Container View

0 1 2 3 4

Page 20: •Choosing the Right Cocoa Container View

0

1

2

3

4

Page 21: •Choosing the Right Cocoa Container View

0

1

2

3

4

Page 22: •Choosing the Right Cocoa Container View

0

1

2

3

4

Page 23: •Choosing the Right Cocoa Container View

NSStackView0

1

2

3

4

Page 24: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

0

1

2

3

4

Page 25: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

0

1

2

3

4

Page 26: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

0

1

2

3

4

Page 27: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

0

1

2

3

4

Page 28: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

0

1

2

3

4

Page 29: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

0

1

2

3

4

Page 30: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

Optionally fill cross dimension

0

1

2

3

4

Page 31: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

Optionally fill cross dimension

Your Auto Layout constraints set heights

0

1

2

3

4

Page 32: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

Optionally fill cross dimension

Your Auto Layout constraints set heights

0

1

2

3

4

Page 33: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

Optionally fill cross dimension

Your Auto Layout constraints set heights

0

1

2

3

4

Page 34: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

Optionally fill cross dimension

Your Auto Layout constraints set heights

0

1

2

3

4

Page 35: •Choosing the Right Cocoa Container View

NSStackView

Flows views in a single column or row

Configurable edge insets

Configurable alignment

Optionally fill cross dimension

Your Auto Layout constraints set heights

Configurable spacing

0

1

2

3

4

Page 36: •Choosing the Right Cocoa Container View

NSStackView0

1

2

3

4

Page 37: •Choosing the Right Cocoa Container View

NSStackView

Adapts on resize

0

1

2

3

4

Page 38: •Choosing the Right Cocoa Container View

NSStackView

Adapts on resize

Can automatically drop low-priority views

0

1

2

3

4

Page 39: •Choosing the Right Cocoa Container View

NSStackView

Adapts on resize

Can automatically drop low-priority views

0

1

3

4

Page 40: •Choosing the Right Cocoa Container View

NSStackView

Adapts on resize

Can automatically drop low-priority views

0

1

3

4

Page 41: •Choosing the Right Cocoa Container View

NSStackView

Page 42: •Choosing the Right Cocoa Container View

NSStackView

“Gravity” areas (sections)

Page 43: •Choosing the Right Cocoa Container View

NSStackView

“Gravity” areas (sections).top

.center

.bottom

Page 44: •Choosing the Right Cocoa Container View

NSStackView

“Gravity” areas (sections).top

.center

.bottom

.center .trailing.leading

Page 45: •Choosing the Right Cocoa Container View

NSStackView

“Gravity” areas (sections).top

.center

.bottom

.center

Left-to-Right (LTR)

.trailing.leading

Page 46: •Choosing the Right Cocoa Container View

NSStackView

“Gravity” areas (sections).top

.center

.bottom

.center

Right-to-Left (RTL)

.trailing.leading

Page 47: •Choosing the Right Cocoa Container View

NSStackView

“Gravity” areas (sections)

Easier UI layout localization.top

.center

.bottom

.center

Right-to-Left (RTL)

.trailing .leading

Page 48: •Choosing the Right Cocoa Container View

NSStackView

Page 49: •Choosing the Right Cocoa Container View

NSStackView

Page 50: •Choosing the Right Cocoa Container View

NSStackView

Page 51: •Choosing the Right Cocoa Container View

NSStackView

Page 52: •Choosing the Right Cocoa Container View

NSStackView

Page 53: •Choosing the Right Cocoa Container View

NSStackView

Page 54: •Choosing the Right Cocoa Container View

NSStackView

Page 55: •Choosing the Right Cocoa Container View

NSStackView

Page 56: •Choosing the Right Cocoa Container View

NSStackView

Advanced layouts through composition!

Page 57: •Choosing the Right Cocoa Container View

NSStackView Learn more

Guides • Auto Layout Cookbook

Sample Code • InfoBarStackView, Exhibition

Mysteries of Auto Layout, Part 1 WWDC15

Page 58: •Choosing the Right Cocoa Container View
Page 59: •Choosing the Right Cocoa Container View
Page 60: •Choosing the Right Cocoa Container View
Page 61: •Choosing the Right Cocoa Container View
Page 62: •Choosing the Right Cocoa Container View

NSStackView?

Page 63: •Choosing the Right Cocoa Container View

NSStackView?

Page 64: •Choosing the Right Cocoa Container View

NSStackView?

Page 65: •Choosing the Right Cocoa Container View
Page 66: •Choosing the Right Cocoa Container View

NSGridView

Page 67: •Choosing the Right Cocoa Container View

NSGridView

Page 68: •Choosing the Right Cocoa Container View

NSGridView

Coordinated rows and columns

Page 69: •Choosing the Right Cocoa Container View

NSGridView

Coordinated rows and columns

Align corresponding views

Page 70: •Choosing the Right Cocoa Container View

NSGridView

Coordinated rows and columns

Align corresponding views

Simple control over size, alignment, and spacing

Page 71: •Choosing the Right Cocoa Container View

NSGridView

Coordinated rows and columns

Align corresponding views

Simple control over size, alignment, and spacing

Page 72: •Choosing the Right Cocoa Container View

NSGridView

Coordinated rows and columns

Align corresponding views

Simple control over size, alignment, and spacing

Automatically adapts for right-to-left languages

Page 73: •Choosing the Right Cocoa Container View

NSGridView

Coordinated rows and columns

Align corresponding views

Simple control over size, alignment, and spacing

Automatically adapts for right-to-left languages

Page 74: •Choosing the Right Cocoa Container View

NSGridView

Coordinated rows and columns

Align corresponding views

Simple control over size, alignment, and spacing

Automatically adapts for right-to-left languages

Page 75: •Choosing the Right Cocoa Container View

NSGridView Learn more

What’s New in Auto Layout WWDC16

Page 76: •Choosing the Right Cocoa Container View

NSGridView and NSStackView

Page 77: •Choosing the Right Cocoa Container View

NSGridView and NSStackView

Great for easy layout and presentation of arrays of views

Page 78: •Choosing the Right Cocoa Container View

NSGridView and NSStackView

Great for easy layout and presentation of arrays of views

But what if we need:

Page 79: •Choosing the Right Cocoa Container View

NSGridView and NSStackView

Great for easy layout and presentation of arrays of views

But what if we need:• Other kinds of layouts

Page 80: •Choosing the Right Cocoa Container View

NSGridView and NSStackView

Great for easy layout and presentation of arrays of views

But what if we need:• Other kinds of layouts• Item selection

Page 81: •Choosing the Right Cocoa Container View

NSGridView and NSStackView

Great for easy layout and presentation of arrays of views

But what if we need:• Other kinds of layouts• Item selection• Drag and Drop

Page 82: •Choosing the Right Cocoa Container View

NSGridView and NSStackView

Great for easy layout and presentation of arrays of views

But what if we need:• Other kinds of layouts• Item selection• Drag and Drop• Scalability to unbounded item sets

Page 83: •Choosing the Right Cocoa Container View

•What if We Want to Build a More Interactive Grid?

Page 84: •Choosing the Right Cocoa Container View
Page 85: •Choosing the Right Cocoa Container View
Page 86: •Choosing the Right Cocoa Container View
Page 87: •Choosing the Right Cocoa Container View
Page 88: •Choosing the Right Cocoa Container View
Page 89: •Choosing the Right Cocoa Container View
Page 90: •Choosing the Right Cocoa Container View
Page 91: •Choosing the Right Cocoa Container View
Page 92: •Choosing the Right Cocoa Container View
Page 93: •Choosing the Right Cocoa Container View
Page 94: •Choosing the Right Cocoa Container View
Page 95: •Choosing the Right Cocoa Container View
Page 96: •Choosing the Right Cocoa Container View
Page 97: •Choosing the Right Cocoa Container View
Page 98: •Choosing the Right Cocoa Container View
Page 99: •Choosing the Right Cocoa Container View
Page 100: •Choosing the Right Cocoa Container View

NSTableView

Page 101: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Page 102: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Page 103: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Page 104: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Page 105: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Page 106: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Arbitrary item content

Page 107: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Page 108: •Choosing the Right Cocoa Container View

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

NSTableView

Page 109: •Choosing the Right Cocoa Container View

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

NSTableView

Page 110: •Choosing the Right Cocoa Container View

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

NSTableView

Page 111: •Choosing the Right Cocoa Container View

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

NSTableView

Page 112: •Choosing the Right Cocoa Container View

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

Variable row height

NSTableView

Page 113: •Choosing the Right Cocoa Container View

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

Variable row height

NSTableView

Page 114: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

Variable row height

Row actions, change animations

Page 115: •Choosing the Right Cocoa Container View

NSTableView

Interactive, vertical list view

Can be single-column

Arbitrary item content

Type-selection, keyboard navigation

Group rows

Variable row height

Row actions, change animations

Page 116: •Choosing the Right Cocoa Container View

NSTableView

Scalable to large item counts

Page 117: •Choosing the Right Cocoa Container View

NSTableView

Scalable to large item counts

Populate using Bindings, or a row-index-based data source

Page 118: •Choosing the Right Cocoa Container View

NSTableView

Scalable to large item counts

Populate using Bindings, or a row-index-based data source

Versatile, easy way to present tabular data or lists

Page 119: •Choosing the Right Cocoa Container View

NSTableView Learn more

Guides: Table View Programming Guide for Mac

Sample Code: TableViewPlayground

Crafting Modern Cocoa Apps WWDC16

Page 120: •Choosing the Right Cocoa Container View

•What About Trees?••!

Page 121: •Choosing the Right Cocoa Container View

NSOutlineView

Page 122: •Choosing the Right Cocoa Container View

NSOutlineView

All the capabilities of NSTableView, plus:

Page 123: •Choosing the Right Cocoa Container View

NSOutlineView

All the capabilities of NSTableView, plus:• A hierarchical data model

Page 124: •Choosing the Right Cocoa Container View

NSOutlineView

All the capabilities of NSTableView, plus:• A hierarchical data model• Tracks model objects and their children

Page 125: •Choosing the Right Cocoa Container View

NSOutlineView

All the capabilities of NSTableView, plus:• A hierarchical data model• Tracks model objects and their children• Expandable/collapsable container nodes

Page 126: •Choosing the Right Cocoa Container View

NSOutlineView

All the capabilities of NSTableView, plus:• A hierarchical data model• Tracks model objects and their children• Expandable/collapsable container nodes• User can explore multiple branches simultaneously

Page 127: •Choosing the Right Cocoa Container View

NSOutlineView Learn more

Guides: Outline View Programming Topics, Table View Programming Guide

Sample Code: TableViewPlayground

Page 128: •Choosing the Right Cocoa Container View
Page 129: •Choosing the Right Cocoa Container View
Page 130: •Choosing the Right Cocoa Container View

NSBrowser

Page 131: •Choosing the Right Cocoa Container View

NSBrowser

Page 132: •Choosing the Right Cocoa Container View
Page 133: •Choosing the Right Cocoa Container View

NSBrowser

Page 134: •Choosing the Right Cocoa Container View

Column-based “drill down” UI

NSBrowser

Page 135: •Choosing the Right Cocoa Container View

NSBrowser

Column-based “drill down” UI

User-sizable columns

Page 136: •Choosing the Right Cocoa Container View

NSBrowser

Column-based “drill down” UI

User-sizable columns

Optional custom header views

Page 137: •Choosing the Right Cocoa Container View

NSBrowser

Column-based “drill down” UI

User-sizable columns

Optional custom header views

Optional custom preview ViewController

Page 138: •Choosing the Right Cocoa Container View

NSBrowser

Column-based “drill down” UI

User-sizable columns

Optional custom header views

Optional custom preview ViewController

Page 139: •Choosing the Right Cocoa Container View

NSBrowser

Column-based “drill down” UI

User-sizable columns

Optional custom header views

Optional custom preview ViewController

User can explore one branch at a time

Page 140: •Choosing the Right Cocoa Container View

NSBrowser Learn more

Guides: Browser Programming Topics

Sample Code: SimpleCocoaBrowser, ComplexBrowser

Page 141: •Choosing the Right Cocoa Container View

What About Custom Layouts?

Page 142: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Page 143: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Page 144: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Page 145: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Page 146: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Optional sections, header and footer views

Page 147: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Optional sections, header and footer views

Item selection, drag and drop

Page 148: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Optional sections, header and footer views

Item selection, drag and drop

Arbitrary item representation (view subtree)

Page 149: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Optional sections, header and footer views

Item selection, drag and drop

Arbitrary item representation (view subtree)

Page 150: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Optional sections, header and footer views

Item selection, drag and drop

Arbitrary item representation (view subtree)

Scalable, sparing item instantiation and reuse

Page 151: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Optional sections, header and footer views

Item selection, drag and drop

Arbitrary item representation (view subtree)

Scalable, sparing item instantiation and reuse

Can animate inserts/deletes/moves, transitions

Page 152: •Choosing the Right Cocoa Container View

NSCollectionView A customizable, scalable data view

Arbitrary, developer-defined layouts

Easy, wrapped layout

Optional sections, header and footer views

Item selection, drag and drop

Arbitrary item representation (view subtree)

Scalable, sparing item instantiation and reuse

Can animate inserts/deletes/moves, transitions

Page 153: •Choosing the Right Cocoa Container View

NSCollectionView Learn more

Sample Code: CocoaSlideCollection

Reference: NSCollectionView, NSCollectionViewLayout, and friends

What’s New in NSCollectionView WWDC15

Page 154: •Choosing the Right Cocoa Container View

Raleigh Ledet

•Choosing the Right Container View

Raleigh Ledet, AppKit Engineer

Page 155: •Choosing the Right Cocoa Container View

NSStackView NSGridView

NSCollectionView NSTableView

NSOutlineView NSBrowser

Page 156: •Choosing the Right Cocoa Container View

High level layout;Simple, configurable

Display dynamic data Interactivity

NSStackView NSGridView

NSCollectionView NSTableView

NSOutlineView NSBrowser

Page 157: •Choosing the Right Cocoa Container View

Tree structure

Grid or custom layout

Tabular NSTableView, NSOutlineView

NSOutlineView,NSBrowser

NSCollectionView

NSCollectionView NSTableView

NSOutlineView NSBrowser

Page 158: •Choosing the Right Cocoa Container View

Tree structure

Grid or custom layout

Tabular NSTableView, NSOutlineView

NSOutlineView,NSBrowser

NSCollectionView

Page 159: •Choosing the Right Cocoa Container View

Raleigh Ledet, AppKit Engineer

•Case Studies

Page 160: •Choosing the Right Cocoa Container View

Mail: Message List

Page 161: •Choosing the Right Cocoa Container View

Mail: Message List

Page 162: •Choosing the Right Cocoa Container View

Mail: Message List

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

Page 163: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

Page 164: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

Page 165: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails

Selectable

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

Page 166: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails

Selectable

Lots of properties: sender, subject, etc…

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

Page 167: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails

Selectable

Lots of properties: sender, subject, etc…

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser————————

—————————

—————————————

——————————

Page 168: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails

Selectable

Lots of properties: sender, subject, etc…

NSOutlineView

Page 169: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails

Selectable

Lots of properties: sender, subject, etc…

NSOutlineView

Page 170: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails

Selectable

Lots of properties: sender, subject, etc…

Critique use of space

NSOutlineView

Page 171: •Choosing the Right Cocoa Container View

Mail: Message List

Unbounded number of emails

Selectable

Lots of properties: sender, subject, etc…

Critique use of space

NSOutlineView

Page 172: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space NSTableView

Page 173: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs

NSTableView

Page 174: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs• Add new way to sort

NSTableView

Page 175: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs• Add new way to sort

NSTableView

Page 176: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs• Add new way to sort• Less control over size of each property

NSTableView

Page 177: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs• Add new way to sort• Less control over size of each property• Emphasizes most used content

NSTableView

Page 178: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs • Add new way to sort • Less control over size of each property • Emphasizes most used content

Page 179: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs • Add new way to sort • Less control over size of each property • Emphasizes most used content

Page 180: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs • Add new way to sort • Less control over size of each property • Emphasizes most used content

NSStackView

Page 181: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs • Add new way to sort • Less control over size of each property • Emphasizes most used content

NSStackView

Page 182: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs • Add new way to sort • Less control over size of each property • Emphasizes most used content

NSGridView

Page 183: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs • Add new way to sort • Less control over size of each property • Emphasizes most used content

Page 184: •Choosing the Right Cocoa Container View

Mail: Message List

Critique use of space

Consider tradeoffs • Add new way to sort • Less control over size of each property • Emphasizes most used content

NSTableView

Page 185: •Choosing the Right Cocoa Container View

Preview: Sidebar

Page 186: •Choosing the Right Cocoa Container View

Preview: Sidebar

Page 187: •Choosing the Right Cocoa Container View

Preview: Sidebar

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

Page 188: •Choosing the Right Cocoa Container View

Preview: Sidebar

Large number of pages

Selectable

Reorderable

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

Page 189: •Choosing the Right Cocoa Container View

Preview: Sidebar

Large number of pages

Selectable

Reorderable

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

Page 190: •Choosing the Right Cocoa Container View

Preview: Sidebar

Large number of pages

Selectable

Reorderable

Vertical layout

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

Page 191: •Choosing the Right Cocoa Container View

Preview: Sidebar

Large number of pages

Selectable

Reorderable

Vertical layout

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

—————————

Page 192: •Choosing the Right Cocoa Container View

Preview: Sidebar

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

—————————

Page 193: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

—————————

Page 194: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

—————————

——————————

—————————

Page 195: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

——————————

—————————

——————————

—————————

Page 196: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories NSOutlineView NSCollectionViewor

Page 197: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories NSOutlineView NSCollectionViewor

Page 198: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories NSOutlineView NSCollectionViewor

Page 199: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories

Reusable data source

NSOutlineView NSCollectionViewor

Page 200: •Choosing the Right Cocoa Container View

Preview: Sidebar

Need collapsable categories

Reusable data source

NSCollectionView

Page 201: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Page 202: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Page 203: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

Page 204: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Small number of account types

One dimensional, vertical layout

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser

Page 205: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Small number of account types

One dimensional, vertical layout

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser—————————

———————————

—————————————

—————————

Page 206: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Small number of account types

One dimensional, vertical layout

No selection: each item is a button

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser—————————

———————————

—————————————

—————————

Page 207: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Small number of account types

One dimensional, vertical layout

No selection: each item is a button

NSStackView

NSGridView

NSCollectionView

NSTableView

NSOutlineView

NSBrowser—————————

———————————

—————————————

—————————

—————————

Page 208: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Small number of account types

One dimensional, vertical layout

No selection: each item is a button

NSStackView

Page 209: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Small number of account types

One dimensional, vertical layout

No selection: each item is a button

NSTableView

Page 210: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

NSTableView

Page 211: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Historical NSTableView

Page 212: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Historical NSTableView

Page 213: •Choosing the Right Cocoa Container View

Internet Accounts: Account Types

Historical

Dynamic data

NSTableView

Page 214: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

Page 215: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

NSBrowser

Page 216: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

Size and shape of UI NSBrowser

Page 217: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

Size and shape of UI

Vertical space versus horizontal space

NSBrowser

Page 218: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

Size and shape of UI

Vertical space versus horizontal space

NSOutlineView

Page 219: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

Size and shape of UI

Vertical space versus horizontal space

NSOutlineView

Page 220: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

Size and shape of UI

Vertical space versus horizontal space

Interactive division

NSBrowser

Page 221: •Choosing the Right Cocoa Container View

Terminal: New Remote Connection

Size and shape of UI

Vertical space versus horizontal space

Interactive division

NSBrowser

Page 222: •Choosing the Right Cocoa Container View

User Preferences Finder

Page 223: •Choosing the Right Cocoa Container View

User Preferences Finder

Page 224: •Choosing the Right Cocoa Container View

Users preferences Image capture

Page 225: •Choosing the Right Cocoa Container View

Users preferences Image capture

Page 226: •Choosing the Right Cocoa Container View

Users preferences Image capture

Page 227: •Choosing the Right Cocoa Container View

Users preferences Image capture

Page 228: •Choosing the Right Cocoa Container View

Printers

Page 229: •Choosing the Right Cocoa Container View

Printers

NSTableView

Page 230: •Choosing the Right Cocoa Container View

Printers

NSTableView NSTabView

Page 231: •Choosing the Right Cocoa Container View

Printers

Page 232: •Choosing the Right Cocoa Container View

Printers

NSStackView

Page 233: •Choosing the Right Cocoa Container View

Printers

NSGridView

NSGridView

Page 234: •Choosing the Right Cocoa Container View

Printers

Page 235: •Choosing the Right Cocoa Container View

•Review

Page 236: •Choosing the Right Cocoa Container View

Ready-Made Views for Many Uses

Page 237: •Choosing the Right Cocoa Container View

Ready-Made Views for Many Uses

0

1

2

3

NSStackView

NSGridView

NSTableView

NSBrowser NSCollectionView

NSOutlineView

Page 238: •Choosing the Right Cocoa Container View

Learn More

NSStackView

• Guides: Auto Layout Cookbook • Sample Code: InfoBarStackView, Exhibition

NSGridView

Mysteries of Auto Layout, Part 1 WWDC15

What’s New in Auto Layout WWDC16

Page 239: •Choosing the Right Cocoa Container View

Learn More

NSTableView and NSOutlineView

• Guides: Table View Programming Guide for Mac, Outline View Programming Topics, Table View Programming Guide

• Sample Code: TableViewPlayground

NSBrowser • Guides: Browser Programming Topics • Sample Code: SimpleCocoaBrowser, ComplexBrowser

Crafting Modern Cocoa Apps WWDC16

Page 240: •Choosing the Right Cocoa Container View

Learn More

NSCollectionView • Sample Code: CocoaSlideCollection • Reference: NSCollectionView, NSCollectionViewLayout, and friends

What’s New in NSCollectionView WWDC15

Page 241: •Choosing the Right Cocoa Container View

More Informationhttps://developer.apple.com/wwdc17/218

Page 242: •Choosing the Right Cocoa Container View

Related Sessions

117

Advanced Touch Bar Grand Ballroom A Wednesday 5:10PM

Cocoa Development Tips Grand Ballroom B Friday 9:00AM

Page 243: •Choosing the Right Cocoa Container View

Labs

118

Cocoa Touch Bar Lab Technology Lab C Thu 9:00AM-11:00AM

Cocoa Lab Technology Lab B Fri 1:50PM-3:20PM

Page 244: •Choosing the Right Cocoa Container View