GitXplorerGitXplorer
L

SwiftUI-Guardian-Headlines

public
2 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
c93e32f278e1421f1574c266064f160a519af839

Make constants into enums.

LLemonSpike committed 3 years ago
Unverified
cfa16d1d397d75525c0e1f78700d057a267aa874

Update README.md

LLemonSpike committed 3 years ago
Unverified
0e59a0d25fcb6b62bd66492c632f652dc988f7a9

Clean up pbxproj and add comments for tests.

LLemonSpike committed 3 years ago
Unverified
513d19f36eb14351f0b07546167d9bc7a3192e05

Move Favourites List UI Tests into separate file.

LLemonSpike committed 3 years ago
Unverified
6c431b2d3ac954c1b44dd44940aa024ce9fa088a

Add API Key.

LLemonSpike committed 3 years ago
Unverified
0a85667981f3f2b7028861cc2fd6cb9d2d2ba4f3

More test refactoring.

LLemonSpike committed 3 years ago

README

The README file for this repository.

Headlines

About

I have been working on an app called "Headlines". The app uses the Guardian's news API to fetch financial articles and display them to the user. Users can favourite articles that they like, and also view a list of their favourite articles.

Priorities

  1. Fully functional, easy to use, stable and well-designed news reader. I tried to match Lloyds' colour scheme (Black, Green and White), in the app and the App Icon. I wanted to make the app friendly to new users with an onboarding alert.
  2. I added many Unit and UI tests with FIRST for business-critical features, dependency injection and using OHHTTPStubs for basic request stubbing in the UI Tests. Lots of tests make the app scalable and stable.
  3. I used SwiftUI because I find the code simpler to write and easy to read. SwiftUI is also going to become more used in production because the API is now more stable and Apple promotes the framework for new apps.
  4. I used MVC because I find the architecture maintainable. MVC is a well-tested and common stack in live apps. I added separate services for storage, and networking which I injected into the container HeadlinesModel. This makes the HeadlinesModel object smaller and more testable.
  5. I separated the codebase into different files and folders for the different components in MVC. This helps to navigate the project and also understand because each file has a single responsibility. I followed SOLID, OOP, and POP principles to write independent classes for each function. I used the protocols StorageService and NetworkService for mocking in tests.
  6. I used Realm for data persistence to improve the favouriting feature and to reduce networking load (performance). I imported Realm using SPM because Apple recommends using this solution for dependency management wherever possible. Even though Realm is a third-party dependency, I believe it's benefits of improved User Experience and performance outweigh the disadvantages.

I used Realm instead of Core Data for a demo app because it has a simpler API, is easier to setup and to use. Realm also provides faster queries, has better performance than Core Data, and has mocking support for testing. I avoided UserDefaults because the API is designed to only store small amounts of user preference data.

What I would have tackled next?

  1. Add local notifications to remind users to open the app.
  2. Test and improve accessibility support.
  3. Add more performance tests for JSON parsing.
  4. Add more unit tests for networking layer, in addition to existing UI tests.
  5. Improve the onboarding process with onboarding screens instead of an alert. Track whether an onboarding alert has been already displayed and disable it on the next run. I didn't have time to implement this.
  6. Add more features such as pull to refresh.

Screenshots