What s New in MapKit. App Frameworks #WWDC17. Fredrik Olsson

Similar documents
What s New in imessage Apps

Using and Extending the Xcode Source Editor

Mastering Drag and Drop

What s New in tvos 12

Create an App that will drop PushPins onto a map based on addresses that the user inputs.

Using Grouped Notifications

Touch Bar Fundamentals

What s New in watchos

Media and Gaming Accessibility

Monetize and Promote Your App with iad

ios Accessibility Developing for everyone Session 201 Ian Fisch ios Accessibility

Data Delivery with Drag and Drop

Building Mapping Apps for ios With Swift

Enhancing your apps for the next dimension of touch

What s New in ARKit 2

Advanced Notifications

Advanced Scrollviews and Touch Handling Techniques

What s New in Core Data?

imessage Apps and Stickers, Part 2

Implementing UI Designs in Interface Builder

Creating Audio Apps for watchos

Extending Your Apps with SiriKit

Modern User Interaction on ios

Mastering UIKit on tvos

Building for Voice with Siri Shortcuts

Getting the Most out of Playgrounds in Xcode

Mysteries of Auto Layout, Part 1

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011

What s New in Xcode App Signing

Building Apps with Dynamic Type

Developing Applications for ios

New Ways to Work with Workouts

Leveraging Touch Input on ios

What s New in NSCollectionView Session 225

Core Data Best Practices

Introducing Password AutoFill for Apps

Accessibility on ios. Developing for everyone. Frameworks #WWDC14. Session 210 Clare Kasemset ios Accessibility

Cocoa Touch Best Practices

What s New in Cocoa for macos

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010

What s New in tvos #WWDC16. App Frameworks. Session 206. Hans Kim tvos Engineer

Accessibility on OS X

Introduction to Siri Shortcuts

What s New in Testing

Why Using Location and Map? iphone Application Programming L12: Location and Maps. Why Using Location and Map? Determine where you are

Creating Complications with ClockKit Session 209

Understanding Undefined Behavior

Introducing Swift Playgrounds

Engineering for Testability

WatchKit In-Depth, Part 2

Getting the Most Out of HealthKit

Optimizing Swift Performance Session 409

Core ML in Depth. System Frameworks #WWDC17. Krishna Sridhar, Core ML Zach Nation, Core ML

Quick Interaction Techniques for watchos

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012

Getting Started with CareKit

What's New in UIKit Dynamics and Visual Effects Session 229

What s New in HomeKit

Finding Bugs Using Xcode Runtime Tools

Advances in AVFoundation Playback

Seamless Linking to Your App

Automatic Strong Passwords and Security Code AutoFill

What s New in Foundation for Swift Session 207

What s New in Core Bluetooth

CarPlay Audio and Navigation Apps

Enabling Your App for CarPlay

Improving your Existing Apps with Swift

ios Memory Deep Dive #WWDC18 Kyle Howarth, Software Engineer James Snee, Software Engineer Kris Markel, Software Engineer

CloudKit Tips And Tricks

Cocoa Development Tips

Vision Framework. Building on Core ML. Media #WWDC17. Brett Keating, Apple Manager Frank Doepke, He who wires things together

Managing Documents In Your ios Apps

What s New in Notifications

Building Visually Rich User Experiences

Thread Sanitizer and Static Analysis

Developing Applications for ios

Apple s new Swift language

Introducing PDFKit on ios

Building Faster in Xcode

Integrating Apps and Content with AR Quick Look

Localizing with Xcode 9

Announcements. Today s Topics

InterfaceBuilder and user interfaces

Introducing the Modern WebKit API

New UIKit Support for International User Interfaces

Validating HTTP Live Streams

Introducing On Demand Resources

What s New in SpriteKit

Covers ios 6. Bear Cahill. Includes 98 Techniques MANNING

EXERCISES RELATED TO ios PROGRAMMING

View Controller Advancements for ios8

Writing Energy Efficient Apps

CS ios. Extensions, Protocols, and Generics

Swift API Design Guidelines

Using Accelerate and simd

Introducing MusicKit. Media #WWDC17. Tim Parthemore, MusicKit Services Joel Lopes Da Silva, ios Music

