A simple macOS app to read code from images, written purely in Swift using Vision Framework.

Overview

Swift 5.4

CodeReader

A simple macOS app to read code from images, written purely in Swift using Vision Framework.

Usage

  1. Drag an image Drag an image
  2. Click the convert button Click Convert

Result

Converted by Storyboard to Swift Converter - https://swiftify.com/converter/storyboard2swiftui
import Swiftul
import Introspect
// TODO: install 'SwiftUI-Introspect package from https://github.com/siteline/SwiftUI-Introspect
// DefaultViewController
1/
struct DefaultView: View {
@State private var fullText: String
var body: some View
Stack( alignment: topLeading)
GeometryReader { geometry
TextField( "Placeholder", text: $fullText)
introspectTextField (customize: { textField in
textField.adjustsFontSizeToFitWidth = true
extField. backgroundColor = UIColor. systemTeal
textField. minimumFontSize = 17. 1
textField. superview?. frame = CGRect(x: DynamicSizeHelper.get0ffsetX(20), y:
DynamicSizeHelper-get0ffsetY(274), width: DynamicSizeHelper. getWidth(280), height:
DynamicSizeHelper.getHeight(18.5))
})
. frame (width: DynamicSizeHelper. getWidth(280), height:
DynamicSizeHelper.getHeight(18.5))
. font (. system(size: , weight: . regular))
.offset(x: DynamicSizeHelper.getoffsetX(20), DynamicSizeHelper.get0ffsetY(274))
TextField( "Placeholder", text: $fullText)
prospectTextField ( customize: t textField in
textField.adjustsFontSizeToFitWidth=true
textField. backgroundColor UIColor. systemRed
textField. clearButtonMode = . whileEditing
textField
mFontSize = 17.0
textField. uperview?. frame = CGRect (x: DynamicSizeHelper. getOffsetX(20), y:
DynamicSizeHelper-get0ffsetY(202), width: DynamicSizeHelper.getWidth(280), height:
DynamicSizeHelper.getHeight(26.5))
}
 frame(width: DynamicSizeHelper-getwidth(280), height :
DynamicSizeHelper.getHeight(2
font (. system(size: 14, weight: . regular))
offset(x: DynamicSizeHelper.get0ffsetX(20), y: DynamicSizeHelper.getOffsetY(202))
TextField("Placeholder", text: $fullText)
introspectTextField( customize: { textField in
textField. adjustsFontSizeToFitwidth = true
textField. backgroundColor: : UIColor. systemPurple
textField.clearButtonMode=.unlessEditing
textField. minimumFontSize = 17. 0
textField. superview?. frame = CGRect (x: DynamicSizeHelper.getOffsetX(20), y:
DynamicSizeHelper-getoffsetY(136), width: DynamicSizeHelper.getWidth(280), height:
DynamicSizeHelper.getHeight(28.5))
F
frame (width: DynamicSizeHelper.getWidth(280), height:
DynamicSizeHelper-getHeight(28.5))
font ( .
(size: 14. weight: .regular))
.offset(x: DynamicSizeHelper.get0ffsetX(20), y: DynamicSizeHelper.getOffsetY(136))
TextField( "Placeholder", text: $fullText)
textFieldStyle(RoundedBorderTextFieldStyle())
introspectTextField(customize: textField in
textField.adjustsFontSizeToFitWidth=true
textField. backgroundColor = UIColor. systemOrange
textField.clearButtonMode= always
textField.minimumFontSize = 17.0
})
frame(width: DynamicsizeHelper-getWidth(280), height:
DynamicSizeHelper.getHeight(34))
font (. system (size: 14, weight: regular))
.offset (x: DynamicSizeHelper.get0ffsetX(20), y: DynamicSizeHelper.getOffsetY(75))
. frame(width: DynamicSizeHelper. getwidth(320), height: DynamicSizeHelper.getHeight(568))
. background( Color (. systemBackground))
dgesIgnoringSafeArea(.all)
struct DefaultView_Previews: PreviewProvider {
static var previews: some View
DefaultView()
Dynamic Size Helper
struct DynamicSizeHelper {
static private let baseViewWidth: CGFloat = 320.0
static private
t baseViewHeight:
GFloat
568.(
static func getHeight (_ height: CGFloat) -> CGFloat
return (height baseViewHeight) * UIScreen. main. bounds. height
static func getWidth(_ width: CGFloat) -> CGFloat
return (width baseViewWidt
UIScreen.
in. bounds. width
static func get0ffsetX(_ x: CGFloat) -> CGFloat
return (x / baseViewWidth) * UIScreen. main. bounds. width
}
static func get0ffsetY(_  y: CGFloat) CGFloat
return ( y / baseViewHeight)
UIScreen.
a. bounds. height

Build Requirements

macOS

macOS Catalina

Download the App directly. https://github.com/Ibrahimhass/CodeReader/releases/download/1.0.2/CodeReader.zip

Author

Md Ibrahim Hassan, [email protected]

License

CodeReader is available under the MIT license. See the LICENSE file for more info.

You might also like...
SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.
SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

Read colors from Xcode assets file.

XcodePalette Read colors from Xcode assets file. How to Use Download the XcodePalette.Executable.zip of the latest release. Extract the XcodePalette U

Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.
Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

A lightweight generic cache for iOS written in Swift with extra love for images.
A lightweight generic cache for iOS written in Swift with extra love for images.

Haneke is a lightweight generic cache for iOS and tvOS written in Swift 4. It's designed to be super-simple to use. Here's how you would initalize a J

Easily display images, animations, badges and alerts to your macOS application's dock icon

DSFDockTile Easily display images, animations, badges and alerts to your macOS application's dock icon. Why? I was inspired by Neil Sardesai after he

iOS Framework that makes it easy to preview images on any UIImageView.
iOS Framework that makes it easy to preview images on any UIImageView.

AZImagePreview iOS Framework that makes it easy to preview images on any UIImageView. Screenshots Installation: Cocoa Pods: pod 'AZImagePreview' Swift

Advanced framework for loading, caching, processing, displaying and preheating images.
Advanced framework for loading, caching, processing, displaying and preheating images.

Advanced framework for loading, caching, processing, displaying and preheating images. This framework is no longer maintained. Programming in Swift? C

A view that takes a set of images, make transition from one to another by using flipping effects.
A view that takes a set of images, make transition from one to another by using flipping effects.

CDFlipView A view that takes a set of images, make transition from one to another by using flipping effects. Demo Live Demo: https://appetize.io/app/w

Releases(1.0.2)
Owner
Md Ibrahim Hassan
 Developer
Md Ibrahim Hassan
Simple command-line utility for performing OCR using Apple's Vision framework

ocrit Runs Vision's OCR on input images and outputs corresponding txt files for each image, or writes the recognized results to standard output. USAGE

Guilherme Rambo 54 Sep 13, 2022
SharkCardScan is a Credit/Debit Card scanner built using Apple's Vision Framework.

iOS Credit/Debit card scanner, built using Apple's Vision Framework.

Gymshark 19 Sep 6, 2022
Autocrop - A face-aware crop utility using OSX's Vision framework

autocrop A high-performance face-aware crop utility using OSX's Vision framework

Alex Dong 0 Jan 19, 2022
Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator

Swifty-OCR-Translator Screen translator for macOS with Apple Vision API and IBM Watson, Google Cloud Translator Usage Select Translator Fill in the AP

Kwangmin Bae 21 Sep 13, 2022
Utilizing Apple's Vision Framework to center faces in CGImage.

FaceCrop CGImage extension that utilizes Apple's Vision Framework to detect and center faces. Usage cgImage.faceCrop { [weak self] result in switc

Ancestry.com 37 Sep 2, 2022
Picture anonymiser using Vision face recognition

?? Anonymojizer [WIP] Anonymize people in photos by replacing their faces by emojis. How to use it ? Pick a photo from the gallery Choose an emoji The

Kaww 1 Dec 20, 2021
A demo of face recognition SwiftUI app on iOS. Based on Vision, OpenCV, Dlib and ResNet.

iOS-FaceRecognizer A demo of face recognition SwiftUI app on iOS, build for iPad. Based on Vision, OpenCV, Dlib and ResNet. Features Add face image an

js_john 11 Aug 20, 2022
APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS.

APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS. It's built on top of a modified version of libpng wit

Wei Wang 2.1k Sep 17, 2022
✂️ Detect and crop faces, barcodes and texts in image with iOS 11 Vision api.

ImageDetect ImageDetect is a library developed on Swift. With ImageDetect you can easily detect and crop faces, texts or barcodes in your image with i

Arthur Sahakyan 296 Aug 29, 2022
Crop faces, inside of your image, with iOS 11 Vision api.

FaceCropper Requirements Xcode 9.0 (beta) or higher. iOS 11.0 (beta) or higher. (It is possible to import this library under the iOS 11. But it won't

Taejun Kim 488 Aug 31, 2022