Skip to content

Instantly share code, notes, and snippets.

@yaakovgamliel
Last active August 13, 2019 10:50
Show Gist options
  • Save yaakovgamliel/a48f75dda4cfb653d7cb6d04bb862f41 to your computer and use it in GitHub Desktop.
Save yaakovgamliel/a48f75dda4cfb653d7cb6d04bb862f41 to your computer and use it in GitHub Desktop.
//
// RecognizerProvider.swift
// pos
//
// Created by yaakov on 3/25/19.
//
import Foundation
import MicroBlink
import Core
class RecognizerProvider {
var rawParser: MBRawParser?
var parserGroupProcessor: MBParserGroupProcessor?
var blinkInputRecognizer: MBBlinkInputRecognizer?
func controller(transaction: OngoingTransaction, delegate: MBDocumentOverlayViewControllerDelegate) -> UIViewController? {
MBMicroblinkSDK.sharedInstance().setLicenseKey("License we got goes here")
let settings = MBDocumentOverlaySettings()
rawParser = MBRawParser()
parserGroupProcessor = MBParserGroupProcessor(parsers: [rawParser!])
blinkInputRecognizer = MBBlinkInputRecognizer(processors: [parserGroupProcessor!])
let recognizerList = [self.blinkInputRecognizer!]
let recognizerCollection = MBRecognizerCollection(recognizers: recognizerList)
/** Create your overlay view controller */
let documentOverlayViewController = MBDocumentOverlayViewController(
settings: settings,
recognizerCollection: recognizerCollection,
delegate: delegate)
/** Create recognizer view controller with wanted overlay view controller */
let recognizerRunnerViewController: UIViewController = MBViewControllerFactory.recognizerRunnerViewController(withOverlayViewController: documentOverlayViewController)
return recognizerRunnerViewController
}
}
The SDK was added to the project via CocoaPods like this:
pod 'PPBlinkID', '~> 4.10.0'
We run the app in both simulator and real device running iOS 12.4 and iOS 13 beta, the crash happens at: line 21 rawParser = MBRawParser(), I'm posting here the backtrace
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001137572c6 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00000001137aabf1 libsystem_pthread.dylib`pthread_kill + 284
frame #2: 0x000000011351a01d libsystem_c.dylib`abort + 127
frame #3: 0x00000001126e99d1 libc++abi.dylib`abort_message + 231
frame #4: 0x00000001126e9b6f libc++abi.dylib`default_terminate_handler() + 267
frame #5: 0x00000001113dbe2d libobjc.A.dylib`_objc_terminate() + 97
frame #6: 0x00000001126f5a2e libc++abi.dylib`std::__terminate(void (*)()) + 8
frame #7: 0x00000001126f56d2 libc++abi.dylib`__cxa_rethrow + 99
frame #8: 0x00000001113dbc6e libobjc.A.dylib`objc_exception_rethrow + 40
frame #9: 0x0000000111d98397 CoreFoundation`CFRunLoopRunSpecific + 775
frame #10: 0x0000000113f872fe GraphicsServices`GSEventRunModal + 65
frame #11: 0x000000011ae1cba2 UIKitCore`UIApplicationMain + 140
* frame #12: 0x000000010bb7d840 pos`closure #1 in at main.swift:11:9
frame #13: 0x000000010bb7d876 pos`thunk for @callee_guaranteed (@unowned UnsafeMutablePointer<UnsafeMutablePointer<Int8>>) -> (@error @owned Error) at <compiler-generated>:0
frame #14: 0x000000010bb7d90b pos`partial apply for thunk for @callee_guaranteed (@unowned UnsafeMutablePointer<UnsafeMutablePointer<Int8>>) -> (@error @owned Error) at <compiler-generated>:0
frame #15: 0x000000011286802f libswiftCore.dylib`Swift.UnsafePointer.withMemoryRebound<A, B>(to: A1.Type, capacity: Swift.Int, _: (Swift.UnsafePointer<A1>) throws -> B1) throws -> B1 + 15
frame #16: 0x00000001129ee19f libswiftCore.dylib`Swift.UnsafeMutablePointer.withMemoryRebound<A, B>(to: A1.Type, capacity: Swift.Int, _: (Swift.UnsafeMutablePointer<A1>) throws -> B1) throws -> B1 + 15
frame #17: 0x000000010bb7d5f7 pos`main at main.swift:10:24
frame #18: 0x0000000113433541 libdyld.dylib`start + 1
frame #19: 0x0000000113433541 libdyld.dylib`start + 1
I also tried installing only this pod `pod 'MBBlinkCard', '~> 1.0.1'`, but the project does not compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment