/mwdat-ios:dat-conventionsfrom mwdat-ios
Provides Swift patterns, async/await conventions, naming rules, and key types for DAT SDK iOS development.
Ships in mwdat-ios. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The public SDK is organized into these modules:
DeviceSessionCamera, Stream, VideoFrame, photo captureMockDeviceTestClient for driving MockDeviceKit over HTTP from a UI-test processasync/await for registration, permission, and URL-handling calls; createSession, DeviceSession.start(), addCamera, and Stream.start() are synchronousAsyncSequence / publisher .listen {} for observing streams@MainActor| Type | Convention | Example |
|---|---|---|
| Entry point | Wearables.shared | Wearables.shared.startRegistration() |
| Device sessions | *Session | DeviceSession |
| Capabilities | Named by function | Stream |
| Selectors | *DeviceSelector | AutoDeviceSelector, SpecificDeviceSelector |
| Config | *Configuration | StreamConfiguration |
| Publishers | *Publisher | statePublisher, videoFramePublisher |
import MWDATCore // Registration, devices, permissions
import MWDATCamera // Stream, VideoFrame, photo capture
import MWDATDisplay // Display, FlexBox, Text, Button, Image, Icon, VideoPlayer
For testing:
import MWDATMockDevice // MockDeviceKit, MockGlasses, MockCameraKit
Wearables — SDK entry point. Call Wearables.configure() at launch, then use Wearables.shared (an any WearablesInterface)DeviceSession — The connection to a selected device. Create with createSession(deviceSelector:), then attach capabilitiesCamera — Camera capability from session.addCamera(config:); owns camera.streamStream — Camera stream: start(), stop(), capturePhoto(format:), and the frame/state/photo/error publishersDisplay — Display capability from session.addDisplay()VideoFrame — Individual video frame with .makeUIImage() and .sampleBufferDevice / DeviceIdentifier — DeviceIdentifier is a String; resolve a Device with deviceForIdentifier(_:)AutoDeviceSelector — Selects the best available device, optionally filtered (filter: { $0.supportsDisplay() })SpecificDeviceSelector — Selects a specific device by DeviceIdentifierStreamConfiguration — Configure video codec, resolution, frame rateListenerTokenBag / AnyListenerToken — Keep .listen {} subscriptions alive; dropping a token cancels itMockDeviceKit — Factory for creating simulated devices in testsdo {
try Wearables.configure()
} catch {
// Handle configuration error
}
do {
try await Wearables.shared.startRegistration()
} catch {
// Handle registration error
}
# Install dependencies via Swift Package Manager
# In Xcode: File > Add Package Dependencies > enter repo URL
# Build from command line
xcodebuild -scheme MWDATCore -destination 'platform=iOS Simulator,name=iPhone 16'
# Run tests
xcodebuild test -scheme MWDATCoreTests -destination 'platform=iOS Simulator,name=iPhone 16'
For sample apps:
# Open the sample app workspace
open ExternalSampleApps/CameraAccess/CameraAccess.xcodeproj
# Build and run on simulator (uses MockDeviceKit - no glasses needed)
xcodebuild -scheme CameraAccess -destination 'platform=iOS Simulator,name=iPhone 16'
MWDATCore, MWDATCamera, MWDATDisplay when rendering Display content)try Wearables.configure()xcodebuildIf your editor supports remote MCP servers, connect https://mcp.developer.meta.com/wearables and use search_dat_docs for current DAT setup, session lifecycle, camera streaming, MockDeviceKit, permissions, and exact API symbols. This public docs server does not require authentication; do not configure tokens, OAuth, or custom authorization headers for it.
See the dat-docs-mcp skill for Claude Code, Cursor, and MCP Inspector setup and troubleshooting.
Use llms.txt when your tool only supports static reference context.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub meta/meta-wearables-dat-ios --plugin mwdat-ios18 skills in this plugin
/dat-docs-mcpUse the Wearables DAT MCP server for live DAT documentation search with `search_dat_docs`, Muse Code, Claude Code, Codex, Cursor, and MCP InspectorOther plugins' skills for the same job