Apple's framework for computer vision tasks. Vision provides image analysis capabilities including face detection, text recognition, barcode scanning, and object tracking.
of iOS users worldwide can use Vision (iOS 11+ required)
| iOS Version | Market Share | Status |
|---|---|---|
| iOS 18.7 | 30.3% | Supported |
| iOS 18.6 | 29.8% | Supported |
| iOS 26.1 | 10.7% | Supported |
| iOS 18.5 | 6.0% | Supported |
| iOS 16.7 | 2.3% | Supported |
| iOS 26.2 | 2.0% | Supported |
| iOS 18.3 | 1.8% | Supported |
| iOS 15.8 | 1.8% | Supported |
| iOS 11.0 | 1.7% | Supported |
| iOS 17.6 | 1.7% | Supported |
Face and body detection
Text recognition (OCR)
Barcode and QR code detection
Object tracking and classification
Image similarity and registration
Core ML model integration
Detect faces in an image using Vision
import Vision
import UIKit
func detectFaces(in image: UIImage, completion: @escaping ([VNFaceObservation]) -> Void) {
guard let cgImage = image.cgImage else { return }
let request = VNDetectFaceRectanglesRequest { request, error in
guard let observations = request.results as? [VNFaceObservation] else {
completion([])
return
}
completion(observations)
}
let handler = VNImageRequestHandler(cgImage: cgImage, options: [:])
try? handler.perform([request])
}Extract text from images
import Vision
import UIKit
func recognizeText(in image: UIImage, completion: @escaping (String) -> Void) {
guard let cgImage = image.cgImage else { return }
let request = VNRecognizeTextRequest { request, error in
guard let observations = request.results as? [VNRecognizedTextObservation] else {
completion("")
return
}
let recognizedText = observations.compactMap { observation in
observation.topCandidates(1).first?.string
}.joined(separator: "\n")
completion(recognizedText)
}
request.recognitionLevel = .accurate
let handler = VNImageRequestHandler(cgImage: cgImage, options: [:])
try? handler.perform([request])
}Apple's framework for computer vision tasks. Vision provides image analysis capabilities including face detection, text recognition, barcode scanning, and object tracking.
Vision is available on iOS 11 and later. Currently, 99.5% of iOS users worldwide can use this framework.
Related frameworks include Coreml, Arkit. Each has different capabilities and iOS version requirements.