Building Better Apps with Value Types in Swift Session 414

High Performance Auto Layout

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016

What s New in SiriKit

Transcription:

Session App Frameworks #WWDC17 What s New in MapKit 237 Fredrik Olsson 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

MKMapView.mapType.standard

MKMapView.mapType.standard

MKMapView.mapType NEW.standard.mutedStandard

open class MKUserTrackingBarButtonItem : UIBarButtonItem { } init(mapview: MKMapView)

open class MKUserTrackingBarButtonItem : UIBarButtonItem { } init(mapview: MKMapView)

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW open class MKCompassButton : UIView { init(mapview: MKMapView) compassvisibility: MKFeatureVisibility }

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW open class MKCompassButton : UIView { init(mapview: MKMapView) compassvisibility: MKFeatureVisibility }

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW open class MKCompassButton : UIView { init(mapview: MKMapView) compassvisibility: MKFeatureVisibility } public enum MKFeatureVisibility : Int { case adaptive case hidden case visible }

MKCompassButton.compassVisibility N N.hidden.visible.adaptive

MKCompassButton.compassVisibility N N.hidden.visible.adaptive

MKCompassButton.compassVisibility N N.hidden.visible.adaptive

MKCompassButton.compassVisibility N N.hidden.visible.adaptive

MKCompassButton.compassVisibility N N.hidden.visible.adaptive

MKCompassButton.compassVisibility N N.hidden.visible.adaptive

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW open class MKCompassButton : UIView { init(mapview: MKMapView) compassvisibility: MKFeatureVisibility } open class MKScaleView : UIView { init(mapview: MKMapView) scalevisibility: MKFeatureVisibility legendalignment: MKScaleViewAlignment }

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW open class MKCompassButton : UIView { init(mapview: MKMapView) compassvisibility: MKFeatureVisibility } open class MKScaleView : UIView { init(mapview: MKMapView) scalevisibility: MKFeatureVisibility legendalignment: MKScaleViewAlignment }

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW open class MKCompassButton : UIView { init(mapview: MKMapView) compassvisibility: MKFeatureVisibility } open class MKScaleView : UIView { init(mapview: MKMapView) scalevisibility: MKFeatureVisibility legendalignment: MKScaleViewAlignment }

open class MKUserTrackingButton : UIView { } init(mapview: MKMapView) NEW open class MKCompassButton : UIView { init(mapview: MKMapView) compassvisibility: MKFeatureVisibility } open class MKScaleView : UIView { init(mapview: MKMapView) scalevisibility: MKFeatureVisibility legendalignment: MKScaleViewAlignment }

MKScaleView.legendAlignment.leading.trailing

MKScaleView.legendAlignment.leading.trailing

MKScaleView.legendAlignment.leading.trailing

MKScaleView.legendAlignment.leading.trailing

MKScaleView.legendAlignment

MKPinAnnotationView

Normal Selected

Normal Selected

Normal Selected

MKMarkerAnnotationView NEW Normal Selected

MKMarkerAnnotationView NEW Normal Selected

MKMarkerAnnotationView NEW Normal Selected

Normal Selected

Normal Selected

MKMarkerAnnotationView Normal Selected Selected with Callout

open class MKMarkerAnnotationView : MKAnnotationView { open var titlevisibility: MKFeatureVisibility open var subtitlevisibility: MKFeatureVisibility @NSCopying open var markertintcolor: UIColor? @NSCopying open var glyphtintcolor: UIColor? open var glyphtext: String? @NSCopying open var glyphimage: UIImage? @NSCopying open var selectedglyphimage: UIImage? } open var animateswhenadded: Bool

open class MKMarkerAnnotationView : MKAnnotationView { open var titlevisibility: MKFeatureVisibility open var subtitlevisibility: MKFeatureVisibility @NSCopying open var markertintcolor: UIColor? @NSCopying open var glyphtintcolor: UIColor? open var glyphtext: String? @NSCopying open var glyphimage: UIImage? @NSCopying open var selectedglyphimage: UIImage? } open var animateswhenadded: Bool

MKMarkerAnnotationView.titleVisibility.hidden.hidden

MKMarkerAnnotationView.titleVisibility.visible.visibile

MKMarkerAnnotationView.titleVisibility.adaptive.adaptive

