• Stars
    star
    2,825
  • Rank 16,110 (Top 0.4 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 7 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Document Scanning Made Easy for iOS

WeScan

WeScan makes it easy to add scanning functionalities to your iOS app! It's modelled after UIImagePickerController, which makes it a breeze to use.

Features

  • Fast and lightweight
  • Live scanning of documents
  • Edit detected rectangle
  • Auto scan and flash support
  • Support for both PDF and UIImage
  • Translated to English, Chinese, Italian, Portuguese, and French
  • Batch scanning

Demo

Requirements

  • Swift 5.0
  • iOS 10.0+

Installation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but WeScan does support its use on supported platforms.

Once you have your Swift package set up, adding WeScan as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/WeTransfer/WeScan.git", .upToNextMajor(from: "2.1.0"))
]

Usage

Swift

  1. In order to make the framework available, add import WeScan at the top of the Swift source file

  2. In the Info.plist, add the NSCameraUsageDescription key and set the appropriate value in which you have to inform the user of the reason to allow the camera permission

  3. Make sure that your view controller conforms to the ImageScannerControllerDelegate protocol:

class YourViewController: UIViewController, ImageScannerControllerDelegate {
    // YourViewController code here
}
  1. Implement the delegate functions inside your view controller:
func imageScannerController(_ scanner: ImageScannerController, didFailWithError error: Error) {
    // You are responsible for carefully handling the error
    print(error)
}

func imageScannerController(_ scanner: ImageScannerController, didFinishScanningWithResults results: ImageScannerResults) {
    // The user successfully scanned an image, which is available in the ImageScannerResults
    // You are responsible for dismissing the ImageScannerController
    scanner.dismiss(animated: true)
}

func imageScannerControllerDidCancel(_ scanner: ImageScannerController) {
    // The user tapped 'Cancel' on the scanner
    // You are responsible for dismissing the ImageScannerController
    scanner.dismiss(animated: true)
}
  1. Finally, create and present a ImageScannerController instance somewhere within your view controller:
let scannerViewController = ImageScannerController()
scannerViewController.imageScannerDelegate = self
present(scannerViewController, animated: true)

