Native framework in iOS generates QR code

Source: Internet
Author: User

One or two-dimensional code generation
    • The generation and reading of two-dimensional code has been integrated from iOS7
    • Previously widely used ZBARSDK does not currently support 64-bit processors, in addition to the ZXINGSDK can also generate two-dimensional code
    • Steps to generate a QR code
      • Import Coreimage Framework
      • Generate two-dimensional code with filter Cifilter
    • QR Code content (traditional barcode can only put numbers)
      • Plain text
      • Card
      • URL (can jump to page directly)
      • The specific code generated by the QR code
      • -(void) Touchesbegan: (Nsset<uitouch *> *) touches withevent: (Uievent *) event {            //create filter      cifilter *filter = [Cifilter filterwithname:@ "Ciqrcodegenerator"];            Filter restore default      [filter setdefaults];            Add data to the filter     nsstring *string = @ "http://www.cnblogs.com/PSSSCode/";          Convert nsstring format to nsdata format     nsdata *data = [string datausingencoding:nsutf8stringencoding allowlossyconversion:yes ];          [Filter Setvalue:data forkeypath:@ "InputMessage"];          Get QR Code filter generated QR code     ciimage *image = [Filter outputimage];          Add the obtained QR code to the ImageView     self.imageView.image =[uiimage imagewithciimage:image];
      • We can see that the generated QR code is blurred, and the last step of the block is replaced by the method called in the code block below.

Native framework in iOS generates QR code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.