- Tutorials
- Integrating the mimik Client Library into an iOS project
Integrating the mimik Client Library into an iOS project
Objective
This tutorial shows you how to add the mimik Client Library to an iOS project, configure it, and prepare for subsequent tutorials.
Intended Readers
iOS software developers and system integrators building applications with the mimik Client Library.
NOTE: The full mimik Client Library API reference documentation is available online and inside Xcode’s built-in documentation browser. |
---|
What You'll Learn
- Configuring a
Podfile
- Installing the mimik Client Library with CocoaPods
- Importing mimik Client Library modules
- Initializing logging via
ClientLibrary
static APIs
Prerequisites
- Xcode with Swift 6.1+ toolchain (the module interface targets Apple Swift 6.1.2, effective Swift 5.10).
- iOS 16.0+ deployment target.
- A real iOS device attached to your Mac and selected as the build target.
Some features (like the on-device runtime) require a physical device; you can still build & link on the Simulator, but runtime interactions may be disabled. See the Simulator tutorial.
Configuring a Podfile
The mimik Client Library uses CocoaPods for dependency management.
Listing 1 shows an example Podfile
aligned with iOS 16.0 and distribution-ready Swift interfaces:
1: platform :ios, '16.0'2: source 'https://github.com/CocoaPods/Specs.git'3: source 'https://github.com/mimikgit/cocoapod-edge-specs.git'4:5: target '<Your-Target-Name>' do6: use_frameworks!7: inhibit_all_warnings!8:9: # Core SDKs10: pod 'EdgeCore'11: pod 'mim-OE-ai-SE-iOS-developer'12: end13:14: post_install do |installer|15: installer.pods_project.targets.each do |target|16: target.build_configurations.each do |config|17: # Match minimum supported iOS to the SDK’s interface manifest18: config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'19: # Required to distribute Swift frameworks with .swiftinterface files20: config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'21: end22: end23: end
Listing 1: Example Podfile
for the mimik Client Library
💡 Why
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
?
It preserves module ABI & emits.swiftinterface
files so your app can consume the library across Swift compiler updates.
Installing the mimik Client Library
Once your Podfile
is set up, install the dependencies:
pod install --repo-update
Expected output looks like:
1: Analyzing dependencies2: Downloading dependencies3: Installing Alamofire4: Installing AppAuth5: Installing EdgeCore6: Installing JWTDecode7: Installing SwiftyJSON8: Installing mim-OE-ai-SE-iOS-developer9: Generating Pods project10: Integrating client project
✅ After installation, close the
.xcodeproj
and openYourApp.xcworkspace
.
Importing mimik Client Library modules
Import the modules you’ll use:
1: import EdgeCore2: import EdgeEngine
Initialize Logging
Many setup operations (like logging) are exposed as static helpers on ClientLibrary
. You don’t need to instantiate a client just to configure logging.
1: import EdgeCore2: import EdgeEngine3:4: // Optional: verbose logging during development5: // Use modules that match the SDK's logging categories.6: ClientLibrary.setLoggingLevel(module: .mimikCore, level: .debug, privacy: .publicAccess)7: ClientLibrary.setLoggingLevel(module: .mimikRuntime, level: .debug, privacy: .publicAccess)8: // Other available modules include: .mimikService, .mimikApps, or .custom("YourTag")9:10: // Tip: switch to .info or .error for production builds
Listing 2: Configure logging via ClientLibrary
static APIs
🧵 Actor/Threading note
Some provided views and runtime controls are annotated@MainActor
. Invoke them from the main actor (e.g., within SwiftUI view bodies or@MainActor
contexts). This tutorial doesn’t start the runtime; that will be covered later.
Next Steps
A practical path forward, distilled from the broader documentation:
- Get the big picture — Review key concepts and architecture so you know where
EdgeCore
,EdgeEngine
, and mim OE fit in your app. - Add mim OE basics — Configure mim OE, verify the runtime starts/stops cleanly on-device, and confirm version/health checks.
- Work with microservices — Discover or deploy a sample microservice, call it from your app, and validate request/response handling end-to-end.
- Build a minimal app — Combine the above into a tiny, production-like sample with initialization, runtime control, a simple microservice call, and basic error handling/logging.
- Integrate AI flows (optional) — If your use case needs it, add the AI pod and wire a simple prompt→response UI, keeping privacy and quota considerations in mind.
Troubleshooting
- Opened the wrong project? Use
.xcworkspace
, not.xcodeproj
. - “Deployment target too low”: bump target to iOS 16.0+ in your app target settings.
- No logs in Release: prefer
.info
or.error
for production logging; avoid.debug
in shipping builds.