Builds or reviews iOS computer-vision features with Vision and VisionKit, including OCR, barcode and document scanning, face/object detection, segmentation, tracking, and Core ML inference. Use for Vision requests, live DataScanner flows, or Vision/Core ML integration.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Detect text, faces, barcodes, objects, contours, and poses in images and live video using Apple's on-device computer vision frameworks (Vision and VisionKit). Targets Swift 6.4 / iOS 26+.
| Dimension | Modern Vision (iOS 18+) | Legacy Vision (pre-iOS 18) |
|---|---|---|
| Request Types | Swift structs (RecognizeTextRequest, DetectBarcodesRequest) | ObjC classes (VNRecognizeTextRequest, VNDetectBarcodesRequest) |
| Execution | try await request.perform(on: image) | VNImageRequestHandler(cgImage:).perform([request]) |
| Results | Strongly typed observation arrays | request.results as? [VNBarcodeObservation] |
| Concurrency | Native async/await | Completion handlers or synchronous blocking calls |
Prefer modern Swift-native request structs for new code. Maintain legacy handlers only when supporting deployment targets below iOS 18.
All modern requests conform to ImageProcessingRequest:
import Vision
var request = RecognizeTextRequest()
request.recognitionLevel = .accurate
request.recognitionLanguages = [Locale.Language(identifier: "en-US")]
let observations = try await request.perform(on: cgImage)
for observation in observations {
print("Found text: \(observation.topCandidates(1).first?.string ?? "")")
}Vision observations express bounding boxes in normalized coordinates (0.0...1.0) with origin at the bottom-left corner (Cartesian), while UIKit/SwiftUI places origin at the top-left.
To convert to UIKit/SwiftUI coordinates:
let rect = VNImageRectForNormalizedRect(observation.boundingBox, Int(viewWidth), Int(viewHeight))
// Flip Y-axis: y = viewHeight - rect.origin.y - rect.size.heightRun custom Core ML vision models using CoreMLModelContainer:
.mlpackage or .mlmodelc).CoreMLModelContainer(model: compiledModel).var request = ImageFeaturePrintRequest() or custom Core ML classification request.DataScannerViewController, read VisionKit Scanner..accurate text recognition) synchronously on the main thread.UIImage directly without extracting cgImage or preserving image orientation metadata.DataScannerViewController without checking DataScannerViewController.isSupported and isAvailable.TrackObjectRequest) across unrelated image sequences.RecognizeTextRequest) preferred on iOS 18+ targetsperform(on:orientation:)DataScannerViewController.isSupported before presentation@MainActorthienqo/ios-skills
6bf8b62
Canonical home
since May 23, 2026
Also appears in
on Oct 29, 2026
since May 22, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.