How to get a quality barcode image from string in ios, swift
When the CIImage
is converted to a UIImage
it does so with a fixed size that is determined by the CIImage
, if you subsequently try to scale this image up, say by assigning it to a UIImageView
, then you will get the typical pixellation associated with scaling up a bitmap.
Transform the image before assigning it to the UIImage
if let barImage = filter.outputImage {
let transform = CGAffineTransformMakeScale(5.0, 5.0)
let scaled = barImage.imageByApplyingTransform(transform)
return(UIImage(CIImage: scaled))
}
Barcode string value when using the Vision Framework of iOS11
It seems that now you can get a decoded string from a barcode using new payloadStringValue property of VNBarcodeObservation
introduced in iOS 11 beta 5.
if let payload = barcodeObservation.payloadStringValue {
print("payload is \(payload)")
}
Barcode Generation from within iOS App
The only free library to do this is Cocoa-Touch-Barcodes, which is a fork of cocoabarcodes. If you are considering commercial libraries, there is one called iPhone Barcode Generator.
update Check this objective-c port of ZXing: https://github.com/TheLevelUp/ZXingObjC
Related Topics
Connect Outlet of a Cell Prototype in a Storyboard
How to Remove the Authorization Prompt from Command-Line Instances of Instruments (Xcode)
Application Executable Is Missing a Required Architecture Armv6
Facebook Graph API Get Request - Should Contain "Fields" Parameter (Swift, Facebook Sdk V4.5.1)
Tracking Multiple (20+) Locations with iOS Geofencing
Ios: Capture Image from Front Facing Camera
Disable Magnification Gesture in Wkwebview
How to Figure Out Which Url Is Being Blocked by App Transport Security
Push Notifications Not Being Received on iOS 10, But Working on iOS 9 and Before
How to Retrieve Facebook Response Using Facebook iOS Sdk
Alamofire Download in Background Session
Aligning Right to Left on Uicollectionview
Xcode 6 Storyboard Unwind Segue with Swift Not Connecting to Exit
Drawviewhierarchyinrect:Afterscreenupdates: Delays Other Animations
How to Split String into Substrings on iOS
How to Make Uiimagepickercontroller for Camera and Photo Library at the Same Time in Swift
iOS 14 How to Trigger Local Network Dialog and Check User Answer