iOS

The Swift package verba-ios provides the VerbaTranslations library for over-the-air updates and two command-line tools, verba-fetch and verba-push.

1. Add the package

.package(url: "https://github.com/IKristea/verba-ios.git", from: "1.3.2")

Add the product VerbaTranslations to your app target.

2. Tokens — Verba.xcconfig (add it to .gitignore)

VERBA_READ_TOKEN = <read-token>
VERBA_WRITE_TOKEN = <write-token>   // only for push

Generate them in Verba: project → Settings (Setări) → Package keys (Chei pachete) → platform iOS.

3. Make the read token available at runtime

Set Verba.xcconfig as the target's base configuration file (Info → Configurations), then add to Info.plist:

VerbaReadToken = $(VERBA_READ_TOKEN)

4. Over-the-air updates

enum VerbaConfig {
    static let project = "your-project-slug"
    static var readToken: String {
        (Bundle.main.object(forInfoDictionaryKey: "VerbaReadToken") as? String)?
            .trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
    }
}

// AppDelegate — locales come from Verba
VerbaOta.start(project: VerbaConfig.project, token: VerbaConfig.readToken)
VerbaOta.refresh()   // when the app returns to the foreground

// in your localization lookup — Verba first, compiled bundle as fallback
if let ota = VerbaOta.get(lang, key) { return ota }
return bundle.localizedString(forKey: key, value: value, table: table)

5. Push and fetch from a build phase (optional)

Xcode plugins cannot use the network, so a guarded Run Script Build Phase calls the tool shipped in the package:

[ "${VERBA_PUSH:-0}" = 1 ] || exit 0
TOOL="$(find "${BUILD_DIR%/Build/*}/SourcePackages/artifacts" -name verba-push -type f | head -1)"
cd "$SRCROOT"; "$TOOL"

Run it when you need it: xcodebuild -scheme App VERBA_PUSH=1 build. verba-push reads <locale>.lproj/Localizable.strings (and .stringsdict), creates the missing keys in Verba and fills empty values; verba-fetch writes them back.

© 2026 Verba