Objective-C

  1. Create a dummy swift class in your project. When Xcode asks if you'd like to create a bridging header, press 'Create Bridging Header'
  2. In the new header, add the Objective-C class (#import myClass.h) where you want to use WeScan
  3. In your class, import the header (import <yourProjectName.swift.h>)
  4. Drag and drop the WeScan folder to add it to your project
  5. In your class, add @Class ImageScannerController;

Example Implementation

ImageScannerController *scannerViewController = [[ImageScannerController alloc] init];
[self presentViewController:scannerViewController animated:YES completion:nil];

Contributing

As the creators, and maintainers of this project, we're glad to invite contributors to help us stay up to date. Please take a moment to review the contributing document in order to make the contribution process easy and effective for everyone involved.

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

License

WeScan is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

Mocker

Mock Alamofire and URLSession requests without touching your code implementation
Swift
1,096
star
2

Diagnostics

Allow users to easily share Diagnostics with your support team to improve the flow of fixing bugs.
Swift
939
star
3

UINotifications

Present custom in-app notifications easily in Swift
Swift
394
star
4

zip_tricks

[DEPRECATED] Compact ZIP file writing/reading for Ruby, for streaming applications
Ruby
349
star
5

GitBuddy

Your buddy in managing and maintaining GitHub repositories, and releases. Automatically generate changelogs from issues and merged pull-requests.
Swift
240
star
6

WeTransfer-iOS-CI

Containing all the shared CI logic for WeTransfer repositories
Swift
223
star
7

prorate

Redis-based rate limiter (with a leaky bucket implementation in Lua)
Ruby
86
star
8

wt_activerecord_index_spy

A gem to spy queries running with Active Record and report missing indexes
Ruby
77
star
9

format_parser

file metadata parsing, done cheap
Ruby
62
star
10

wt-js-sdk

A JavaScript SDK for WeTransfer's Public API
JavaScript
47
star
11

WeTransfer-Swift-SDK

A Swift SDK for WeTransferโ€™s public API
Swift
39
star
12

Sketch-Plugin

Plugin to share artboards directly via WeTransfer. Share the link easily with your colleagues and friends.
Objective-C
39
star
13

sqewer

SQS queue processor engine
Ruby
30
star
14

wt_s3_signer

Fast S3 key urls signing
Ruby
26
star
15

cr_zip_tricks

Alternate ZIP writer for Crystal, ported from zip_tricks for Ruby
Crystal
25
star
16

image_vise

Image processing proxy that works via signed URLs
Ruby
20
star
17

ghost_adapter

Run ActiveRecord migrations through gh-ost
Ruby
19
star
18

concorde.js

A sexy pinnacle of engineering thatโ€™s nonetheless incredibly inefficient and expensive and goes out of business because it canโ€™t find enough use. It also provides some tools to deal with the browser.
JavaScript
17
star
19

fast_send

Send very large HTTP responses via file buffers
Ruby
16
star
20

apiculture

Honey-tasting REST API toolkit for Sinatra
Ruby
12
star
21

WeScanAndroid

The Android Implementation of WeScan https://github.com/wetransfer/wescan
11
star
22

wetransfer_ruby_sdk

A Ruby SDK for WeTransfer's Public API
Ruby
11
star
23

richurls

Service which enriches URLs fast and cheap
Ruby
10
star
24

measurometer

Minimum viable API for โฑ๐Ÿ“ˆ in ๐Ÿ’Ž libraries
Ruby
10
star
25

interval_response

Serve partial (Range) HTTP responses from ๐Ÿ’Ž applications
Ruby
9
star
26

activerecord_autoreplica

Simple read replica proxy for ActiveRecord
Ruby
7
star
27

wt-api-docs

Official documentation for WeTransfer's Public API
Ruby
7
star
28

product-engineering-career-framework

This repo holds discussion and the permalink to WeTransfer's internal Product Engineering Career Framework.
7
star
29

hash_tools

Do useful things to Ruby Hashes, without monkey-patches
Ruby
5
star
30

rational_choice

A fuzzy logic gate
Ruby
4
star
31

Xperiments

Simple A/B testing tool. Includes CMS and an experimentation engine.
JavaScript
4
star
32

amplitude-client-node

Node.js client for the Amplitude API
TypeScript
4
star
33

Danger

Contains our global Danger file.
Ruby
3
star
34

very_tiny_state_machine

For when you need it even smaller than you think you do
Ruby
3
star
35

eslint-config-wetransfer

ESLint shareable config used for WeTransfer JS projects.
JavaScript
3
star
36

wetransfer_style

At WeTransfer we code in style. This is our coding style for Ruby development.
Ruby
3
star
37

runaway

Controls child process execution, with hard limits on maximum runtime and heartbeat timings
Ruby
2
star
38

megabytes

Tiny byte size formatter
Ruby
1
star
39

Actions-Experiment

A Repo to experiment with github actions to build previews for the frontend.
JavaScript
1
star
40

strict_request_uri

Truncate and cleanup URLs with junk in Rack
Ruby
1
star
41

tdd-workshop

Repo to host the code for the TDD workshop
Kotlin
1
star
42

departure

WeTransfer's fork of departurerb/departure, to accelerate Rails 5.2 support. See the link for the original repo:
Ruby
1
star
43

sanitize_user_agent_header

Ensure User-Agent gets correctly UTF-8 encoded
Ruby
1
star
44

ks

Keyword-initialized Structs
Ruby
1
star
45

format_parser_pdf

file metadata parsing, for PDF
Ruby
1
star
46

EmbedExamples

Examples on how to use WeTransfer Embed
Ruby
1
star
47

simple_compress

GZIP compression to and from a String
Ruby
1
star