Top Banner
#WWDC17 © 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience Raj Ramamurthy, iOS System Experience Kyle Sluder, iOS System Experience Updating Your App For iOS 11 Session 204 App Frameworks
110

•Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Apr 27, 2018

Download

Documents

phamdien
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: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

#WWDC17

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

David Duncan, iOS System Experience Raj Ramamurthy, iOS System Experience Kyle Sluder, iOS System Experience

•Updating Your App For iOS 11 • Session 204

App Frameworks

Page 2: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

•Adopting new functionality in UIKit’s Bars •Managing margins and insets •New features of UIScrollView and UITableView

Page 3: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating
Page 4: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating
Page 5: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating
Page 6: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIBarItem

Page 7: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIBarItem

UIBarItem.landscapeImagePhone

Page 8: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIBarItem

UIBarItem.landscapeImagePhone

UIBarItem.largeContentSizeImage

Page 9: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIBarItem

UIBarItem.landscapeImagePhone

UIBarItem.largeContentSizeImage

What’s New in Accessibility Grand Ballroom A Wed 1:50PM

Page 10: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Controlling When Large Titles Display

Page 11: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Controlling When Large Titles Display

navigationBar.prefersLargeTitles = true

Page 12: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Controlling When Large Titles Display

navigationItem.largeTitleDisplayMode

Page 13: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Controlling When Large Titles Display

Automatic

UINavigationBar

Page 14: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Controlling When Large Titles Display

AutomaticNever

UINavigationBar

Page 15: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

AutomaticNeverAutomatic

UINavigationBar

Controlling When Large Titles Display

Page 16: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

AutomaticNeverAutomaticAlways

UINavigationBar

Controlling When Large Titles Display

Page 17: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

AutomaticNeverAutomaticAlwaysAutomatic

UINavigationBar

Controlling When Large Titles Display

Page 18: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Integrated UISearchController with Navigation

Page 19: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Integrated UISearchController with Navigation

navigationItem.searchController

Page 20: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Integrated UISearchController with Navigation

navigationItem.searchController

navigationItem.hidesSearchBarWhenScrolling

Page 21: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UINavigationController and Scroll Interactions

Page 22: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UINavigationController and Scroll Interactions

UINavigationController is responsible for some features

Page 23: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UINavigationController and Scroll Interactions

UINavigationController is responsible for some features• UISearchControllers• Refresh controls• Rubber banding

Page 24: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIToolbar and UINavigationBar— Layout

Page 25: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIToolbar and UINavigationBar— Layout

Extensive new Auto Layout support

Page 26: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIToolbar and UINavigationBar— Layout

Extensive new Auto Layout support

Keep your constraints inside your views

Page 27: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

UIToolbar and UINavigationBar— Layout

Extensive new Auto Layout support

Keep your constraints inside your views

“We assume you know what you’re doing”

Page 28: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Avoiding Zero-Sized Custom Views

Page 29: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Avoiding Zero-Sized Custom Views

UINavigationBar and UIToolbar provide position

Page 30: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Avoiding Zero-Sized Custom Views

UINavigationBar and UIToolbar provide position

You must provide size

Page 31: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Avoiding Zero-Sized Custom Views

UINavigationBar and UIToolbar provide position

You must provide size• Constraints for width and height

Page 32: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Avoiding Zero-Sized Custom Views

UINavigationBar and UIToolbar provide position

You must provide size• Constraints for width and height• Implement intrinsicContentSize

Page 33: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Avoiding Zero-Sized Custom Views

UINavigationBar and UIToolbar provide position

You must provide size• Constraints for width and height• Implement intrinsicContentSize• Connect your subviews via constraints

Page 34: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Raj Ramamurthy, iOS System Experience

•Demo

Page 35: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Kyle Sluder, iOS System Experience

•Margins and Insets

Page 36: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

Title

Page 37: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

Titlelayout margins

Page 38: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

TitlelayoutMarginsGuide

Page 39: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

TitlelayoutMargins

Page 40: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

TitlelayoutMargins

directionalLayoutMargins

Page 41: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

TitlelayoutMargins

directionalLayoutMargins

Page 42: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

Title

.trailing

.left

.leading

.right

Page 43: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Title

.trailing = 30

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

Page 44: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world,are the ones who do.

