Sitemap
Better Programming

Advice for programmers.

Member-only story

Creating Interactive Maps with Custom Markers Using SwiftUI in iOS 17

--

Photo by delfi de la Rua on Unsplash

With the release of iOS 17, Apple introduces an exciting enhancement to SwiftUI that revolutionizes how we add markers on maps.

With the new SwiftUI in iOS 17, you can easily customize markers to match your app’s aesthetic and branding, allowing seamless integration with your overall user interface.

This article describes how to add and style map markers in iOS 17 with SwiftUI. Keep in mind that this is still in beta and can change.

Add map markers

In iOS 17, SwiftUI offers developers a range of versatile methods to add map markers. Let’s check them out.

The default way

The default and most straightforward way to add a marker on the map in iOS 17 with SwiftUI is by passing a title and coordinate. With just these two essential pieces of information, developers can quickly create a marker that identifies a specific location on the map.

Marker("Latvian Freedom Monument", coordinate: .marker)

Showing with a custom image

--

--

Kristaps Grinbergs
Kristaps Grinbergs

Written by Kristaps Grinbergs

Blockchain, mobile and fullstack developer. Startup founder. Conference speaker. Mentor. Passionate about building products, sustainability and Web 3.0.

No responses yet