I\'m a newbie with Ios. i\'m learning swift and overlooked object c.
Currently, i\'m writing an demo with swift and xcode 6.1 which can scan qrcode and barcode from
You're almost there — this should get you the rest of the way. Note the comments:
// initializers are imported without "initWith"
let source: ZXLuminanceSource = ZXCGImageLuminanceSource(CGImage: tempImage)
let binazer = ZXHybridBinarizer(source: source)
let bitmap = ZXBinaryBitmap(binarizer: binazer)
var error: NSError?
var hints = ZXDecodeHints()
var reader = ZXMultiFormatReader()
// 1) you missed the name of the method, "decode", and
// 2) use optional binding to make sure you get a value
if let result = reader.decode(bitmap, hints:hints, error: error) {
lblResult.text = result.text;
}