CryptoTracker:


Uses the free version of the CoinGecko API.

No third-party libraries were used.

The following panels show some of the skills used to create this app.

GitHub

Networking:

  • Async/await
  • Generics
  • JSON parsing
  • Custom error handling
  • URLComponents, CodingKeys
  • Completion handlers
For additional practice, I initially implemented the network calls using completion handlers, then I refactored them using async/await.
I used generics so I could fetch different types of data objects with just one function.

Caching:

When the user navigates to the coin detail page, the coin’s data is cached which reduces network calls and data usage and improves memory and battery performance.

SwiftUI:

  • List view
  • Pagination
  • Task modifiers
  • Image caching
Data for 20 crypto coins are loaded at a time. When the user scrolls to the bottom of the page, the next 20 coins will be fetched and displayed.

Architecture, DI, Unit Testing:

I used MVVM for increased modularization to facilitate unit testing.

Initializer dependency injection and protocol-oriented DI further facilitated this modularization.

Implemented a Mock Service and mock data for various test cases using XCTAssert to ensure that data is being fetched, parsed, and formatted correctly.