Giter Club home page Giter Club logo

quickscanner's Introduction

QuickScanner logo

Build passing Swift 4.0 Carthage compatible

QuickScanner

Simple framework written in Swift to make all types of code scanning much easier.

Features

  • Easy integration with Camera features
  • Video permission checking
  • Scanned codes handling with delegates
  • Demo provided

Requirements

  • iOS 10.0+
  • Xcode 9.2+
  • Swift 4.0+

Installation

Carthage

Carthage is a simple, decentralized dependency manager for Cocoa.

You can use Homebrew and install Carthage using the following command:

$ brew update
$ brew install carthage

To use QuickScanner in your Xcode project using Carthage, specify it in your Cartfile:

github "lukszar/QuickScanner"

Run carthage update to build the framework and add QuickScanner.framework into your Xcode project. For any help, check Carthage manual

Usage

In Info.plist file add following code to allow your application to access iPhone's camera:

<key>NSCameraUsageDescription</key>
<string>Allow access to camera</string>

Create variable for your scanner in UIViewController

var qrCodeScanner: QuickScanner!

in viewDidLoad() initialize scanner component with following code:

qrCodeScanner = QuickScanner(codeTypes: [CodeType.qr])
qrCodeScanner.delegate = self

as codeTypes here I used qr type, but you can use list of all types you want to be able to scan with this instance of scanner.

For easy handling scanned codes you have to implement few delegate's methods like following:

func quickScanner(_ scanner: QuickScanner, didCaptureCode code: String, type: CodeType) {
  print(code)
}

func quickScanner(_ scanner: QuickScanner, didReceiveError error: QuickScannerError) {
    print("didReceiveError: \(error)")
}

func quickScannerDidSetup(_ scanner: QuickScanner) {
    scanner.startCapturing()
}

func quickScannerDidEndScanning(_ scanner: QuickScanner) {
}

var videoPreview: UIView {
    return self.view
}

Help

Have you found an error?
Feel free to open new issue and describe your problem.

Do you mind a new feature you would like to add?
Develop your ideas by contributing in this project and adding them here.

quickscanner's People

Contributors

lukszar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

quickscanner's Issues

Module compiled with Swift 4.1 cannot be imported by the Swift 4.2 compiler

I updated my XCode to Version 10.0 which brings Swift 4.2 as well. However, my QuickScanner Module is not working and I'm getting this error message

Module compiled with Swift 4.1 cannot be imported by the Swift 4.2 compiler: /Users/Feras/Documents/P1/Carthage/Build/iOS/QuickScanner.framework/Modules/QuickScanner.swiftmodule/x86_64.swiftmodule

I tried to run Carthage update and I got this error message

Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -workspace /Users/Feras/Documents/P1/Carthage/Checkouts/QuickScanner/QuickScanner.xcworkspace -scheme QuickScanner -configuration Release -derivedDataPath /Users/Feras/Library/Caches/org.carthage.CarthageKit/DerivedData/10.0_10A255/QuickScanner/v0.7.7 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/09/2hwb_g256_11s0zcr38hqg200000gn/T/QuickScanner SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/Feras/Documents/P1/Carthage/Checkouts/QuickScanner)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/09/2hwb_g256_11s0zcr38hqg200000gn/T/carthage-xcodebuild.XI2VQv.log

Is there anyway to update my Module to be compatible with Swift 4.2?

Scan fullscreen

How can we scan from fullscreen camera. because it captures barcode when we place it center of the screen.
Also can we able to scan barcode from every angle of device, when we rotate device like 20, 45, 60 etc degree angle?
Please reply.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.