EFQRCode
An extension for UIImage to create and scan QRCode, in Swift.
OverviewExampleTo run the example project, clone the repo, and run pod install from the Example directory first.
RequirementsXCode 8.0+
Swift 3.0+
InstallationEFQRCode is available through CocoaPods. To install
it, simply add the following line to your Podfile:
This can be also written as this:
if let testImage = UIImage(named: 'test.png') { let codes = EFQRCode.GetQRCodeString(From: testImage) if codes.count > 0 { print('There are \(codes.count) codes in testImage.') for (index, code) in codes.enumerated() { print('The content of \(index) QR Code is: \(code).') } } else { print('There is no QR Codes in testImage.') } }3. Create QR Code image:// QRCodeString: Content of QR Code // size (Optional): Width and height of image // inputCorrectionLevel (Optional): error-tolerant rate // L 7% // M 15% // Q 25% // H 30% // iconImage (Optional): icon in the middle of QR Code Image // iconImageSize (Optional): Width and height of iconif let tryImage = UIImage(QRCodeString: 'what the hell.', size: 200, inputCorrectionLevel: .m, iconImage: UIImage(named: 'eyrefree'), iconImageSize: 10.0) { print('Create QRCode image success!') } else { print('Create QRCode image failed!') }This can be also written as this:
if let tryImage = EFQRCode.CreateQRCodeImage(With: 'what the hell.', size: 200, inputCorrectionLevel: .m, iconImage: UIImage(named: 'eyrefree'), iconImageSize: 10.0) { print('Create QRCode image success!') } else { print('Create QRCode image failed!') }AuthorEyreFree, eyrefree@eyrefree.org
LicenseEFQRCode is available under the MIT license. See the LICENSE file for more info.
GitHubhttps://github.com/EyreFree/EFQRCode
,开题报告,开题报告