This Project make for practice intregrate cordova-ios with swift framework.
IOS framework using is BarcodeScanner
BarcodeScanner is a simple and beautiful wrapper around the camera with barcode capturing functionality and a great user experience.
Use Carthage to checkout and build framework
Simple step to build framework
- cd to fileSomeProject ios
terminal: ~/Path/To/Starter/Project
- create file
terminal: touch Cartfile
- edit Cartfile add
github "hyperoslo/BarcodeScanner"
- run
terminal: carthage update --platform iOS
- it will download and new folder.
- Go to Carthage/Build copy .framework
- Go to Carthage/Checkout and open project with Xcode
- If finnished build with xcode success.
- use
Command: carthage build --platform iOS
it will build checkout folder. - copy .framework for use.
- ionic use
terminal: ionic cordova plugin add https://github.com/misternay/cordova-plugin-barcode-scanner.git
-
declare var barcodescannernew: any; someFunction() { barcodescannernew.scan( function (onsuccess) { console.log(onsuccess) }, function (onerror) { console.log(onerror) }) }
- don't forget add request permission Cammera use in Xcode
- change swift language to version 4 in build setting in xcode
- change file > workspace setting > build setting to 'legacy build system' and build system to legacy build