An elegant map-based location discovery app built with SwiftUI and modern MapCameraPosition API. Users can explore various places, view detailed previews, and transition smoothly across map regions — all within a beautiful SwiftUI interface powered by MVVM.
- Dynamic map rendering using
MapCameraPosition - Tap-to-reveal location preview cards
- Detailed sheet view for each location
- “Next” button to cycle through locations with animation
- Automatic region adjustment when switching location
- MVVM pattern with
@Publishedbindings - Fully tested with Swift Testing framework (Swift 6.1.2)
The project is covered with unit tests using the new Testing framework:
LocationTests.swift:- Validates that the id property is generated by concatenating name and cityName
- Confirms that two Location instances with the same id are considered equal (even if other fields different)
- Ensures inequality for Location instances with different id values
LocationsViewModelTests.swift:- Initializes with first location
- Toggles location list visibility
- Updates
mapCameraPositionwhen location changes - Transitions to next location
- Wraps to first location after reaching the end
| Technology | Description |
|---|---|
| Swift 6.1.2 | Language version |
| SwiftUI | Declarative UI framework |
| MVVM | Clean separation of concerns |
| Swift Testing | Native testing framework for Swift |
| MapKit | For map rendering and camera control |
| Map View | Location Detail |
|---|---|
![]() |
![]() |
To run unit tests:
- Open
TimeScapein Xcode - Press ⌘U or go to Product > Test
All tests are located in LocationTests.swift and LocationsViewModelTests.swift.
This project is open-sourced under the MIT License. See the LICENSE file for details.

