Project Description:.
Is an iOS application that fetches data from the CointRanking API and displays a list of the top 100 cryptocurrency coins paginated, showing 20 characters per page.
The application successfully implements a three-screen architecture using MVVM and UIKit/SwiftUI interoperability.
-
Coin List (Home Screen):
- Fetches and displays top 100 cryptocurrencies.
- Pagination and filtering implemented.
- UI: Uses a
UITableViewwith embedded SwiftUICoinListRowcards. - Visualization: Displays a sparkline chart (24H data) using
SwiftUIChartslibrary. - Action: Swipe-to-Favorite functionality.
-
Coin Details:
- Displays static data (price, rank) and historical chart data.
- Uses a SwiftUI header for the main metrics.
- Allows time period filtering (24H, 7D, 30D, 1Y).
- Hides the tab bar for a focused view.
-
Favorites/Watchlist:
- Persists user-selected favorite coins using
UserDefaults. - Synchronized across the entire app via
NotificationCenter.
- Persists user-selected favorite coins using
-
Error Handling: Implemented a centralized
AppErrormodel and Combine subscriptions in all View Controllers to display non-blocking error dialogs on network failures.
| Home (Light Theme) | Crypto Coin Details (Light Theme) | Favourite (Light Theme) |
|---|---|---|
![]() |
![]() |
![]() |
| Home (Dark Theme) | Crypto Coin Details (DArk Theme) | Favourite (Light Theme) |
|---|---|---|
![]() |
![]() |
![]() |
- Architecture: Model-View-ViewModel (MVVM) with Factory Pattern for dependency injection (DI).
- Networking: Modern Swift Concurrency (
async/await) for all API calls. - State Management: Combine framework with
ObservableObjectand@Publishedproperties for reactive data flow between ViewModels and Views. - UI: Hybrid approach combining UIKit (
UIViewController,UITableView) with embedded SwiftUI (UIHostingController) for custom cells and views.
| Tech Tools | Usage/Purpose |
|---|---|
| Swift | Language |
| UIKit | IU |
| SwiftUI | UI |
The project uses Swift Package Manager (or CocoaPods) for the following third-party libraries:
| Library | Purpose |
|---|---|
| SDWebImageSwiftUI | Asynchronously loading and displaying images, including SVG icon support (SDWebImageSVGCoder). |
| SwiftUICharts (willdale) | Robust and customizable line chart visualization for sparklines and historical data. |
The Project uses the free version of Coinranking API :
- List of coins for list of coins.
This project fetches weather data from the coinranking.com.
To begin the setup, you'll need to create an account and get a free API key.
- Create an account at coinranking.com
- Go to API key & Usage
- Your API key (you can create a new API or use the Auto-generated API key)
update or create the Config file AppConfig.xcconfig and place your API config there
#Insert at ~/ AppConfig.xcconfig
// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974
//
COIN_RANKING_API_KEY = <Your coinranking API Key>- Xcode 15.0 or later
- iOS v15.0 or later
- macOS v10.10 or later
- Clone the Repository:
git cloneCrypto-Ranker repository URL - Install Dependencies: the project is using CocoaPods,so run
pod install) - Open Project: Open
CryptoCoinranking.xcworkspace. - API Key: Update the
API_KEYsetting in theAppConfig.xcconfigfile with a valid CoinRanking API key. - Build Target: Select the main application target and run on a modern iOS Simulator.
- Unit Tests: Coverage for
CoinListViewModelandNetworkServicelogic using Mocks to verify state changes, error handling, and data transformation. - UI Tests: Verification of the main user flow: application launch, list loading, and navigation to the detail screen.
- Error Handling: Implemented a centralized
AppErrormodel and Combine subscriptions in all View Controllers to show non-blocking error dialogs on network failure.
Building a robust application often involves overcoming specific technical hurdles. Below are the key challenges encountered and the solutions implemented, which demonstrate core technical proficiency.
The CoinRanking API provides coin logos in a mix of both PGN and in the SVG (Scalable Vector Graphics) format.
- Problem: Native Apple frameworks (UIKit and SwiftUI) do not natively support rendering remote SVG files, leading to blank icons in the coin list view.
- Solution: Integrated the SDWebImage library along with its
SDWebImageSVGCodercomponent. - The solution involved explicitly registering the
SVGCoderduring app startup (SDImageCodersManager.shared.addCoder(...)) and utilizing theWebImageview. This enables the app to automatically download, resize, and cache the vector icons.
Crypto-Ranker-Swift
Copyright (c) 2025 Awesome Jim (https://github.com/AwesomeJim/Crypto-Ranker).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





