SlideShare ist ein Scribd-Unternehmen logo
1 von 87
Downloaden Sie, um offline zu lesen
WWDC17 讀書會
QQ Shih
UIKit
2017/07/07
• What’s new in Cocoa Touch

• The keys to a better text input experience

• Introducing password autofill for apps

• Building apps with dynamic type

• Updating your app for iOS 11

• Advanced animations with UIKit
What’s new in Cocoa Touch
•
Drag and Drop
Drag and Drop
Enabling drags
let drag = UIDragInteraction(delegate: self)
iconView.addInteraction(drag)
UIDragInteractionDelegate
• Provide data for dragged item
• Customize lift animation
• Customize preview
Drag and Drop
Enabling drops
let drop = UIDropInteraction(delegate: self)
iconContainerView.addInteraction(drop)
UIDropInteractionDelegate
• Update UI as drag moves
• Receive data on drop
• Customize drop animation
Drag and Drop
Easy to adopt
Introducing Drag and Drop Hall 3 Tuesday 11:20AM
Mastering Drag and Drop Executive Ballroom Wednesday 11:00AM
Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM
Data Delivery with Drag and Drop Hall 2 Thursday 10:00AM
Built-in support
• TableView, CollectionView, TextView, TextField, WebView
Integration with UIPasteConfiguration
File management
Highly customizable
Access to local documents and cloud storage
Be sure to coordinate file access
• NSFileCoordinator or UIDocument
File Management
UIDocumentBrowserViewController
Building Great Document-Based Apps in iOS 11 Hall 2 Thursday 1:50PM
class UIDocumentBrowserViewController {
init(forOpeningFilesWithContentTypes: [String]?)
var delegate: UIDocumentBrowserViewControllerDelegate?
}
class UINavigationBar {
var prefersLargeTitle: Bool
}
Enabling Large Titles
class UINavigationItem {
var largeTitleDisplayMode: LargeTitleDisplayMode
}
Enabling Unified Search
class UINavigationItem {
var searchController: UISearchController?
}
Safe Area Insets
class UIView {
// auto layout
var safeAreaLayoutGuide: UILayoutGuide { get }
// manual layout
var safeAreaInsets: UIEdgeInsets { get }
func safeAreaInsetsDidChange()
}
class UIViewController {
func preferredScreenEdgesDeferringSystemGestures() -> UIRectEdge
}
Asset Catalogs
Colors and icons
class UIColor {
init?(named name: String)
}
Wide gamut color support
Wide gamut colors for icons
App thinning for icons
Asset Catalogs
PDF-backed images
Preserve vector data if
• Image used at multiple sizes
• Symbolic glyph that resizes with dynamic type
• Tab bar image
Localization Guide https://developer.apple.com/internationalization
The keys to a better
text input experiece
Text Input Context Identifier
class ConversationViewController: UITableViewController, UITextViewDelegate {
// ... other code ...
override var textInputContextIdentifier: String? {
// Returning some unique identifier here allows the keyboard to remember
// which language the user was typing in when they were last communicating
// with this person.
// It can be anything, as long as it's unique to each
// recipient (here we're just returning the name)
return self.conversation?.otherParticipant
}
// ... other code ...
}
Multilingual
Content Types for Password AutoFill
Introducing Password AutoFill for Apps WWDC 2017
NEW
Log In
UITextContentTypeUsername
UITextContentTypePassword
Smart Quote and Smart Dash
Hyphen: 1-dash - ➜ -
En dash: 2-dash - - ➜ –
Em dash: 3-dash - - - ➜ —
SF Hello "a" “a”
Helvetica Neue "a" “a”
Lucida Grande "a" “a”
Avenir "a" “a”
Myriad Set "a" “a”
NEW
New APIs in iOS 11
Selected text
documentIdentifier handle
Ability to query for full access
NEW
Full Access and Privacy
Value in not asking for full access
Communicating with your main app
Networking
Current location
Address book
Keyboard needs to work without it
Introducing password autofill
for apps
Make the QuickType Bar Appear
Use UITextContentType
Deploy content types to guarantee AutoFill is available
Can set in code or through Interface Builder
UITextContentType.username enables AutoFill for two-screen login
You can combine UITextContentType.username and UIKeyboardType.emailAddress
UITextContentType.password enables AutoFill for “revealed” passwords
Associated Domains File
Where to serve the file
https://example.com/.well-known/apple-app-site-association
https://example.com/apple-app-site-association
Building app with
dynamic type
Goals
Text is large enough for the user to read
Text is fully readable
App UI looks beautiful
Design For Everyone WWDC 2017
•
Scaling Font Sizes
Text Styles
Standard Sizes Accessibility Sizes
NEW
Text Styles NEW
Custom Fonts
label.font = UIFontMetrics.default.scaledFont(for: customFont)
NEW
•
Accommodating Large Text
.extraSmall .extraExtraExtraLarge
.large
traitCollection.preferredContentSizeCategory
UIApplication.shared.preferredContentSizeCategory
Make Layout Decisions Based on Text Size
if traitCollection.preferredContentSizeCategory.isAccessibilityCategory {
// Vertically stack
} else {
// Lay out side by side
}
NEW
Make Layout Decisions Based on Text Size
if traitCollection.preferredContentSizeCategory > .extraExtraLarge {
// Vertically stack
} else {
// Lay out side by side
}
NEW
Default Table View Behaviors in iOS 11
Standard table view cells adapt layout for Dynamic Type
Cell heights are based on their content
NEW
•
Images
Allow Images to Scale Up
Provide PDF at 1x scale
NEW
Allow Images to Scale Up NEW
Allow Bar Item Images to Scale Smoothly NEW
Updating your app for
iOS 11
UIBarItem
UIBarItem.landscapeImagePhone
UIBarItem.largeContentSizeImage
Manage margin and
insets
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
layoutMargins
directionalLayoutMargins
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
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
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
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
}
}
safeAreaInsets.bottom
safeAreaInsets.top
Safe Area
Describes area of view not occluded

