
Learn to integrate and display maps in a SwiftUI app, add markers and annotations, show user location, build near-me and restroom finder features, and use look around from iOS 17.
Prepare with Xcode 15 and iOS 17 to access the new MapKit features. The course expects prior Swift and UI framework experience and does not teach Swift or UI basics.
Download section-specific exercise files by clicking resources, or grab the final project from the last section; use the resources to verify your code if you get stuck.
Learn how to display an interactive map in a SwiftUI app with a single line of code using MapKit, explore standard, satellite, and hybrid views, and introduce annotations and markers.
Add and customize markers on a SwiftUI MapKit view using hard-coded coordinates like coffee and restaurant, then explore multiple markers, zoom, and the use of annotations.
Replace standard map markers with custom annotations in SwiftUI MapKit, crafting coffee and restaurant pins with SF Symbols icons and titles, and styling the annotation view with padding and colors.
Configure map styles with a segmented control and map options enum, applying standard, hybrid, and imagery styles via the map style modifier.
Create a location manager to display the user's location on the map. Use a shared manager and ensure the Info.plist location when in use usage description prompts permission.
Learn to zoom in on the user's location by updating a location manager, creating an MKCoordinateRegion, and binding it to the map using the observable macro on iOS 17.
Configure your SwiftUI MapKit app for always authorization and understand allow once versus allow in use prompts. Manage authorization status, request location, and prepare dynamic camera control for map interactions.
Dynamically set the map camera to coffee or restaurant by updating a region defined for each location, with two bottom buttons and animated transitions.
Discover how to add the map user location button, compass, and scale view in SwiftUI using the map controls modifier, with a few lines of code.
Learn to simulate locations in the iPhone simulator, using custom coordinates, preset routes like freeway drive, and GPS exchange to test locations worldwide.
Implement the CLLocationManager didChangeAuthorization event to fix a race condition, request when in use, and reliably obtain location updates in SwiftUI MapKit.
Build a near me app with SwiftUI MapKit that uses location permission, shows nearby coffee and gas with dynamic annotations, routes, and a Look around preview.
Create a SwiftUI interface that displays a map from MapKit and a bottom sheet search text field, configured with presentation detents (medium, large, 0.15 fraction) and interactive dismissal disabled.
Implement a singleton location manager conforming to CLLocationManagerDelegate and MapKit to track updates and derive an MKCoordinateRegion. Handle authorization changes, including not determined and denied, and request when in use.
Implement a location error as a localized error enum with cases like authorization denied and restricted, map core location errors to user messages, and publish them to the view.
Master SwiftUI MapKit by using a location manager to display the user's location with a blue dot via a user annotation and handle location access prompts.
Zoom into the user's location using on change on the location manager region, map camera position, and binding, with an equatable MKCoordinateRegion extension and configurable latitude delta and longitude delta.
Implement an async search using MKLocalSearch with a natural language query and a visible region to return nearby points of interest as MKMapItem, updating state and preparing for map display.
Display all map items as markers on the map by iterating map items. Use on map camera change to track the visible region and drive region-based searches.
Display map search results in a SwiftUI list by creating a reusable place view that shows the map item name and address, with future refactoring for distance.
Preview map item data in xcode previews by building a preview data structure, creating a placemark with coordinates and address keys, and returning an MK map item for display.
Implement a search options view under the search bar with targets like restaurants, hotels, coffee, and gas stations. Wire onSelected closures and a horizontal scroll view for tappable options.
Refactor the user interface by creating a reusable search bar view and a place list view, wired with bindings to reflect user input and prepare distance-based sorting.
Sort map items by distance to the user location using the location manager. Compute each item's distance from its placemark to the user and apply sorted results to display distances.
Create a distance calculation function in map utilities using CLLocation and the measurement API, then display the localized distance in place view via a measurement formatter extension.
Select a map item to show its details and switch the interface between list and detail modes using a display mode enum, updating on item change.
Implement the selected place detail view in SwiftUI MapKit, using a map item binding to the place view and a close button.
Bind the selected map item in the place list view to mirror marker selections on the map, updating highlights and details like Pier 39 when you search.
Implement a look around preview in iOS 17 maps by loading a look around scene from the selected map item and displaying street view in the detail view.
Learn to calculate automobile routes with MKDirections from a starting map item to a destination, return an MKRoute, and render a blue polyline on the map using async/await.
Hide look around preview when detent is small, and show it only for medium or large detents by binding the selected detent. Add action buttons for directions, call, and navigation.
Add two action buttons to the SelectedPlaceDetailView to call or take me there using Apple Maps, passing an MKMapItem from MapKit and unwrap it for display.
Wire the take me there button to open Apple Maps with a destination via MKMapItem, and test on simulator and real device for reliable navigation.
Implement a call button by extracting the map item’s phone number, removing non-digit characters, and creating a tel URL to dial on a real device.
Learn to build a location-based restroom finder that uses a json API to list nearby restrooms, show accessibility details like wheelchair accessible and unisex, and launch Apple Maps.
Explore how to consume the Refuge Restrooms API to fetch nearby restrooms using latitude and longitude, render them as map annotations, and navigate public endpoints for location-based searches.
Explore the starter project with a pre-implemented location manager and directions button, download the attached starter resources, and begin building the restroom model by mapping JSON data.
Create a swift restroom model as a decodable dto, map json fields (name, id, city, state, accessible, unisex, changingTable, latitude, longitude) with coding keys, and build an http client.
Implement a restroom http client to fetch nearby restrooms using a location endpoint with latitude and longitude, handle 200 responses, decode results, and inject the client via the SwiftUI environment.
Expose the http client as a custom environment value for global, testable access across views. Inject its value in the root view and fetch restrooms to display as map annotations.
Learn to display map annotations by using a shared location manager to fetch restrooms by location via a region-based URL and render markers with coordinates.
Learn to mock the HTTP client in a SwiftUI MapKit project by creating a protocol, building a mock restroom client, and loading sample data from a JSON for UI development.
Replace the marker with a customizable annotation on the map, using a title, coordinate, and content (such as a restroom symbol), and enable on-tap selection with a spring animation.
Enable a refresh button to load restrooms within the current visible region of a SwiftUI MapKit map, using a visible region bound to the camera.
Implement a restroom detail view in SwiftUI MapKit, showing the selected restroom in a sheet with region updates, location permission handling, and preview data to test the interface.
Develop and wire a SwiftUI amenities view and amenity subview to display restroom accessibility, unisex status, and changing tables, driven by restroom data from a restroom client.
Add an action button that uses a restroom-derived MK map item to launch Apple Maps for directions, by extending the restroom with a map item built from address data.
Examine the starter project to use the location manager for current location, request in-use authorization, and build circular regions like Cupertino village and Apple campus for monitoring with map overlays.
Create and visualize 50-meter regions around Cupertino village and Apple campus with MapCircle in SwiftUI MapKit, using indigo and pink overlays at 0.4 opacity, ready for region monitoring.
Start region monitoring with a location manager to watch circular geographic conditions like Cupertino village and Apple campus. Handle region events: satisfied, unsatisfied, unknown, and respond in the content view.
Capture the last monitor event from the location manager, derive the identifier (Apple campus or Cupertino village), and display a sheet with artwork when entering a monitored region.
Are you ready to harness the power of SwiftUI and MapKit to create captivating, location-aware applications? Whether you're a seasoned iOS developer or a newcomer to SwiftUI, our comprehensive course will guide you from novice to expert in no time.
In this course, you'll learn how to display maps seamlessly within your SwiftUI apps, establishing a strong location-based foundation. You'll also delve into the world of markers, pins, and custom annotations, turning your maps into interactive canvases for user engagement. Additionally, you'll have the opportunity to customize your maps with various styles, ensuring they align perfectly with your app's aesthetics.
Understanding and displaying the user's real-time location is a crucial skill, and we'll show you how to do it effortlessly. Zooming and panning features will allow you to focus on specific locations of interest, enhancing user experience.
But that's not all! We'll guide you through the development of a NearMe app, which will display nearby points of interest and intelligently sort them based on distance from the user's location. You'll also explore iOS 17's LookAroundPreview, staying at the forefront of technology integration. And to top it off, you'll learn to add routes and navigation, enabling users to easily find their way to selected destinations using Apple Maps.
This course will cover the creation of a "Restroom Finder App." This unique app will utilize a third-party JSON API to pinpoint and display all nearby restrooms in the user's current position. Each restroom will also be capable of displaying all the amenities available, enhancing user convenience and accessibility.
By enrolling in this course, you'll gain hands-on experience, master essential skills, and create real-world applications that utilize SwiftUI and MapKit. Whether you aspire to build location-based social networks, travel guides, or specialized apps like the Restroom Finder, this course will equip you to develop engaging and feature-rich experiences that captivate your users. Join us today and embark on your journey toward becoming a proficient SwiftUI and MapKit developer!