An iOS application that shows the top 100 coins from the CoinRanking API, demonstrates pagination (20 coins per page), swipe-to-favorite functionality, filtering, a detail screen with a chart, and a favorites screen.
- iOS 16.0+
- Xcode 14.0+
- Swift 5+
- Create or open a new SwiftUI iOS project in Xcode.
- Copy all of the provided files into your project structure.
- Replace
YOUR_COINRANKING_API_KEYinNetworkManager.swiftwith your CoinRanking API key. - Make sure your iOS Deployment Target is 16.0 or higher (required for SwiftUI Charts).
- Build and run the app on a simulator or device.
- Used
UserDefaultsto store favorite coin IDs. - The "detail" screen is a UIKit
UIViewControllerthat uses a SwiftUIPerformanceChartViewinside aUIHostingController. - Minimal error handling for demonstration purposes.
- Filtering is done in-memory after data is fetched.
- Basic
XCTestcoverage for networking and favorites logic.
- Pagination: Achieved by incrementing
offsetin 20-coin increments up to 100 coins total. - Hybrid UI: The main app uses SwiftUI (
@main struct), but coin lists and detail views use UIKit. We embed these UIKit controllers in SwiftUI usingUIViewControllerRepresentable. - Performance Chart: Used SwiftUI’s
Chartsframework. For older iOS versions, consider a 3rd-party chart library.
Below are some sample screenshots showcasing the Top 100 Coins screen and the Favorites screen:
Run the included unit tests (in CryptoAppTests.swift) via Product → Test or Cmd + U in Xcode.




