ToDo:To Align with iOSInterviewQuestions/Swift/MVVMDemo
Source Code: SwiftUI Demo
Description:
Your task is to create a native iOS application using Swift, SwiftUI, UIKit, WebKit, and Combine. The application should provide an interactive interface for browsing and viewing posts, comments, and associated user details from a JSONPlaceholder API.
Requirements:
-
Use the REST API available at
https://jsonplaceholder.typicode.com. The API contains a/posts,/comments, and/usersendpoints that return a list of posts, comments, and user information, respectively. -
The application should display the list of posts on the initial screen. Each item on the list should display the post's title and a snippet of the body.
-
When a post is selected from the list, navigate to a detail screen. This screen should display the post's full body, fetch and display the associated comments from the
/commentsendpoint using the post's id. Display each comment's name, email, and body. -
On the post detail screen, fetch the user's information from the
/usersendpoint using the post'suserId. The user data can be fetched using the API pattern:https://jsonplaceholder.typicode.com/users?id={userId}. Display user's name, email, a MapKit view showing the user's location based on theaddress.geodata, and a WebView/WebKit view displaying the user's website. -
Implement local data storage using Core Data or Realm to cache the fetched data for offline use.
-
Add an option for the user to mark a post as a favorite. The favorited posts should be stored locally using Core Data or Realm and should be easily distinguishable in the posts list.
-
Use Combine for data binding and data observing in your app.
-
Include unit tests to ensure the critical aspects of your application are working as expected.
Bonus Points:
-
Add a search functionality to the posts list that allows users to search for posts by title.
-
Implement pull-to-refresh functionality on the posts list screen to refresh the data.
-
Ensure the application works well on different devices and screen sizes, including iPads.
-
Use SwiftUI’s new async/await features to manage the API calls.
Evaluation:
You will be evaluated based on:
- Code quality, architecture, and organization.
- Correct and efficient use of Swift, SwiftUI, UIKit, MapKit, WebKit, Combine, and other iOS frameworks.
- Implementation of the requirements and bonus points.
- Handling of edge cases and application stability.
- UI/UX design and responsiveness.
- Adequate and meaningful unit tests.
Please submit your code as a Git repository (GitHub, BitBucket, GitLab, etc.), ensuring that your repository includes all your source code and any instructions needed to build and run your application.
Search functionality on the posts list and comments list.


