All Projects → aslanyanhaik → Roundcode

aslanyanhaik / Roundcode

Licence: mit
Custom rounded QR code with lots of customization.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Roundcode

Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-88.39%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Xmlmapper
A simple way to map XML to Objects written in Swift
Stars: ✭ 90 (-66.29%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Bfkit Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
Stars: ✭ 963 (+260.67%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Containercontroller
UI Component. This is a copy swipe-panel from app: Apple Maps, Stocks. Swift version
Stars: ✭ 273 (+2.25%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-40.82%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Swift5 Module Template
An opinionated starting point for awesome, reusable Swift 5 modules
Stars: ✭ 331 (+23.97%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-71.54%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Swiftscan
A barcode and qr code scanner( 二维码/条形码扫描、生成,仿微信、支付宝)
Stars: ✭ 293 (+9.74%)
Mutual labels:  xcode, qrcode, barcode
Natrium
A pre-build (Swift) script to alter your Xcode project at pre-build-time per environment, build configuration and target.
Stars: ✭ 131 (-50.94%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Alamofire
Elegant HTTP Networking in Swift
Stars: ✭ 36,896 (+13718.73%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+341.95%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Qrcodereader
Barcode and QR code reader built in Swift
Stars: ✭ 237 (-11.24%)
Mutual labels:  xcode, qrcode, barcode
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+3909.74%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Dtphotoviewercontroller
A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.
Stars: ✭ 212 (-20.6%)
Mutual labels:  xcode, cocoapods, swift-package-manager
Dtpagercontroller
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.
Stars: ✭ 240 (-10.11%)
Mutual labels:  xcode, cocoapods, swift-package-manager
javascript-barcode
Dynamsoft Barcode Reader JavaScript SDK for package managers. PDF417, QR Code, DataMatrix, MaxiCode and more are supported.
Stars: ✭ 142 (-46.82%)
Mutual labels:  qrcode, barcode
api2pdf.php
PHP client library for the Api2Pdf.com REST API - Convert HTML to PDF, URL to PDF, Office Docs to PDF, Merge PDFs, HTML to Image, URL to Image, HTML to Docx, HTML to Xlsx, PDF to HTML, Thumbnail preview of office files
Stars: ✭ 42 (-84.27%)
Mutual labels:  qrcode, barcode
android-zbar-sdk
🔗 android-zbar-sdk, provide jni source, so file and jar file used alone, gradle/maven remote dependencies.
Stars: ✭ 311 (+16.48%)
Mutual labels:  qrcode, barcode
react-native-smart-code
Support React & ReactNative.In react-native,it's create base64 String,which is qrcode or barcode ,and without webview.In react,we use jsbarcode.
Stars: ✭ 14 (-94.76%)
Mutual labels:  qrcode, barcode
barcode-detector
Spec compliant polyfill of the Barcode Detection API 🤳
Stars: ✭ 31 (-88.39%)
Mutual labels:  qrcode, barcode

RoundCode for iOS

License Swift 5 Twitter: @aslanyanhaik

RoundCode is custom circular QR code with lots of customization. Similar to Facebook messenger and Apple's App Clip Codes the RoundCode includes convenient camera scanner and decoder.

Different styles of RoundCode for iOS

Installation

Cocoapods:

pod 'RoundCode'

Swift Package Manager:

File > Swift Packages > Add Package Dependency

https://github.com/aslanyanhaik/RoundCode

Usage example

import framework

import RoundCode

Encoding

create coder and encode

let image = RCImage(message: "Hello World")
let coder = RCCoder()
do {
  imageView.image = try coder.encode(image)
} catch {
  //handle errors
}

You can also validate the messsage before encoding

let coder = RCCoder()
let isValidText = coder.validate("Hello world")

Decoding

Create instane of RCCameraViewController and handle the delegate

class ViewController: UIViewController, RCCameraViewControllerDelegate {
  
  func scan() {
    let cameraController = RCCameraViewController()
    cameraController.delegate = self
    present(cameraController, animated: true)
  }
  
  func cameraViewController(didFinishScanning message: String) {
    messageLabel.text = message
  }
}

You can also decode a UIImage like this

let coder = RCCoder()
do {
  messageLabel.text = try coder.decode(UIImage(named: code)!)
} catch {
  //handle errors
}

Appearance

You can change the appearance like this

var image = RCImage(message: "Hello world")
image.contentInsets = UIEdgeInsets(top: 8, left: 10, bottom: 4, right: 10)
image.attachmentImage = UIImage(named: "Profile")
image.size = 300
image.gradientType = .linear(angle: CGFloat.pi)
image.tintColors = [.red, .black]

If image is on dark background you should change scanning mode to darkBackground

let coder = RCCoder()
coder.scanningMode = .darkBackground

Advanced coding configuration

You can provide custom coding configuration in order to encode long text by reducing number of characters

let configuration = RCCoderConfiguration.shortConfiguration
let coder = RCCoder(configuration: configuration)
let configuration = RCCoderConfiguration(characters: " -abcdefghijklmnopqrstuvwxyz0123456789")
let coder = RCCoder(configuration: configuration)

⚠️ If you are encoding with custom configuration, then you should change the RCCameraViewController configuration ⚠️

let configuration = RCCoderConfiguration(characters: " -abcdefghijklmnopqrstuvwxyz0123456789")
let coder = RCCoder(configuration: configuration)
let camera = RCCameraViewController()
camera.coder = coder

Compatibility

Written in Swift 5 and requires Xcode 11.0

RoundCode is compatible with iOS 13.0+.

Screenshot of RoundCode for iOS

Author

License

Copyright 2020 Haik Aslanyan.

Licensed under MIT License: https://opensource.org/licenses/MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].