1. Homepage
  2. Programming
  3. iOS Mobile Application Development: MetUCD

iOS Mobile Application Development: MetUCD

Engage in a Conversation
UCDMobile Application DevelopmentiOSSwiftMetUCD

Objectives
CourseNana.COM

In this SwiftUl project assignment, you will create a mobile app called MetUCD that allows users to check the current weather for a location of their choice by dropping a pin on a map. The primary objectives of this assignment are to: CourseNana.COM

   Implement a user-friendly interface that enables users to interact with a map and drop pins on locations they want to check the weather for. CourseNana.COM

   Use the OpenWeather JSON API to fetch real-time weather data for the selected location, including temperature, humidity, wind speed and weather conditions. CourseNana.COM

Implement the MVVM design pattern, ensuring model remains UI agnostic. CourseNana.COM

   Display the retrieved weather data in an informative and visually engaging manner. CourseNana.COM

Ensure that the app provides an appealing user experience by presenting weather data in an easy-to-understand format, possibly including graphical elements like icons to represent weather conditions41. CourseNana.COM

   Allow users to view additional information for the selected location, such as a 5-day 3-hour forecast and the air quality index as a graph. CourseNana.COM

   Implement error handling to gracefully handle cases where the API requests fail or the user provides invalid location data. CourseNana.COM

