Maps is an iOS app that allows users to search for cities and view their locations on a map using MapKit. It integrates with the Spott API from Rapid API to retrieve city data, including city name, population, and more.
- Home screen is a map containing a search option. As user types, pins for matching cities are rendered on the map. (See GET /places /autocomplete) Population in the UI should be formatted according to the users preference
- Tapping on a pin you should see City name, Population, Button to detail screen
- Details screen should fetch detail info (See GET /places/{id}) containing
- A map with only one pin (selected city)
- Search for cities using the Spott API.
- Display city locations on a Map with annotations.
- View city details, including name and population.
- Navigate to a detail screen for more information.
The City Maps app's user interface is entirely constructed programmatically in Swift code, without the use of .xib files or storyboards. This approach offers more flexibility and control over the app's design and layout. Here are some key points about the UI:
- No .xib files or storyboards are used in the project.
- The app's UI is created using Swift code, allowing for dynamic and responsive user interfaces.
- Autolayout and constraints are utilized to ensure the app's UI adapts to different device sizes and orientations.
- The UI code is well-documented for easier maintenance and modification.
-
Clone or download the project from this GitHub repository.
-
Open the project in Xcode.
-
open Maps/Maps/NetworkRequests/SpottApi.swift file and in place of "add api key" replace with the your api key you will get on Spott API Access
-
Build and run the app on your iOS device or simulator.
-
Enter a city name in the search bar and click the search button.
-
The app will display the city locations on the map with annotations.
-
Click on a location to view city details, including name and population.
-
Click the "Details" button to see a detailed view of the selected location on the map along with additional information.
- Swift
- MapKit
- Spott API (Rapid API)
- MVVM Architecture
If you have any questions or feedback, please feel free to contact the project maintainer:
- Email: [email protected]
Enjoy using the Maps app!