Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
changed Output to UIImage extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Combs committed Jul 7, 2016
1 parent ae28208 commit 293f381
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions QRIO/QRIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import UIKit
import AVFoundation

public class QRIn: NSObject, AVCaptureMetadataOutputObjectsDelegate {
public class QRInput: NSObject, AVCaptureMetadataOutputObjectsDelegate {
private var session: AVCaptureSession?
private var previewLayer: AVCaptureVideoPreviewLayer?

Expand Down Expand Up @@ -66,7 +66,8 @@ public class QRIn: NSObject, AVCaptureMetadataOutputObjectsDelegate {
}
}

public enum QROut {

public extension UIImage {
public static func QRImageFromString(string: String, containingViewSize: CGSize? = nil, correctionLevel: String = "L") -> UIImage? {
let stringData = string.dataUsingEncoding(NSISOLatin1StringEncoding)
let filter = CIFilter(name: "CIQRCodeGenerator")
Expand All @@ -86,4 +87,4 @@ public enum QROut {
return UIImage(CIImage: qrImage)

}
}
}

0 comments on commit 293f381

Please sign in to comment.