What you get
-
First-class SwiftUI support via the
PolstViewview, plus a UIKitPolstViewControllerfor legacy view-controller-based screens. -
Native rendering — no
WKWebView, no JS bridge. The widget draws with the host app's SwiftUI / UIKit stack. - Offline cache — last-fetched polst payloads are persisted so the widget renders even when the device is offline.
- Vote replay queue — votes cast offline are queued locally and replayed once connectivity returns.
- Encrypted device-id and token storage via the iOS Keychain.
-
Environment selection at SDK init via
PolstClient(environment: .production)(or.staging/.dev/.custom) — passed into each render surface.
Screenshots
PolstView.
PolstViewController surface for
legacy screens.
Try it locally
-
Clone the embedding repo:
git clone git@github.com:ajcpwnz/polst-embedding.git. -
Open the sandbox in Xcode:
open ios/PolstSDKSandbox.xcodeproj, select thePolstSDKSandboxscheme, pick an iOS Simulator, and pressCmd+R. -
Follow
ios/README.mdfor sandbox-specific run notes (Swift Package resolution, command-line build). -
For SDK source, issues, and releases, see the upstream
polst-iosrepo.
Minimal SwiftUI integration
The canonical "render a polst" call. Construct a
PolstClient once at app startup, then drop a
PolstView anywhere in your SwiftUI scene.
Copy this snippet
import PolstSDK
import SwiftUI
// One-time at app startup — pick the env you need.
private let polstClient = PolstClient(environment: .production)
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
PolstView(shortId: "abc123XYZ_", client: polstClient)
}
}
}
Replace "abc123XYZ_" with any real 10-char
Polst short id. The snippet is shape-only; copy-paste it
into a SwiftUI app to render a single polst end-to-end.
For UIKit hosts, swap PolstView for
PolstViewController(shortId:, client:) and
embed it as a child view controller (see
ios/README.md
and the sandbox's UIKitPolstHost).