CarQRCodeScanner is Japanese car inspection certificate QR code scanner.
- iOS 10.0+
- Swift 4.0+
- Xcode 9.2+
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate ExpandingMenu into your Xcode project using Carthage, specify it in your Cartfile
:
github "monoqlo/CarQRCodeScanner" ~> 1.0
Run carthage update
to build the framework and drag the built CarQRCodeScanner.framework
into your Xcode project.
Add runscript to your Xcode target.
Shell /bin/sh
/usr/local/bin/carthage copy-frameworks
Input Files
$(SRCROOT)/Carthage/Build/iOS/CarQRCodeScanner.framework
You can install CocoaPods with the following command:
$ gem install cocoapods
To integrate ExpandingMenu into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'CarQRCodeScanner', '~> 1.0'
end
Then, run the following command:
$ pod install
- Instantiate
CarQRCodeScannerController
. - Set delegate to the instance.
- You can get scan result from the delegate method.
import CarQRCodeScanner
class ViewController: UIViewController {
func showQRCodeScanner() {
let scanner = CarQRCodeScannerController()
scanner.scannerDelegate = self
self.presentViewController(scanner, animated: true, completion: nil)
}
}
extension ViewController: CarQRCodeScannerControllerDelegate {
func qrScannerControllerDidCancel(scanner: CarQRCodeScannerController) {
print("canceld!")
}
func qrScannerController(scanner: CarQRCodeScannerController, didFinishScanning certificate: CarInspectionCertificate) {
print(certificate)
}
}