by ancestors
Available as insets or layout guide
Incorporates overscan compensation insets
NEW
UIView.safeAreaInsets
Safe Area
Describes area of view not occluded

by ancestors
Available as insets or layout guide
Incorporates overscan compensation insets
NEW
UIView.safeAreaLayoutGuide
Safe Area
Describes area of view not occluded

by ancestors
Available as insets or layout guide
Incorporates overscan compensation insets
NEW
UIScreen.overscanCompensationInsets
Extending the Safe Area Insets
UIViewController.additionalSafeAreaInsets
UIView.safeAreaInsetsDidChange()
UIViewController.viewSafeAreaInsetsDidChange()
NEW
Title
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
101 words • Modified today
adjustedContentInset.top
contentInset.top
Safe Area Insets
class UIScrollView {
var contentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentBehavior
var adjustedContentInset: UIEdgeInsets { get }
}
101 words • Modified today
NEWTitle
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.
contentLayoutGuide
Page 1
frameLayoutGuide
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
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
separatorInset.left = 60
class MyViewController: UITableViewController {
override func viewDidLoad() {
tableView.separatorInsetReference = .fromCellEdges // default
}
}
Table view cell
NEW
separatorInset.left = 60
class MyViewController: UITableViewController {
override func viewDidLoad() {
tableView.separatorInsetReference = .fromAutomaticInsets
}
}
Table view cell
NEW
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
Advanced Animations
With UIKit
UIViewPropertyAnimator
Features
Custom timing
Interactive
Interruptible
Responsive
UIViewPropertyAnimator
let animator = UIViewPropertyAnimator(duration: 2.5, curve: .linear) {
circle.frame = circle.frame.offsetBy(dx: 100, dy: 0)
}
animator.startAnimation()
0 100x
Progress 1.0
0.0 1.0
0.5
0.5 Time
Ease In Ease Out
.easeIn
1.0
0.0 1.0
0.5
0.5
.easeOut
Timing Curves
UICubicTimingParameters(controlPoint1: CGPoint(x: 0.75, y: 0.1),
controlPoint2: CGPoint(x: 0.9, y: 0.25))
(0.75, 0.1)
(0.9, 0.25)
Custom Curves
Progress
Custom Ease In
1.0
0.0 1.0
0.5
0.5 Time
•
Interactively Animating
var animator: UIViewPropertyAnimator!
func handlePan(recognizer: UIPanGestureRecognizer) {
switch recognizer.state {
case .began:
animator = UIViewPropertyAnimator(duration: 1, curve: .easeOut, animations: {
circle.frame = circle.frame.offsetBy(dx: 100, dy: 0)
})
animator.pauseAnimation()
case .changed:
let translation = recognizer.translation(in: circle)
animator.fractionComplete = translation.x / 100
case .ended:
animator.continueAnimation(withTimingParameters: nil, durationFactor: 0)
}
}
1.0
0.0 1.0
0.5
0.5
animator.fractionComplete = translation.x / distance
Progress
Time
1.0
0.0 1.0
0.5
0.5
animator.fractionComplete = translation.x / distance
Progress
Time
1.0
0.0 1.0
0.5
0.5
Progress
Time
animator.continueAnimation(withTimingParameters: nil, durationFactor: 0)
running
true
fractionComplete
10%
animationState
.active
•
New Animator Behaviors
UIViewPropertyAnimator
New in iOS 11
var scrubsLinearly: Bool
var pausesOnCompletion: Bool
NEW
.Inactive
Animations finish
.pausesOnCompletion
.Active
Start / pause
animator.addObserver(self, forKeyPath: "running", options: [.new], context: nil)
Starting as Paused
let animator = UIViewPropertyAnimator(duration: 1, curve: .easeIn)
animator.startAnimation()
// ...
animator.addAnimations {
// will run immediately
circle.frame = circle.frame.offsetBy(dx: 100, dy: 0)
}
No escaping for animation blocks
NEW
.cornerRadius
Now animatable in UIKit
CALayer
var .cornerRadius: CGFloat
circle.clipsToBounds = true
UIViewPropertyAnimator(duration: 1, curve: .linear) {
circle.layer.cornerRadius = 12
}.startAnimation()
NEW
.maskedCorners
New in iOS 11
CALayer
var .maskedCorners: CACornerMask
circle.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
NEW
Thank You

Weitere ähnliche Inhalte

Andere mochten auch

KKBOX WWDC17 Xcode IDE - Hardy
KKBOX WWDC17  Xcode IDE - HardyKKBOX WWDC17  Xcode IDE - Hardy
KKBOX WWDC17 Xcode IDE - HardyLiyao Chen
 
KKBOX WWDC17 Xcode debug - Oliver
KKBOX WWDC17  Xcode debug - OliverKKBOX WWDC17  Xcode debug - Oliver
KKBOX WWDC17 Xcode debug - OliverLiyao Chen
 
KKBOX WWDC17 Security - Antony
KKBOX WWDC17 Security - AntonyKKBOX WWDC17 Security - Antony
KKBOX WWDC17 Security - AntonyLiyao Chen
 
KKBOX WWDC17 Airplay 2 - Dolphin
KKBOX WWDC17 Airplay 2 - DolphinKKBOX WWDC17 Airplay 2 - Dolphin
KKBOX WWDC17 Airplay 2 - DolphinLiyao Chen
 
KKBOX WWDC17 UIKit Drag and Drop - Mario
KKBOX WWDC17  UIKit Drag and Drop - MarioKKBOX WWDC17  UIKit Drag and Drop - Mario
KKBOX WWDC17 UIKit Drag and Drop - MarioLiyao Chen
 
KKBOX WWDC17 WatchOS - Dada
KKBOX WWDC17  WatchOS  - DadaKKBOX WWDC17  WatchOS  - Dada
KKBOX WWDC17 WatchOS - DadaLiyao Chen
 
KKBOX WWDC17 Notification and Autolayout - Jefferey
KKBOX WWDC17 Notification and Autolayout - JeffereyKKBOX WWDC17 Notification and Autolayout - Jefferey
KKBOX WWDC17 Notification and Autolayout - JeffereyLiyao Chen
 
KKBOX WWDC17 SiriKit and CoreSpotlight - Seraph
KKBOX WWDC17  SiriKit and CoreSpotlight - SeraphKKBOX WWDC17  SiriKit and CoreSpotlight - Seraph
KKBOX WWDC17 SiriKit and CoreSpotlight - SeraphLiyao Chen
 
KKBOX WWDC17 Swift and Foundation - Liyao
KKBOX WWDC17 Swift and Foundation - LiyaoKKBOX WWDC17 Swift and Foundation - Liyao
KKBOX WWDC17 Swift and Foundation - LiyaoLiyao Chen
 
KKBOX WWDC17 Core Image - Daniel Tien
KKBOX WWDC17 Core Image - Daniel TienKKBOX WWDC17 Core Image - Daniel Tien
KKBOX WWDC17 Core Image - Daniel TienLiyao Chen
 
KKBOX WWDC17 Performance and Testing - Hokila
KKBOX WWDC17 Performance and Testing - HokilaKKBOX WWDC17 Performance and Testing - Hokila
KKBOX WWDC17 Performance and Testing - HokilaLiyao Chen
 
專利入門
專利入門專利入門
專利入門Keico Tu
 

Andere mochten auch (12)

KKBOX WWDC17 Xcode IDE - Hardy
KKBOX WWDC17  Xcode IDE - HardyKKBOX WWDC17  Xcode IDE - Hardy
KKBOX WWDC17 Xcode IDE - Hardy
 
KKBOX WWDC17 Xcode debug - Oliver
KKBOX WWDC17  Xcode debug - OliverKKBOX WWDC17  Xcode debug - Oliver
KKBOX WWDC17 Xcode debug - Oliver
 
KKBOX WWDC17 Security - Antony
KKBOX WWDC17 Security - AntonyKKBOX WWDC17 Security - Antony
KKBOX WWDC17 Security - Antony
 
KKBOX WWDC17 Airplay 2 - Dolphin
KKBOX WWDC17 Airplay 2 - DolphinKKBOX WWDC17 Airplay 2 - Dolphin
KKBOX WWDC17 Airplay 2 - Dolphin
 
KKBOX WWDC17 UIKit Drag and Drop - Mario
KKBOX WWDC17  UIKit Drag and Drop - MarioKKBOX WWDC17  UIKit Drag and Drop - Mario
KKBOX WWDC17 UIKit Drag and Drop - Mario
 
KKBOX WWDC17 WatchOS - Dada
KKBOX WWDC17  WatchOS  - DadaKKBOX WWDC17  WatchOS  - Dada
KKBOX WWDC17 WatchOS - Dada
 
KKBOX WWDC17 Notification and Autolayout - Jefferey
KKBOX WWDC17 Notification and Autolayout - JeffereyKKBOX WWDC17 Notification and Autolayout - Jefferey
KKBOX WWDC17 Notification and Autolayout - Jefferey
 
KKBOX WWDC17 SiriKit and CoreSpotlight - Seraph
KKBOX WWDC17  SiriKit and CoreSpotlight - SeraphKKBOX WWDC17  SiriKit and CoreSpotlight - Seraph
KKBOX WWDC17 SiriKit and CoreSpotlight - Seraph
 
KKBOX WWDC17 Swift and Foundation - Liyao
KKBOX WWDC17 Swift and Foundation - LiyaoKKBOX WWDC17 Swift and Foundation - Liyao
KKBOX WWDC17 Swift and Foundation - Liyao
 
KKBOX WWDC17 Core Image - Daniel Tien
KKBOX WWDC17 Core Image - Daniel TienKKBOX WWDC17 Core Image - Daniel Tien
KKBOX WWDC17 Core Image - Daniel Tien
 
KKBOX WWDC17 Performance and Testing - Hokila
KKBOX WWDC17 Performance and Testing - HokilaKKBOX WWDC17 Performance and Testing - Hokila
KKBOX WWDC17 Performance and Testing - Hokila
 
專利入門
專利入門專利入門
專利入門
 

Ähnlich wie KKBOX WWDC17 UIKit - QQ

Re-Coding for Responsive Design: Tips, Tricks, and Traps
Re-Coding for Responsive Design: Tips, Tricks, and TrapsRe-Coding for Responsive Design: Tips, Tricks, and Traps
Re-Coding for Responsive Design: Tips, Tricks, and TrapsAliciaVirtue
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid drawinfo_zybotech
 
Inside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsInside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsHansol Lee
 
Titanium appcelerator sdk
Titanium appcelerator sdkTitanium appcelerator sdk
Titanium appcelerator sdkAlessio Ricco
 
