All Projects → dmrschmidt → QRCode

dmrschmidt / QRCode

Licence: MIT license
A QRCode Generator in Swift

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to QRCode

Efqrcode
A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.
Stars: ✭ 4,121 (+6050.75%)
Mutual labels:  qrcode, qrcodes, qrcode-generator
Springboot
用springboot + springmvc + mybatis + maven搭建成框架,基于Jersey, Swagger,SwaggerUi的restful API
Stars: ✭ 157 (+134.33%)
Mutual labels:  qrcode, qrcode-generator
luaqrcode
Pure Lua qrcode library
Stars: ✭ 114 (+70.15%)
Mutual labels:  qrcode, qrcode-generator
QRCodeFX
Simple tool to generate/read QR Code and export it.
Stars: ✭ 31 (-53.73%)
Mutual labels:  qrcode, qrcode-generator
BGAQRCode-Android
QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式
Stars: ✭ 7,714 (+11413.43%)
Mutual labels:  qrcode, qrcode-generator
React Qr Svg
React component for rendering SVG QR codes
Stars: ✭ 134 (+100%)
Mutual labels:  qrcode, qrcode-generator
Offline Qr Code
📱 Browser add-on allowing you to quickly generate a QR code offline with the URL of the open tab or other text!
Stars: ✭ 193 (+188.06%)
Mutual labels:  qrcode, qrcode-generator
Qrcode
A pure JavaScript QRCode encode and decode library.
Stars: ✭ 69 (+2.99%)
Mutual labels:  qrcode, qrcode-generator
Easyqrcodejs
EasyQRCodeJS is a feature-rich cross-browser pure JavaScript QRCode generation library. Support Canvas, SVG and Table drawing methods. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support Angular, Vue.js, React, Next.js framework. Support binary(hex) data mode.(Running with DOM on client side)
Stars: ✭ 215 (+220.9%)
Mutual labels:  qrcode, qrcode-generator
flutter qr code scanner generator sharing
Flutter App For Scanning, Generating, Sharing QR Code
Stars: ✭ 137 (+104.48%)
Mutual labels:  qrcode, qrcode-generator
next-qrcode
React hooks for generating QRCode for your next React apps.
Stars: ✭ 87 (+29.85%)
Mutual labels:  qrcode, qrcode-generator
Awesomeqrcode
An awesome QR code generator for Android.
Stars: ✭ 1,718 (+2464.18%)
Mutual labels:  qrcode, qrcode-generator
Qrbtf
An art QR code (qrcode) beautifier. 艺术二维码生成器。https://qrbtf.com
Stars: ✭ 1,391 (+1976.12%)
Mutual labels:  qrcode, qrcode-generator
Barcode
barcode.php - Generate barcodes from a single PHP file. MIT license.
Stars: ✭ 141 (+110.45%)
Mutual labels:  qrcode, qrcode-generator
Awesome Qr.js
An awesome QR code generator written in JavaScript.
Stars: ✭ 1,247 (+1761.19%)
Mutual labels:  qrcode, qrcode-generator
Ngx Qrcode
An Angular 9/10 Component Library for Generating QR (Quick Response) Codes
Stars: ✭ 161 (+140.3%)
Mutual labels:  qrcode, qrcode-generator
qrencoder
🔳 Make QR codes in R via libqrencode
Stars: ✭ 59 (-11.94%)
Mutual labels:  qrcode, qrcode-generator
Qr Ascii
A small library to generate QR codes with ascii
Stars: ✭ 63 (-5.97%)
Mutual labels:  qrcode, qrcode-generator
Qrious
Pure JavaScript library for QR code generation using canvas
Stars: ✭ 1,160 (+1631.34%)
Mutual labels:  qrcode, qrcode-generator
Qrcoder
A pure C# Open Source QR Code implementation
Stars: ✭ 2,794 (+4070.15%)
Mutual labels:  qrcode, qrcode-generator

QRCode - A QR Code Generator in Swift

Build Status Carthage compatible Swift Package Manager compatible

A simple QR code image generator to use in your apps, written in Swift 5.

More related iOS Controls

You may also find the following iOS controls written in Swift interesting:

If you really like this library (aka Sponsoring)

I'm doing all this for fun and joy and because I strongly believe in the power of open source. On the off-chance though, that using my library has brought joy to you and you just feel like saying "thank you", I would smile like a 4-year old getting a huge ice cream cone, if you'd support my via one of the sponsoring buttons ☺️💕

If you're feeling in the mood of sending someone else a lovely gesture of appreciation, maybe check out my iOS app 💌 SoundCard to send them a real postcard with a personal audio message.

Buy Me A Coffee

Installation

  • use SPM: add https://github.com/dmrschmidt/QRCode and set "Up to Next Major" with "1.0.0"
  • use carthage: github "dmrschmidt/QRCode", ~> 1.0.0
  • use cocoapods: pod 'SimpleQRCode', '~> 0.6.0'

Usage

You can create a QRCode from either (NS)Data, (NS)String or (NS)URL:

// create a QRCode with all the default values
let qrCodeA = QRCode(data: myData)
let qrCodeB = QRCode(string: "my awesome QR code")
let qrCodeC = QRCode(url: URL(string: "https://example.com"))

To get the UIImage representation of your created qrCode, simply call it's image method:

let myImage: UIImage? = try? qrCode.image()

If you provide a desired size for the output image (see Customization below), this method can throw, in case the desired image size is too small for the data being provided, i.e. some pixels would need to be omitted during scaling.

There is an alternative attribute unsafeImage accessible, which will simply return nil in these cases. If you never specify any custom size however, you could use unsafeImage instead, since the image will automatically pick the ideal size.

To show the QRCode in a UIImageView, and if you're a fan of extensions, you may want to consider creating an extension in your app like so:

extension UIImageView {
    convenience init(qrCode: QRCode) {
        self.init(image: qrCode.unsafeImage)
    }    
}

Customization

A QRCode image can be customized in the following ways:

// As an immutable let, by setting all up in the respective constructors.
// This is the recommended approach.
let qrCode = QRCode(string: "my customized QR code",
                    color: UIColor.red,
                    backgroundColor: UIColor.green,
                    imageSize: CGSize(width: 100, height: 100),
                    scale: 1.0,
                    inputCorrection: .medium)

// As a mutable var, by setting the individual parameters.
var qrCode = QRCode(string: "my customizable QR code")
qrCode.color = UIColor.red // image foreground (or actual code) color
qrCode.backgroundColor = UIColor.blue // image background color
qrCode.size = CGSize(width: 300, height: 300) // final scaled image size
qrCode.scale = 1.0 // image scaling factor
qrCode.inputCorrection = .quartile // amount of error correction information added

Screenshot

See it live in action

SoundCard - postcards with sound lets you send real, physical postcards with audio messages. Right from your iOS device.

QRCode is used to place a scannable code, which links to the audio message, on postcards sent by SoundCard - postcards with audio.

 

Download SoundCard

Download SoundCard on the App Store.

 

Screenshot
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].