This tutorial, I covers:
• Creating a @Generable ExtractedWineInfo type with guided descriptions for winery, wine name, variety, country, region, vintage, and alcohol percentage
• Using Vision’s RecognizeTextRequest for accurate OCR with language correction
• Preparing UIImage instances for consistent Vision and Foundation Models analysis, including orientation handling and resizing
• Checking model availability and confirming vision capability before enabling label scanning
• Attaching a CGImage to a Foundation Models prompt
• Combining OCR text with clear model instructions to extract and interpret wine-label details
• Handling missing text, unavailable models, unsupported image analysis, and no-text-found errors
• Sanitizing generated vintage and alcohol values before applying them to the app’s model
• Wiring the async analyzer into a SwiftUI form with scan progress, disabled editing, and user-friendly error messages
• Testing with photo-library labels, a real-device camera, and iPhone Duo layouts
Are you tired of Ruby and Fastlane installation issues? There's got to be a better way! Discover Codemagic open source CLI tools. It is not a drop-in replacement for all of what Fastlane does (screenshots for example), but we use it at Codemagic to build and publish iOS and Android apps, also versioning and device provisioning.