Intro to Axure 7 - User Vision Breakfast Briefing
Intro to Axure 7 - User Vision Breakfast BriefingIntro to Axure 7 - User Vision Breakfast Briefing
Intro to Axure 7 - User Vision Breakfast BriefingStephen Denning
 
Axure 7 breakfast briefing slides
Axure 7 breakfast briefing slidesAxure 7 breakfast briefing slides
Axure 7 breakfast briefing slidesUser Vision
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergEvan Mullins
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMickey Mellen
 
Modular Web Design With Components
Modular Web Design With ComponentsModular Web Design With Components
Modular Web Design With ComponentsNadal Soler
 
Sayed-Minhal-Best Practice
Sayed-Minhal-Best PracticeSayed-Minhal-Best Practice
Sayed-Minhal-Best PracticeSayed Minhal
 
Sayed minhal-best practice
Sayed minhal-best practiceSayed minhal-best practice
Sayed minhal-best practiceSayed Minhal
 
The Future is Responsive
The Future is ResponsiveThe Future is Responsive
The Future is ResponsiveZURB
 
2007 Max Presentation - Creating Custom Flex Components
2007 Max Presentation - Creating Custom Flex Components2007 Max Presentation - Creating Custom Flex Components
2007 Max Presentation - Creating Custom Flex Componentsmichael.labriola
 
App design guide
App design guideApp design guide
App design guideJintin Lin
 
State of the inline debate
State of the inline debateState of the inline debate
State of the inline debateRasmus Skjoldan
 
ISC APPS FORMS BY SWAROOP
ISC APPS FORMS BY SWAROOP ISC APPS FORMS BY SWAROOP
ISC APPS FORMS BY SWAROOP Anil Kumar
 
User experience and interactions design
User experience and interactions design User experience and interactions design
User experience and interactions design Rakesh Jha
 
Proteus - android layout engine
Proteus - android layout engineProteus - android layout engine
Proteus - android layout engineKiran Kumar
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobilemowd8574
 

Ähnlich wie KKBOX WWDC17 UIKit - QQ (20)

Re-Coding for Responsive Design: Tips, Tricks, and Traps
Re-Coding for Responsive Design: Tips, Tricks, and TrapsRe-Coding for Responsive Design: Tips, Tricks, and Traps
Re-Coding for Responsive Design: Tips, Tricks, and Traps
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid draw
 
Inside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsInside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjects
 
Titanium appcelerator sdk
Titanium appcelerator sdkTitanium appcelerator sdk
Titanium appcelerator sdk
 
Intro to Axure 7 - User Vision Breakfast Briefing
Intro to Axure 7 - User Vision Breakfast BriefingIntro to Axure 7 - User Vision Breakfast Briefing
Intro to Axure 7 - User Vision Breakfast Briefing
 
Axure 7 breakfast briefing slides
Axure 7 breakfast briefing slidesAxure 7 breakfast briefing slides
Axure 7 breakfast briefing slides
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - Gutenberg
 
Meetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - GutenbergMeetup: The big change coming to WordPress in 2018 - Gutenberg
Meetup: The big change coming to WordPress in 2018 - Gutenberg
 
Modular Web Design With Components
Modular Web Design With ComponentsModular Web Design With Components
Modular Web Design With Components
 
iOS (7) Workshop
iOS (7) WorkshopiOS (7) Workshop
iOS (7) Workshop
 
Sayed-Minhal-Best Practice
Sayed-Minhal-Best PracticeSayed-Minhal-Best Practice
Sayed-Minhal-Best Practice
 
Sayed minhal-best practice
Sayed minhal-best practiceSayed minhal-best practice
Sayed minhal-best practice
 
The Future is Responsive
The Future is ResponsiveThe Future is Responsive
The Future is Responsive
 
2007 Max Presentation - Creating Custom Flex Components
2007 Max Presentation - Creating Custom Flex Components2007 Max Presentation - Creating Custom Flex Components
2007 Max Presentation - Creating Custom Flex Components
 
App design guide
App design guideApp design guide
App design guide
 
State of the inline debate
State of the inline debateState of the inline debate
State of the inline debate
 
ISC APPS FORMS BY SWAROOP
ISC APPS FORMS BY SWAROOP ISC APPS FORMS BY SWAROOP
ISC APPS FORMS BY SWAROOP
 