open class MKMarkerAnnotationView : MKAnnotationView { open var titlevisibility: MKFeatureVisibility open var subtitlevisibility: MKFeatureVisibility @NSCopying open var markertintcolor: UIColor? @NSCopying open var glyphtintcolor: UIColor? open var glyphtext: String? @NSCopying open var glyphimage: UIImage? @NSCopying open var selectedglyphimage: UIImage? } open var animateswhenadded: Bool

MKMarkerAnnotationView.markerTintColor nil UIColor.orange UIColor.init(named: mycolor )

MKMarkerAnnotationView.markerTintColor nil UIColor.orange UIColor.init(named: mycolor )

MKMarkerAnnotationView.markerTintColor nil UIColor.orange UIColor.init(named: mycolor )

MKMarkerAnnotationView.markerTintColor NEW nil UIColor.orange UIColor.init(named: mycolor )

open class MKMarkerAnnotationView : MKAnnotationView { open var titlevisibility: MKFeatureVisibility open var subtitlevisibility: MKFeatureVisibility @NSCopying open var markertintcolor: UIColor? @NSCopying open var glyphtintcolor: UIColor? open var glyphtext: String? @NSCopying open var glyphimage: UIImage? @NSCopying open var selectedglyphimage: UIImage? } open var animateswhenadded: Bool

MKMarkerAnnotationView.glyphText nil A+

MKMarkerAnnotationView.glyphText nil A+

MKMarkerAnnotationView.glyphText nil A+

MKMarkerAnnotationView.glyphText nil A+

MKMarkerAnnotationView.glyphText A+ Hello World

open class MKMarkerAnnotationView : MKAnnotationView { open var titlevisibility: MKFeatureVisibility open var subtitlevisibility: MKFeatureVisibility @NSCopying open var markertintcolor: UIColor? @NSCopying open var glyphtintcolor: UIColor? open var glyphtext: String? @NSCopying open var glyphimage: UIImage? @NSCopying open var selectedglyphimage: UIImage? } open var animateswhenadded: Bool

MKMarkerAnnotationView.glyphImage

MKMarkerAnnotationView.glyphImage 40x40 pts

MKMarkerAnnotationView.glyphImage 40x40 pts

MKMarkerAnnotationView.glyphImage 20x20 pts 40x40 pts

MKMarkerAnnotationView.glyphImage 20x20 pts 40x40 pts

MKMarkerAnnotationView.glyphImage 20x20 pts 40x40 pts

.glyphimage.selectedglyphimage 20x20 pts 40x40 pts

open class MKAnnotationView : UIView { NEW open var displaypriority: MKFeatureDisplayPriority }

open class MKAnnotationView : UIView { NEW open var displaypriority: MKFeatureDisplayPriority } extension MKFeatureDisplayPriority { public static let required: MKFeatureDisplayPriority! public static let defaulthigh: MKFeatureDisplayPriority! public static let defaultlow: MKFeatureDisplayPriority! }

MKAnnotationView.displayPriority.required.defaultHigh.defaultLow

MKAnnotationView.displayPriority.required.defaultHigh.defaultLow

MKAnnotationView.displayPriority.required.defaultHigh.defaultLow

MKAnnotationView.displayPriority.required 0..999

open class MKAnnotationView : UIView { NEW open var clusteringidentifier: String? }

MKAnnotationView.clusteringIdentifier nil identifier

MKAnnotationView.clusteringIdentifier nil identifier

MKAnnotationView.clusteringIdentifier nil identifier

Demo Clustering and display priority

func mapview(_ mapview: MKMapView, viewfor annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { return nil } else { var view = mapview.dequeuereusableannotationview(withidentifier: "identifier") // setup the view return view } }

func mapview(_ mapview: MKMapView, viewfor annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { return nil } else { var view = mapview.dequeuereusableannotationview(withidentifier: "identifier") // setup the view return view } }

func mapview(_ mapview: MKMapView, viewfor annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { return nil } else { var view = mapview.dequeuereusableannotationview(withidentifier: "identifier") // setup the view return view } }

func mapview(_ mapview: MKMapView, viewfor annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { return nil } else if let cluster = annotation as? MKClusterAnnotation { var view = mapview.dequeuereusableannotationview(withidentifier: "cluster") // setup the view return view } else { var view = mapview.dequeuereusableannotationview(withidentifier: "bike") // setup the view return view } 3 } NEW

open class MKClusterAnnotation : NSObject, MKAnnotation { NEW open var title: String? open var subtitle: String? } open var memberannotations: [MKAnnotation] { get } public init(memberannotations: [MKAnnotation]) 3

open class MKClusterAnnotation : NSObject, MKAnnotation { NEW open var title: String? open var subtitle: String? } open var memberannotations: [MKAnnotation] { get } public init(memberannotations: [MKAnnotation]) 3

open class MKClusterAnnotation : NSObject, MKAnnotation { NEW open var title: String? open var subtitle: String? } open var memberannotations: [MKAnnotation] { get } public init(memberannotations: [MKAnnotation]) 3

func mapview(_ mapview: MKMapView, viewfor annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKUserLocation { return nil } else if let cluster = annotation as? MKClusterAnnotation { var view = mapview.dequeuereusableannotationview(withidentifier: "cluster") // setup the view return view } else { var view = mapview.dequeuereusableannotationview(withidentifier: "bike") // setup the view return view } } 3 NEW

2 3

2 3

2 3

open class MKAnnotationView : UIView { NEW open var collisionmode: MKAnnotationViewCollisionMode }

MKAnnotationView.collisionMode 3 2.rectangle

MKAnnotationView.collisionMode 3 2.circle

MKAnnotationView.collisionMode 2 3.circle

MKAnnotationView.collisionMode 3 2.rectangle

MKAnnotationView.collisionMode 3 2.circle

1 2

1 2

1 2

1 2

MKAnnotationView.collisionMode 1 2

MKAnnotationView.collisionMode 1 2.cirleInBottomLeftWithFivePointsVerticalOutset

MKAnnotationView.collisionMode 1 2

open class UIView : NSObject { @available(ios 6.0, *) open var alignmentrectinsets: UIEdgeInsets { get } } 2

class FlagAnnotationView : MKAnnotationView { } override var alignmentrectinsets: UIEdgeInsets { } return UIEdgeInsetsMake(50, 0, -5, 20) 2

class FlagAnnotationView : MKAnnotationView { } override var alignmentrectinsets: UIEdgeInsets { } return UIEdgeInsetsMake(50, 0, -5, 20) 2

class FlagAnnotationView : MKAnnotationView { } override var alignmentrectinsets: UIEdgeInsets { } return UIEdgeInsetsMake(50, 0, -5, 20) 2

class FlagAnnotationView : MKAnnotationView { } override var alignmentrectinsets: UIEdgeInsets { } return UIEdgeInsetsMake(50, 0, -5, 20) 2

class FlagAnnotationView : MKAnnotationView { } override var alignmentrectinsets: UIEdgeInsets { } return UIEdgeInsetsMake(50, 0, -5, 20) 2

class FlagAnnotationView : MKAnnotationView { } override var alignmentrectinsets: UIEdgeInsets { } return UIEdgeInsetsMake(50, 0, -5, 20) 2

class FlagAnnotationView : MKAnnotationView { } override var alignmentrectinsets: UIEdgeInsets { } return UIEdgeInsetsMake(50, 0, -5, 20) 2

1 2

1 2

Demo Custom annotation views

Summary Muted Standard Map Type New Map Controls Marker Annotation View Annotation Display Priority Annotation Clustering

Summary Muted Standard Map Type New Map Controls Marker Annotation View Annotation Display Priority Annotation Clustering

Summary Muted Standard Map Type New Map Controls Marker Annotation View Annotation Display Priority Annotation Clustering

Summary Muted Standard Map Type New Map Controls Marker Annotation View Annotation Display Priority Annotation Clustering

Summary Muted Standard Map Type New Map Controls Marker Annotation View Annotation Display Priority Annotation Clustering

More Information https://developer.apple.com/wwdc17/237

Related Sessions What s New in Location Technologies WWDC 2017 What s New in MapKit WWDC 2015

Labs Location and Mapping Technologies Lab Technology Lab K Fri 10:00AM 12:00PM