Title

.trailing = 30

Page 45: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

כותרת

.trailing = 30

Here’s to the crazy ones. The misfits. The rebels. The

troublemakers. The round pegs in the square holes. The ones who see

things differently. They’re not fond of rules. And they have no respect

for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you

can’t do is ignore them. Because they change things. They push the

human race forward. And while some may see them as the crazy

ones, we see genius. Because the people who are crazy enough to

think they can change the world, are the ones who do.

Page 46: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The

troublemakers. The round pegs in the square holes. The ones who see

things differently. They’re not fond of rules. And they have no respect

for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you

can’t do is ignore them. Because they change things. They push the

human race forward. And while some may see them as the crazy

ones, we see genius. Because the people who are crazy enough to

think they can change the world, are the ones who do.

כותרת

.left = 30

.trailing = 30

Page 47: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think

Title

layout margins

Page 48: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think

Title

layout margins

Page 49: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think

Title

minimum layout margins

Page 50: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think

systemMinimumLayoutMargins

Page 51: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the

Title

systemMinimumLayoutMargins

directionalLayoutMargins

Page 52: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the

Title

systemMinimumLayoutMargins

directionalLayoutMargins

class MyViewController: UIViewController { override func viewDidLoad() { viewRespectsSystemMinimumLayoutMargins = true // default

} }

Page 53: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the

Title

class MyViewController: UIViewController { override func viewDidLoad() { viewRespectsSystemMinimumLayoutMargins = false

} }

directionalLayoutMargins

Page 54: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the

Title

.trailing = 0.leading = 0

Page 55: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Title

NEW

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

.trailing = 0.leading = 0

Page 56: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating
Page 57: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

edgesForExtendedLayout

.top

.bottom

Page 58: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

edgesForExtendedLayout

.top

.bottom

Page 59: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

edgesForExtendedLayout

.top

.bottom

topLayoutGuide

bottomLayoutGuide

Page 60: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

edgesForExtendedLayout

.top

.bottom

topLayoutGuide

bottomLayoutGuide

Page 61: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

edgesForExtendedLayout

.top

.bottom

safe area

Page 62: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Safe Area

Describes area of view not occludedby ancestors

Available as insets or layout guide

Incorporates overscan compensation insets

NEW

Page 63: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Safe Area

Describes area of view not occludedby ancestors

Available as insets or layout guide

Incorporates overscan compensation insets

NEW

UIView.safeAreaInsets

Page 64: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Safe Area

Describes area of view not occludedby ancestors

Available as insets or layout guide

Incorporates overscan compensation insets

NEW

UIView.safeAreaLayoutGuide

Page 65: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Safe Area

Describes area of view not occludedby ancestors

Available as insets or layout guide

Incorporates overscan compensation insets

NEW

UIScreen.overscanCompensationInsets

Page 66: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Extending the Safe Area Insets

UIViewController.additionalSafeAreaInsets

UIView.safeAreaInsetsDidChange()

UIViewController.viewSafeAreaInsetsDidChange()

NEW

Page 67: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Extending the Safe Area Insets

UIViewController.additionalSafeAreaInsets

UIView.safeAreaInsetsDidChange()

UIViewController.viewSafeAreaInsetsDidChange()

NEW

Page 68: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

•Scroll Views

Page 69: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

Page 70: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

scroll view

Page 71: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

contentInset.top

Page 72: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

NEW

adjustedContentInset.top

Page 73: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

NEW

101 words • Modified today

adjustedContentInset.top

contentInset.top

Page 74: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

101 words • Modified today

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

Page 75: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

101 words • Modified today

TitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

NEW

frameLayoutGuide

Page 76: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

101 words • Modified today

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

NEW

TitleframeLayoutGuide

Page 1

Page 77: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

101 words • Modified today

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

NEW

TitleframeLayoutGuide

contentLayoutGuide

Page 1

Page 78: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

101 words • Modified today

NEWTitleHere’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.

contentLayoutGuidePage 1

frameLayoutGuide

Page 79: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

•Table Views

Page 80: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Self-Sizing by Default

Link on iOS 11, all estimated heights default to UITableViewAutomaticDimension

Headers, footers, and cells use self-sizing by default

iOS only—behavior is not changed on tvOS

