iOS Quickstart Guide

Learn how to instantly drop LangCat into your native Apple applications using Swift Package Manager.

1. Extract your Configuration

From your LangCat project dashboard, download the LangCat-Info.plist metadata file. Drag this directly into your Xcode project hierarchy.

⚠️ Warning: Ensure the file is checked within your target's Copy Bundle Resources build phase.

2. Install via Swift Package Manager

  1. In Xcode, click File > Add Package Dependencies...
  2. Search for https://github.com/lang-cat/lang-cat-ios.git.
  3. Import LangCat (The runtime SDK).

3. Runtime Initialization

LangCat intercepts translation requests instantly using robust Objective-C runtime swizzling on NSLocalizedString calls. For safe rendering, you should strictly initialize the library before rendering views.

Asynchronous Loading (Recommended)

If your translations are mission critical and you wish to block initial renders via async/await:

App.swift
import SwiftUI
import LangCat
@main
struct MyApp: App {
@State private var isReady = false
var body: some Scene {
WindowGroup {
if isReady {
ContentView()
} else {
ProgressView("Updating Localizations...")
.task {
// Awaits the LangCat edge fetch before continuing views
try? await LangCat.initializeAsync()
isReady = true
}
}
}
}
}

Synchronous Loading

If you prefer a seamless splash-screen lifecycle backgrounding the sync natively:

App.swift
import SwiftUI
import LangCat
@main
struct MyApp: App {
init() {
// Method Swizzle overrides happen synchronously. Network fetch runs silently.
LangCat.initialize()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

Moving Forward

Because LangCat perfectly swizzles Bundle, standard UIKit applications require no changes natively. However, SwiftUI processes LocalizedStringKey during compile-time. To fully utilize Over-The-Air localizations on SwiftUI apps, navigate to the LC Native Components reference guide!