A modern, Swift-native SDK for the RAWG Video Games Database API with first-class SwiftUI support.
Read the complete documentation β
Comprehensive guides including:
- Getting Started
- SwiftUI Integration
- Advanced Features (Query Builder, Pagination, AsyncSequence)
- Security Best Practices
- Performance Optimization
- Complete API Reference
- π¨ SwiftUI First-Class - Ready-to-use ViewModels and UI components
- β Complete API Coverage - All RAWG endpoints (games, platforms, genres, stores, creators)
- π Type-Safe - Fully typed with Codable models and compile-time safe filters
- β‘ Modern Swift - Built with async/await and AsyncSequence
- π― Actor-Based - Thread-safe networking with request deduplication
- π± Cross-Platform - iOS 15+, macOS 13+, watchOS 8+, tvOS 15+, visionOS 1+
- π¨ Fluent Query Builder - Type-safe API with enums
- π Auto-Pagination - Stream results with AsyncSequence
- πΎ Smart Caching - In-memory with TTL
- π Automatic Retries - Exponential backoff
- π Security - Certificate pinning, Keychain storage, input validation
- Swift 6.0+
- iOS 15.0+ / macOS 13.0+ / watchOS 8.0+ / tvOS 15.0+ / visionOS 1.0+
- Xcode 16.0+
Add to your Package.swift:
dependencies: [
.package(url: "https://github.com/pespinel/RAWGKit", from: "3.2")
]Or in Xcode: File β Add Packages... and enter https://github.com/pespinel/RAWGKit
- Visit https://rawg.io/apidocs
- Create an account and get your free API key
import RAWGKit
let client = RAWGClient(apiKey: "YOUR_API_KEY_HERE")
// Fetch popular games
let games = try await client.fetchGames(pageSize: 10, ordering: "-rating")
for game in games.results {
print("\(game.name) - Rating: \(game.rating)")
}import RAWGKit
import SwiftUI
struct GamesListView: View {
@StateObject private var viewModel = GamesViewModel(
client: RAWGClient(apiKey: "YOUR_API_KEY_HERE")
)
var body: some View {
List(viewModel.games) { game in
GameRowView(game: game)
}
.searchable(text: $viewModel.searchText)
.task { await viewModel.loadGames() }
}
}let response = try await client.gamesQuery()
.search("witcher")
.platforms([.pc, .playStation5])
.genres([.rpg, .action])
.metacriticMin(80)
.orderByRating()
.execute(with: client)Check out the Examples/ directory:
- BasicUsage.swift - Client setup, searching, error handling, caching
- AdvancedQueries.swift - Query builder, filtering, date ranges
- AsyncSequences.swift - Streaming datasets, pagination
- RAWGKitDemo/ - Full SwiftUI demo app
- β 389 tests passing - Comprehensive test coverage
- β SwiftLint strict mode - Code quality enforcement
- β SwiftFormat - Automated formatting
- β Strict Concurrency - Maximum safety
- β CI/CD - Automated testing on macOS
Contributions are welcome! See CONTRIBUTING.md for details.
Quick start for contributors:
make setup # Install tools and git hooks
make test # Run tests
make pre-commit # Format, lint, and testMIT License - see LICENSE file for details.
- Data provided by RAWG.io
- Built with Swift 6.0 and modern concurrency
- π Full Documentation
- π Report Issues
- π‘ Feature Requests
- π RAWG API Docs