Ensure all views have sufficient internal constraints

Return fixed sizes from delegate methods

NEW

Page 81: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Opting Out of New Behavior

Set table view estimated height properties to zero

Also disables self-sizing

override func viewDidLoad() { tableView.estimatedRowHeight = 0 tableView.estimatedSectionHeaderHeight = 0 tableView.estimatedSectionFooterHeight = 0 }

NEW

Page 82: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Opting Out of New Behavior

Set table view estimated height properties to zero

Also disables self-sizing

override func viewDidLoad() { tableView.estimatedRowHeight = 0 tableView.estimatedSectionHeaderHeight = 0 tableView.estimatedSectionFooterHeight = 0 }

NEW

Page 83: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 84: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

readable content guide

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 85: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

separatorInset

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 86: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

separatorInset.left = 30

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 87: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

separatorInset.left = 30

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 88: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

.left = 30

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 89: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

.left = 0 .right = 0

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 90: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

NEW

Table view cell

Table view cell

Table view cell

Table view cell

Table view cell

Page 91: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Table view cell

Page 92: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

separatorInset.left = 60

Table view cell

Page 93: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

separatorInset.left = 60

class MyViewController: UITableViewController { override func viewDidLoad() { tableView.separatorInsetReference = .fromCellEdges // default

} }

Table view cell

NEW

Page 94: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

separatorInset.left = 60

class MyViewController: UITableViewController { override func viewDidLoad() { tableView.separatorInsetReference = .fromAutomaticInsets

} }

Table view cell

NEW

Page 95: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Table Views and Safe Area

Automatic separator insets are relative to safe area insets

UITableViewCell and UITableViewHeaderFooterView inset their content view within the safe area

Use UITableViewHeaderFooterView for all headers and footers

Page 96: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Swipe Actions

New look-and-feel automatically for all table views

Supports full swipe-to-delete for iOS 11-linked apps

New features with API adoption • Images • Leading and trailing actions • Completion handler and cancellation

NEW

Page 97: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Swipe Actions

New look-and-feel automatically for all table views

Supports full swipe-to-delete for iOS 11-linked apps

New features with API adoption • Images • Leading and trailing actions • Completion handler and cancellation

NEW

Page 98: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Swipe Actions

New look-and-feel automatically for all table views

Supports full swipe-to-delete for iOS 11-linked apps

New features with API adoption • Images • Leading and trailing actions • Completion handler and cancellation

NEW

Page 99: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Swipe Actions

New look-and-feel automatically for all table views

Supports full swipe-to-delete for iOS 11-linked apps

New features with API adoption • Images • Leading and trailing actions • Completion handler and cancellation

NEW

Page 100: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Swipe Actions

New look-and-feel automatically for all table views

Supports full swipe-to-delete for iOS 11-linked apps

New features with API adoption • Images • Leading and trailing actions • Completion handler and cancellation

NEW

Page 101: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Swipe Actions

New look-and-feel automatically for all table views

Supports full swipe-to-delete for iOS 11-linked apps

New features with API adoption • Images • Leading and trailing actions • Completion handler and cancellation

NEW

Page 102: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Raj Ramamurthy, iOS System Experience

•Demo

Page 103: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Summary

Large navigation titles

New search experience

Layout margins

Safe area

Scroll views

Table views

Page 104: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Summary

Large navigation titles

New search experience

Layout margins

Safe area

Scroll views

Table views

Page 105: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Summary

Large navigation titles

New search experience

Layout margins

Safe area

Scroll views

Table views

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is

Title

Page 106: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Summary

Large navigation titles

New search experience

Layout margins

Safe area

Scroll views

Table views

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things.

Title101 words • Modified today

Page 107: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Summary

Large navigation titles

New search experience

Layout margins

Safe area

Scroll views

Table views

Table view cell

Table view cell

Table view cell

Table view cell

Reply

Page 108: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

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

Page 109: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating

Labs

Cocoa Touch Lab Technology Lab I Wed 3:10PM–6:00PM

UIKit and Collection View Lab Technology Lab B Thu 10:00AM–12:30PM

Page 110: •Updating Your App For iOS 11 - Apple Inc. · Redistribution or public display not permitted without written permission from Apple. David Duncan, iOS System Experience ... •Updating