Agent skill · software engineering · dpearson2699
vision-framework
Implement computer vision features including text recognition (OCR), face detection, barcode scanning, image segmentation, object tracking, and document scanning in iOS apps. Covers both the modern Swift-native Vision API (iOS 18+) and legacy VNRequest patterns, VisionKit DataScannerViewController for live camera scanning, and CoreMLRequest/VNCoreMLRequest for custom model inference. Use when adding OCR, barcode scanning, face detection, or custom Core ML model inference with Vision.
Why this skill is useful
Provides specific implementation patterns and API usage for modern and legacy Vision framework features that the AI wouldn't reliably generate on its own.
What it needs
Requires xcode installed locally. About 9k tokens when loaded. Last updated 2026-07-31. 973 stars on the source repository.
What this skill does
Vision Framework Detect text, faces, barcodes, objects, and body poses in images and video using on-device computer vision. Prefer the modern iOS 18+ request APIs and load the legacy reference only when the deployment target requires it. See references/vision-requests.md for complete code patterns and references/visionkit-scanner.md for DataScannerViewController integration. Contents Two API Generations Request Pattern (Modern API) Text Recognition (OCR) Face Detection Barcode Detection Document Scanning (iOS 26+) Image Segmentation Object Tracking Other Request Types Core ML Integration VisionKit: DataScannerViewController Common Mistakes Review Checklist References Two API Generations Vision has two distinct API layers. Prefer the modern API for new code: Swift-native request types plus try await request.perform(on:). Keep VN, VNImageRequestHandler, VNSequenceRequestHandler, completion handlers, and legacy CGRect helpers inside explicit legacy fallback sections or files. Aspect Modern (iOS 18+) Legacy --- --- --- Pattern let result = try await request.perform(on: image) VNImageRequestHandler + completion handler Request types Swift types — structs and classes (RecognizeTextRequest, DetectFaceRectanglesRequest) ObjC classes (VNRecognizeTextRequest, VNDetectFaceRectanglesRequest) Concurrency Native async/await Completion handlers or synchronous perform Observations Typed return values Cast results from [Any] Availability iOS 18+ / macOS 15+ iOS 11+ The modern API uses the ImageProcessingRequest protocol. Each request type has a perform(on:orientation:) method that accepts CGImage, CIImage, CVPixelBuffer, CMSampleBuffer, Data, or URL. Most requests are structs; stateful requests such as GeneratePersonSegmentationRequest, TrackObjectRequest, TrackRectangleRequest, and DetectTrajectoriesRequest are final classes. Request Pattern (Modern API) All modern Vision requests follow the same pattern: create a request, call perform(on:), and handle the typed result. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills dpearson2699/vision-framework