Question: Create an iOS application named LocationTasks using SwiftUI. The app should integrate MapKit and Core Location and include a form of persistent storage to save
Create an iOS application named "LocationTasks" using SwiftUI. The app should integrate MapKit and Core Location and include a form of persistent storage to save tasks locally. Users will be able to create, view, and manage tasks associated with specific locations. Tasks must persist between app sessions. Note: You are not permitted to import any thirdparty libraries via Swift Package Manager SPM
Components & Requirements:
Map View Home Screen
Navigation Setup:
Use a NavigationView with the map occupying the entire view. Set the navigation title to "LocationTasks". Add a "View Tasks" button in the topright corner of the navigation bar.
Map Features:
Display the user's current location as a marker on the map. Allow users to zoom and pan freely across the map. Implement a longpress gesture recognizer to add new tasks at specific locations. Display a marker on the map for each added task.
Task Creation Popup
Trigger:
Present a sheet popup when the user performs a longpress gesture on the map.
Input Fields:
Task Name Description Due Date use the Date data type
Validation:
Ensure all input fields contain at least one character; disable the "Confirm" button if not. Prevent users from setting a due date in the past; only future dates are allowed.
Actions:
Provide options to Confirm or Cancel task creation. Dismissing the popup should occur for both actions. Upon confirmation, save the task using persistent storage of your choice.
Task List View
Access:
Displayed when the user taps the "View Tasks" button in the navigation bar.
Display Details:
Task Name Description Due Date formatted as day, month, and year Latitude and Longitude of the task location
Functionality:
Allow users to swipe to delete tasks from the list. Ensure deleted tasks are removed from:
The task list The map when returning to it Persistent storage
Persistent Storage
Implement efficient methods for data storage, retrieval, and deletion to maintain task persistence across app sessions.
Coding Style
Evaluation Criteria:
Clean and organized code for both SwiftUI views and Swift logic. Logical directory structure and file organization. Appropriate and effective use of data structures.
Helpful Resources:
Implementing Long Press on MapKit:
SwiftUI MapKit Long Press Gesture
Enabling Row Deletion in a List:
Hacking with Swift: Deleting Rows from a List
Working with Dates and Extracting Components:
Hacking with Swift: Working with Dates
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
