How to create Qr code by dots in objective c?

1.8k views Asked by At

I'm trying create Qr codes and I have seen that Qr codes could be makes by dots and by figures. I know how to create simple Qr codes that are built by squares, but I don't know how to use dots like this:

enter image description here

I use this code to build codes easily:

- (CIImage *)createQRForString:(NSString *)qrString
{
// Need to convert the string to a UTF-8 encoded NSData object
NSData *stringData = [qrString dataUsingEncoding:NSUTF8StringEncoding];

// Create the filter
CIFilter *qrFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
// Set the message content and error-correction level
[qrFilter setValue:stringData forKey:@"inputMessage"];
[qrFilter setValue:@"H" forKey:@"inputCorrectionLevel"];

// Send the image back
return qrFilter.outputImage;
}

How could I change this code to apply dots instead of squares?

1

There are 1 answers

0
Duncan C On

You might try the ZXingObjC framework. It lets you both scan and generate QR codes and a variety of other codes. Since it's open source you might be able to fork it and change the rendering to draw dots instead of squares.