Important Notes: CourseNana.COM

   Before starting the project, sign up for an OpenWeather API account to obtain an API key (https : //home . openweathermap . org/users/sign_up). You will need this API key to make requests to the OpenWeather API. CourseNana.COM

   Familiarise yourself with the free tier of the OpenWeather API by studying and testing the following endpoints: CourseNana.COM

·  Current WeatherAPI: https: //api . openweathermap. org/data/ 2 . 5/weather CourseNana.COM

·  5-Day 3-Hour Forecast API: https : //api.openweathermap.org/data/ 2.5/forecast CourseNana.COM

·  Air Pollution API: https: //api. openweathermap . org/data/ 2 .5/air_pollution/forecast CourseNana.COM

'Install SF Symbols (https : //developer. apple . com/sf—symbols/) CourseNana.COM

Usage: pick some SVG symbol e.g. thermometer and in Swift Image (systemName: "thermometer") CourseNana.COM


CourseNana.COM

Figure 1: MetCD App — Screenshots of Part 1 CourseNana.COM

• Geocoding API: https: //api.openweathermap.org/geo/1.0/direct CourseNana.COM

It's important to understand how to construct API requests, handle responses, and parse the data you receive from these endpoints. CourseNana.COM

   Pay attention to the design and user experience aspects of the app, as creating an engaging and visually appealing interface is a key requirement. CourseNana.COM

   While implementing the app, consider error handling and responsiveness to ensure a seamless user experience using ( async) when appropriate. CourseNana.COM

Part 1 CourseNana.COM

The objective of this first part is to create a functional data model and a basic user interface. Users should be able to input a location in text format (e.g. "Dublin, I E ") , and the app should fetch weather data from the OpenWeather API based on this input. The fetched weather data, including information such as temperature, humidity, wind speed, and weather conditions, should be presented in a visually appealing manner within a scrollable table view divided into multiple sections (Figure J. Additionally, error handling should be implemented to handle API request failures and invalid inputs, ensuring a smooth and user-friendly experience. This phase lays the foundation for the subsequent development of the app's features and user interactions. CourseNana.COM

Here are the rough steps involved CourseNana.COM

1. Create a New SwiftUl Project: CourseNana.COM

   Open Xcode. CourseNana.COM

   Create a new SwiftUl project named MetUCD. CourseNana.COM

2. Define the Data Model: CourseNana.COM

   Create Swift structs to represent the weather, pollution and forecast data models. Include suitable properties such as location, temperature, humidity, wind speed, and weather conditions. Ensure to embrace the Coda ble protocol. CourseNana.COM


CourseNana.COM

3. Design the User Interface: CourseNana.COM

    Use SwiftUl views such as Form and VStack to design the user interface. CourseNana.COM

    Include a TextField to allow users to input the location (e.g., "Dublin IL"). CourseNana.COM

  Trigger the weather data fetching based on the entered location when user's tap on Return key of the keyboard. CourseNana.COM

  Tapping on the search TextField, should show the keyboard and automatically clear text input and view. CourseNana.COM

   Design the layout to have multiple sections for the user interface to separate different elements (e.g., input, geocoding info, weather data, pollution...). CourseNana.COM

4. Weather Data Fetching and Error Handling: CourseNana.COM

   Implement the logic to fetch weather data from the OpenWeather API based on the user's input location. CourseNana.COM

   Use Swift's asynchronous networking capabilities (e.g., URLSession) to make an API request. CourseNana.COM

   Handle the API response and parse the JSON data into your defined data model. CourseNana.COM

   Implement error handling to gracefully handle cases where the API requests fail or the user enters invalid location data. CourseNana.COM

   Display informative error messages to the user when necessary. CourseNana.COM

5. Display Data: CourseNana.COM

    Use a SwiftUl List, Section, ForEach, VStack and HStack to create a scrollable table view. CourseNana.COM

   Organise the weather and pollution data into suitable sections within the table view, such as current weather, forecast, and additional information sections such as air quality and geolocalisation information (see Figure 1) CourseNana.COM

6. Refinement and User Experience: CourseNana.COM

   Refine the user interface to make it more engaging and visually appealing using SF Symbols and colouring appropriately. CourseNana.COM

   Provide a clear and user-friendly way to view forecast data, possibly with icons or visual representations of weather conditions. CourseNana.COM

    Ensure that the user experience is smooth and intuitive. 7 Documentation: CourseNana.COM

  Add appropriate comments to your code and document your report with code snippets to explain functionality and purpose. CourseNana.COM

   Organise your project and code structure for clarity. Use 3 files called WeatherDataModel, WeatherViewModel and WeatherView so that one can identify the MVVM design pattern immediatly. CourseNana.COM

Build and Test CourseNana.COM

For simplicity, use the 10S Simulator. Your app should build and run with no warnings with a UI similar to Figure 1. Test the app by entering various locations and ensuring that weather data is fetched and dis­played correctly. Debug any issues or errors in the code or user interface. CourseNana.COM


CourseNana.COM

Part 2 CourseNana.COM

In this second part, you will improve the application by incorporating an interactive map as the user's method for selecting the desired location to retrieve weather data. Tapping on a home location button should reset the map view point to the current user location using a location manager (cf. Figure 2a—b). An optional search textfield may be used to center the map to some location (cf. Figure 2c—d).  Tapping on the weather panel will slide a modal table view displaying geocoding information, weather data, pollution conditions, as well as a forecast and air quality graph (cf. Figure 2e—f). You will use MapKit, CoreLocation, and Swift Charts to design an engaging UI. The app should always open at the current user location. CourseNana.COM

Here are the rough steps involved CourseNana.COM

1. ViewModel and Location Manager: CourseNana.COM

Modify your WeatherViewModel so that to manage the interaction between the user interface and the data. Integrate a location manager to track the user's current location and visible location of the map. CourseNana.COM

Notes: CourseNana.COM

·    Study the documentation of CoreLocation. CourseNana.COM

·    Make your observable WeatherViewModel a subclass of NSObject and conforms to the protocol CLLocat ionManagerDelegate to be notified of location updates. CourseNana.COM

·    Add a location manager to report the user's current location. CourseNana.COM

·    Ensure the ViewModel updates its weather data, pollution and forecast appropriately based on the map's position. CourseNana.COM

·    You may also need to create some additional computed properties to expose some suitable and simple data structures to your SwiftUl Views (in particular for rendering forecast data). CourseNana.COM

·    Some privacy permissions must be set for CoreLocation access. Add the required privacy key "location when in use" to the target app to request user permission for accessing location data. CourseNana.COM

2. Design of the Map Interface: CourseNana.COM

Redesign the user interface to include a map that is initially centered on the user's current location. Allow users to drop a marker pin on the map by tapping. The pin should display the current CourseNana.COM

temperature at that location. Overlay a small view at the bottom of the map with essential location details and basic weather information. Don't forget to handle the safe-area of the map view so that user map interaction is disabled under the widget view. CourseNana.COM

·    Use the SwiftUl view Map to display a map (cf. Apple documentation). CourseNana.COM

·    Show/update the overlay widget when the user drops a pin or changes position. CourseNana.COM

·    Create a dynamic marker that updates its position based on the map's current position. CourseNana.COM

·    Enhance the map interface to include a location button to center the map on the current user location. CourseNana.COM

·    Optionally add a search button that expands to a textfield and used to the map region from the the specified text (cf. Figure 2c). CourseNana.COM

2https://developer.apple.com/documentation/corelocation/ 3https://developer.apple.com/documentation/mapkit/map https://developer.apple.com/videos/play/mdc2023/10043 CourseNana.COM


CourseNana.COM

CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UCD代写,Mobile Application Development代写,iOS代写,Swift代写,MetUCD代写,UCD代编,Mobile Application Development代编,iOS代编,Swift代编,MetUCD代编,UCD代考,Mobile Application Development代考,iOS代考,Swift代考,MetUCD代考,UCDhelp,Mobile Application Developmenthelp,iOShelp,Swifthelp,MetUCDhelp,UCD作业代写,Mobile Application Development作业代写,iOS作业代写,Swift作业代写,MetUCD作业代写,UCD编程代写,Mobile Application Development编程代写,iOS编程代写,Swift编程代写,MetUCD编程代写,UCDprogramming help,Mobile Application Developmentprogramming help,iOSprogramming help,Swiftprogramming help,MetUCDprogramming help,UCDassignment help,Mobile Application Developmentassignment help,iOSassignment help,Swiftassignment help,MetUCDassignment help,UCDsolution,Mobile Application Developmentsolution,iOSsolution,Swiftsolution,MetUCDsolution,