A memory-safe, type-safe, and concurrency-safe Swift wrapper for the NDI SDK.
This package provides a Swift interface to NDI, but does not redistribute the NDI SDK headers or binary. Install the NDI SDK for Apple before building, and review NDI's software distribution requirements before shipping its libraries with an application.
NDI must be statically linked on iOS and tvOS. Add the SDK's platform-specific static library (libndi_ios.a or libndi_tvos.a) to the application target that consumes the NDI product. These platforms do not load the NDI runtime dynamically.
On macOS, the package loads libndi.dylib at runtime. For an application bundle, the recommended setup is to embed the library in the app:
- Add the NDI SDK's
libndi.dylibto the application target. - Embed it at
Contents/Frameworks/libndi.dylibusing a Copy Files build phase whose destination is Frameworks, with Code Sign on Copy enabled. - Keep
@executable_path/../Frameworksin the target's Runpath Search Paths. This is included in Xcode's usual application defaults.
Embedding gives the application a known runtime version and works with the Hardened Runtime and App Sandbox, which may prevent access to libraries installed elsewhere on the system. Ensure that distributing the embedded library complies with the NDI SDK license.
The loader checks the following locations, in order:
@executable_path/../Frameworks/libndi.dylib- The directory named by
NDI_RUNTIME_DIR_V6 /Library/NDI SDK for Apple/lib/macOS/libndi.dylib/usr/local/lib/libndi.dyliblibndi.dylibthrough the normal dyld search paths
The installed paths and NDI_RUNTIME_DIR_V6 are useful for development tools and non-sandboxed executables, but applications should not depend on an end user having the SDK or redistributable installed system-wide. See NDI's Dynamic Loading of NDI Libraries documentation for the official runtime-loading guidance.