Public Swift Package Manager repository for the ReRune iOS SDK.
- iOS 15+
Current public release: 0.4.0
Add this package dependency in Xcode:
https://github.com/BasalBit/rerune-ios.git
Then import:
import ReRuneReRune 0.4.0 works with the native iOS localization system, whether your app's bundled strings come from classic localization files or modern String Catalogs.
- Classic
.strings - Classic
.stringsdict - Modern String Catalog
.xcstrings
Xcode compiles those assets into the app's native localization resources, and ReRune intercepts native Bundle.main / Foundation lookups at runtime for OTA-managed values.
Use the native lookup paths below for strings that should participate in OTA updates:
NSLocalizedString("key", comment: "")Bundle.main.localizedString(forKey: "key", value: nil, table: nil)
This keeps UIKit and SwiftUI code on standard Apple localization APIs while allowing ReRune to refresh visible content after OTA updates.
import ReRune
reRuneSetup(otaPublishId: "replace-with-ota-publish-id")
titleLabel.text = NSLocalizedString("title", comment: "")
subtitleLabel.text = Bundle.main.localizedString(forKey: "subtitle", value: nil, table: nil)
reRuneRevisionPublisher
.dropFirst()
.sink { [weak self] _ in self?.rebindStrings() }
.store(in: &cancellables)import SwiftUI
import ReRune
@main
struct ExampleApp: App {
init() {
reRuneSetup(otaPublishId: "replace-with-ota-publish-id")
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text(NSLocalizedString("title", comment: ""))
Text(Bundle.main.localizedString(forKey: "subtitle", value: nil, table: nil))
}
.reRuneObserveRevision()
}
}- SDK installs a targeted
Bundle.mainlocalization override so UIKit and Foundation code can keep using native lookup APIs. - API auth is
otaPublishIdonly. - Manifest endpoint is fixed by SDK to
platform=ios_xcstrings. - Manifest parsing is strict: root
version, keyedlocales, localeversion, optional localeurl. - Bundled app localizations can originate from classic
.strings/.stringsdictfiles or modern.xcstringsString Catalogs. - OTA locale payloads are
.xcstringscatalog JSON fetched from theios_xcstringsendpoint and applied through the same native lookup path. - Current OTA application is scoped to the default
Localizabletable and simple string entries from the catalog. reRuneRevisionPublisheris the change notification stream for visible UI refreshes; the emitted value is the latest applied manifest revision and may repeat when OTA payloads change under the same manifest revision.- Native OTA override support is scoped to
Bundle.mainand the defaultLocalizabletable. - SwiftUI
Text("key"),LocalizedStringKey, andLocalizedStringResourceare not part of the OTA interception path; resolve the string first withNSLocalizedString(...)orBundle.main.localizedString(...), then pass the result intoText(...). - Periodic refresh policy uses Android-style split fields:
periodicIntervalInHours+periodicIntervalInDays.
Open Examples/ReRuneExamples.xcworkspace to try both demo apps:
ReRuneUIKitExampleReRuneSwiftUIExample
Both examples use the same demo OTA publish id.
They mirror the welcome/story demo flows kept in the source repo examples while consuming the published 0.4.0 package instead of the local workspace package.
The examples intentionally demonstrate both supported lookup styles: NSLocalizedString(...) and Bundle.main.localizedString(...).