User experience and interactions design
User experience and interactions design User experience and interactions design
User experience and interactions design
 
Proteus - android layout engine
Proteus - android layout engineProteus - android layout engine
Proteus - android layout engine
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 

Mehr von Liyao Chen

Auto Layout part 1
Auto Layout part 1Auto Layout part 1
Auto Layout part 1Liyao Chen
 
iOS Unit testing II
iOS Unit testing IIiOS Unit testing II
iOS Unit testing IILiyao Chen
 
iOS Unit test getting stared
iOS Unit test getting starediOS Unit test getting stared
iOS Unit test getting staredLiyao Chen
 
Continuous Integration
Continuous  IntegrationContinuous  Integration
Continuous IntegrationLiyao Chen
 
iOS Design to Code - Code
iOS Design to Code - CodeiOS Design to Code - Code
iOS Design to Code - CodeLiyao Chen
 
iOS Design to Code - Design
iOS Design to Code - DesigniOS Design to Code - Design
iOS Design to Code - DesignLiyao Chen
 
Beta testing with CI
Beta testing with CIBeta testing with CI
Beta testing with CILiyao Chen
 
PTTHOT x IDEAS_HACKATHON 2014
PTTHOT x IDEAS_HACKATHON 2014PTTHOT x IDEAS_HACKATHON 2014
PTTHOT x IDEAS_HACKATHON 2014Liyao Chen
 
Windows 8 apps dev.整理及分享
Windows 8 apps dev.整理及分享Windows 8 apps dev.整理及分享
Windows 8 apps dev.整理及分享Liyao Chen
 

Mehr von Liyao Chen (10)

Auto Layout part 1
Auto Layout part 1Auto Layout part 1
Auto Layout part 1
 
iOS Unit testing II
iOS Unit testing IIiOS Unit testing II
iOS Unit testing II
 
iOS Unit test getting stared
iOS Unit test getting starediOS Unit test getting stared
iOS Unit test getting stared
 
Continuous Integration
Continuous  IntegrationContinuous  Integration
Continuous Integration
 
iOS Design to Code - Code
iOS Design to Code - CodeiOS Design to Code - Code
iOS Design to Code - Code
 
iOS Design to Code - Design
iOS Design to Code - DesigniOS Design to Code - Design
iOS Design to Code - Design
 
Beta testing with CI
Beta testing with CIBeta testing with CI
Beta testing with CI
 
PTTHOT x IDEAS_HACKATHON 2014
PTTHOT x IDEAS_HACKATHON 2014PTTHOT x IDEAS_HACKATHON 2014
PTTHOT x IDEAS_HACKATHON 2014
 
選擇
選擇選擇
選擇
 
Windows 8 apps dev.整理及分享
Windows 8 apps dev.整理及分享Windows 8 apps dev.整理及分享
Windows 8 apps dev.整理及分享
 

