Skip to content

BOB-Module/QRCodeSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

QRCodeSwift

interpolation modifier of SwiftUI

Generating and scaling up a QR code

Core Image lets us generate a QR code from any input string, and do so extremely quickly. However, there’s a problem: the image it generates is very small because it’s only as big as the pixels required to show its data.

It’s trivial to make the QR code larger, but to make it look good we also need to adjust SwiftUI's image interpolation.

Line art like QR codes and bar codes is a great candidate for disabling image interpolation.

Image(uiImage: your_ui_image)
    .interpolation(.none)

Now the QR code will be rendered nice and sharp, because SwiftUI will just repeat pixels rather than try to blend them neatly.

About

QR code generator written in Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages