A native iOS SDK for the GetTranslated translation management platform, providing real-time, AI-powered translations for iOS applications.
Get up and running in under 5 minutes with our Quick Start Guide.
- Complete Integration Guide - Comprehensive documentation with examples and best practices
- Quick Start Guide - Get started in 5 minutes
- Implementation Guide - Architecture and implementation details
- Real-time Translation: Get translations on-demand with automatic caching
- Anonymous User Support: Automatic user ID generation with seamless login transition
- Initialization Callbacks: Receive initialization status and error information via callbacks
- Language Management: Automatic language detection with override support
- Offline Caching: Persistent translation cache using UserDefaults
- Swift Package Manager: Easy integration via SPM
- Comprehensive Logging: Configurable logging levels for debugging
- Robust Error Handling: Detailed error codes and messages for initialization failures
Add the SDK via Xcode:
- In Xcode, go to File → Add Packages...
- Enter the repository URL:
https://github.com/get-translated/ios-sdk.git - Select version:
1.0.0orUp to Next Major Version - Add to your target
Or add to your Package.swift file:
dependencies: [
.package(url: "https://github.com/get-translated/ios-sdk.git", from: "1.0.0")
]pod 'GetTranslatedSDK', '~> 1.0.0'- Download the SDK source code
- Add the
GetTranslatedSDKfolder to your Xcode project - Link the framework to your target
import GetTranslatedSDK
// In your AppDelegate or SceneDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Initialize with API key
GetTranslated.initialize(key: "your-api-key")
// Or with a specific user ID
GetTranslated.initialize(key: "your-api-key", userId: "user-123")
// Or with custom logging
GetTranslated.initialize(key: "your-api-key", userId: "user-123", logLevel: .debug)
return true
}// Synchronous translation (returns immediately, may return original if not cached)
let translated = GetTranslated.getDynamicString("Hello, World!")
// Asynchronous translation with callback
GetTranslated.getDynamicString("Hello, World!") { translation in
// Use the translation
label.text = translation
} onError: { error in
// Handle error
print("Translation error: \(error)")
}// Set language
GetTranslated.setLanguage("es")
// Get supported languages
let languages = GetTranslated.getLanguages()
// Get current language
let currentLang = GetTranslated.getCurrentLanguage()// Login with user ID
GetTranslated.login(userId: "user-123")
// Login with callback
GetTranslated.login(userId: "user-123", callback: initCallback)
// Logout and return to anonymous user
GetTranslated.logout()
// Logout with callback
GetTranslated.logout(callback: initCallback)class AppDelegate: UIResponder, UIApplicationDelegate, InitCallback {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
GetTranslated.initialize(key: "your-api-key", callback: self)
return true
}
func onInitSuccess() {
print("SDK initialized successfully")
}
func onInitError(_ errorCode: Int, _ errorMessage: String) {
print("Initialization failed: \(errorCode) - \(errorMessage)")
}
}Get your API key from your dashboard. Don't have an account? Sign up for free.
- iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+
- Swift 5.7+
- Xcode 14.0+
- Documentation - Complete API reference and guides
- Dashboard - Manage your projects and API keys
- Feedback & Support - Get help and contact support
See LICENSE file for details.