Kürzlich hochgeladen

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Kürzlich hochgeladen (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

KKBOX WWDC17 UIKit - QQ

  • 2. • What’s new in Cocoa Touch • The keys to a better text input experience • Introducing password autofill for apps • Building apps with dynamic type • Updating your app for iOS 11 • Advanced animations with UIKit
  • 3. What’s new in Cocoa Touch
  • 5. Drag and Drop Enabling drags let drag = UIDragInteraction(delegate: self) iconView.addInteraction(drag) UIDragInteractionDelegate • Provide data for dragged item • Customize lift animation • Customize preview
  • 6. Drag and Drop Enabling drops let drop = UIDropInteraction(delegate: self) iconContainerView.addInteraction(drop) UIDropInteractionDelegate • Update UI as drag moves • Receive data on drop • Customize drop animation
  • 7. Drag and Drop Easy to adopt Introducing Drag and Drop Hall 3 Tuesday 11:20AM Mastering Drag and Drop Executive Ballroom Wednesday 11:00AM Drag and Drop with Collection and Table View Hall 2 Thursday 9:00AM Data Delivery with Drag and Drop Hall 2 Thursday 10:00AM Built-in support • TableView, CollectionView, TextView, TextField, WebView Integration with UIPasteConfiguration
  • 9. Highly customizable Access to local documents and cloud storage Be sure to coordinate file access • NSFileCoordinator or UIDocument File Management UIDocumentBrowserViewController Building Great Document-Based Apps in iOS 11 Hall 2 Thursday 1:50PM class UIDocumentBrowserViewController { init(forOpeningFilesWithContentTypes: [String]?) var delegate: UIDocumentBrowserViewControllerDelegate? }
  • 10.
  • 11. class UINavigationBar { var prefersLargeTitle: Bool } Enabling Large Titles class UINavigationItem { var largeTitleDisplayMode: LargeTitleDisplayMode }
  • 12. Enabling Unified Search class UINavigationItem { var searchController: UISearchController? }
  • 13. Safe Area Insets class UIView { // auto layout var safeAreaLayoutGuide: UILayoutGuide { get } // manual layout var safeAreaInsets: UIEdgeInsets { get } func safeAreaInsetsDidChange() }
  • 14. class UIViewController { func preferredScreenEdgesDeferringSystemGestures() -> UIRectEdge }
  • 15. Asset Catalogs Colors and icons class UIColor { init?(named name: String) } Wide gamut color support Wide gamut colors for icons App thinning for icons
  • 16. Asset Catalogs PDF-backed images Preserve vector data if • Image used at multiple sizes • Symbolic glyph that resizes with dynamic type • Tab bar image
  • 18. The keys to a better text input experiece
  • 19. Text Input Context Identifier class ConversationViewController: UITableViewController, UITextViewDelegate { // ... other code ... override var textInputContextIdentifier: String? { // Returning some unique identifier here allows the keyboard to remember // which language the user was typing in when they were last communicating // with this person. // It can be anything, as long as it's unique to each // recipient (here we're just returning the name) return self.conversation?.otherParticipant } // ... other code ... } Multilingual
  • 20. Content Types for Password AutoFill Introducing Password AutoFill for Apps WWDC 2017 NEW Log In UITextContentTypeUsername UITextContentTypePassword
  • 21. Smart Quote and Smart Dash Hyphen: 1-dash - ➜ - En dash: 2-dash - - ➜ – Em dash: 3-dash - - - ➜ — SF Hello "a" “a” Helvetica Neue "a" “a” Lucida Grande "a" “a” Avenir "a" “a” Myriad Set "a" “a” NEW
  • 22. New APIs in iOS 11 Selected text documentIdentifier handle Ability to query for full access NEW
  • 23. Full Access and Privacy Value in not asking for full access Communicating with your main app Networking Current location Address book Keyboard needs to work without it
  • 25. Make the QuickType Bar Appear Use UITextContentType Deploy content types to guarantee AutoFill is available Can set in code or through Interface Builder UITextContentType.username enables AutoFill for two-screen login You can combine UITextContentType.username and UIKeyboardType.emailAddress UITextContentType.password enables AutoFill for “revealed” passwords
  • 26.
  • 27. Associated Domains File Where to serve the file https://example.com/.well-known/apple-app-site-association https://example.com/apple-app-site-association
  • 28.
  • 30. Goals Text is large enough for the user to read Text is fully readable App UI looks beautiful Design For Everyone WWDC 2017
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. Text Styles Standard Sizes Accessibility Sizes NEW
  • 38. Custom Fonts label.font = UIFontMetrics.default.scaledFont(for: customFont) NEW
  • 40.
  • 42. Make Layout Decisions Based on Text Size if traitCollection.preferredContentSizeCategory.isAccessibilityCategory { // Vertically stack } else { // Lay out side by side } NEW
  • 43. Make Layout Decisions Based on Text Size if traitCollection.preferredContentSizeCategory > .extraExtraLarge { // Vertically stack } else { // Lay out side by side } NEW
  • 44. Default Table View Behaviors in iOS 11 Standard table view cells adapt layout for Dynamic Type Cell heights are based on their content NEW
  • 46. Allow Images to Scale Up Provide PDF at 1x scale NEW
  • 47. Allow Images to Scale Up NEW
  • 48. Allow Bar Item Images to Scale Smoothly NEW
  • 49. Updating your app for iOS 11
  • 50.
  • 53. 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 layoutMargins directionalLayoutMargins
  • 54. 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
  • 55. 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
  • 56. 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
  • 57. 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 } }
  • 59. Safe Area Describes area of view not occluded
 by ancestors Available as insets or layout guide Incorporates overscan compensation insets NEW UIView.safeAreaInsets
  • 60. Safe Area Describes area of view not occluded
 by ancestors Available as insets or layout guide Incorporates overscan compensation insets NEW UIView.safeAreaLayoutGuide
  • 61. Safe Area Describes area of view not occluded
 by ancestors Available as insets or layout guide Incorporates overscan compensation insets NEW UIScreen.overscanCompensationInsets
  • 62. Extending the Safe Area Insets UIViewController.additionalSafeAreaInsets UIView.safeAreaInsetsDidChange() UIViewController.viewSafeAreaInsetsDidChange() NEW
  • 63. Title 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 101 words • Modified today adjustedContentInset.top contentInset.top
  • 64. Safe Area Insets class UIScrollView { var contentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentBehavior var adjustedContentInset: UIEdgeInsets { get } }
  • 65. 101 words • Modified today NEWTitle 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. contentLayoutGuide Page 1 frameLayoutGuide
  • 66. 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
  • 67. 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
  • 68. separatorInset.left = 60 class MyViewController: UITableViewController { override func viewDidLoad() { tableView.separatorInsetReference = .fromCellEdges // default } } Table view cell NEW
  • 69. separatorInset.left = 60 class MyViewController: UITableViewController { override func viewDidLoad() { tableView.separatorInsetReference = .fromAutomaticInsets } } Table view cell NEW
  • 70. 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
  • 73. UIViewPropertyAnimator let animator = UIViewPropertyAnimator(duration: 2.5, curve: .linear) { circle.frame = circle.frame.offsetBy(dx: 100, dy: 0) } animator.startAnimation() 0 100x
  • 74. Progress 1.0 0.0 1.0 0.5 0.5 Time Ease In Ease Out .easeIn 1.0 0.0 1.0 0.5 0.5 .easeOut Timing Curves
  • 75. UICubicTimingParameters(controlPoint1: CGPoint(x: 0.75, y: 0.1), controlPoint2: CGPoint(x: 0.9, y: 0.25)) (0.75, 0.1) (0.9, 0.25) Custom Curves Progress Custom Ease In 1.0 0.0 1.0 0.5 0.5 Time
  • 77. var animator: UIViewPropertyAnimator! func handlePan(recognizer: UIPanGestureRecognizer) { switch recognizer.state { case .began: animator = UIViewPropertyAnimator(duration: 1, curve: .easeOut, animations: { circle.frame = circle.frame.offsetBy(dx: 100, dy: 0) }) animator.pauseAnimation() case .changed: let translation = recognizer.translation(in: circle) animator.fractionComplete = translation.x / 100 case .ended: animator.continueAnimation(withTimingParameters: nil, durationFactor: 0) } }
  • 78. 1.0 0.0 1.0 0.5 0.5 animator.fractionComplete = translation.x / distance Progress Time
  • 79. 1.0 0.0 1.0 0.5 0.5 animator.fractionComplete = translation.x / distance Progress Time
  • 80. 1.0 0.0 1.0 0.5 0.5 Progress Time animator.continueAnimation(withTimingParameters: nil, durationFactor: 0) running true fractionComplete 10% animationState .active
  • 82. UIViewPropertyAnimator New in iOS 11 var scrubsLinearly: Bool var pausesOnCompletion: Bool NEW
  • 83. .Inactive Animations finish .pausesOnCompletion .Active Start / pause animator.addObserver(self, forKeyPath: "running", options: [.new], context: nil)
  • 84. Starting as Paused let animator = UIViewPropertyAnimator(duration: 1, curve: .easeIn) animator.startAnimation() // ... animator.addAnimations { // will run immediately circle.frame = circle.frame.offsetBy(dx: 100, dy: 0) } No escaping for animation blocks NEW
  • 85. .cornerRadius Now animatable in UIKit CALayer var .cornerRadius: CGFloat circle.clipsToBounds = true UIViewPropertyAnimator(duration: 1, curve: .linear) { circle.layer.cornerRadius = 12 }.startAnimation() NEW
  • 86. .maskedCorners New in iOS 11 CALayer var .maskedCorners: CACornerMask circle.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] NEW