Skip to main content
Add the package with Swift Package Manager: in Xcode choose File > Add Package Dependencies and enter https://github.com/MilsatLtd/postcode-widget-swift, then add the NipostPostcodeWidget product to your app target. Pin Up to Next Major Version from 0.1.0, or in a Package.swift:
The SDK is developed privately and distributed from that repository as a compiled XCFramework, which is why the URL is not the SDK’s own repository.

Usage

An async variant returns the selection directly:
show() presents the widget flow: the identity screen (replaced by a confirm screen when prefilledIdentifier is set), saved postcodes, and the map-based discover flow. It delivers the PostcodeSelection, or nil if the user closed without picking. selection.toJSON() produces exactly the wire shape every other SDK delivers.

Configuration

The SDK requires iOS 15+ and brings its own UI, so any iOS app works. Add NSLocationWhenInUseUsageDescription to your app’s Info.plist for the “Get Postcode on Map” discover flow. The widget requests location permission itself at the moment of use.