3 Commits

Author SHA1 Message Date
Haik Aslanyan 63a209fb0c Update README.md 2020-06-23 21:41:58 +04:00
Haik Aslanyan 2fa33d0e88 updated readme 2020-05-09 13:30:36 +04:00
Haik Aslanyan 25d734d87d updated readme file 2020-05-07 21:19:32 +04:00
2 changed files with 15 additions and 14 deletions
+14 -12
View File
@@ -5,10 +5,8 @@
[![Twitter: @aslanyanhaik](https://img.shields.io/badge/Contact-Twitter-blue.svg?style=flat)](https://twitter.com/aslanyanhaik)
RoundCode is a Facebook messenger like custom QR code with lots of customization.
In addition to encoder the RoundCode also includes convenient camera scanner and decoder.
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.
<h3 align="center">
<img src="appearance.png" alt="Different styles of RoundCode for iOS"/>
@@ -81,14 +79,14 @@ You can also decode a UIImage like this
```swift
let coder = RCCoder()
do {
messageLabel.text = try coder.decode(UIImage(named: code)!)
} catch {
//handle errors
}
do {
messageLabel.text = try coder.decode(UIImage(named: code)!)
} catch {
//handle errors
}
```
### Appearance
## Appearance
You can change the appearance like this
@@ -100,10 +98,14 @@ 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`
⚠️ When choosing colors or transparent background you should keep in mind that decoder will detect the code on light background with dark colors ⚠️
```swift
let coder = RCCoder()
coder.scanningMode = .darkBackground
```
### Advanced
## Advanced coding configuration
You can provide custom coding configuration in order to encode long text by reducing number of characters
+1 -2
View File
@@ -74,9 +74,8 @@ extension RCImageDecoder {
return points
}
private func scanPixelPattern(for mode: ScanMode, data: PixelContainer) -> [PixelPattern] {
var lastPattern = PixelPattern.init(bit: pixelThreshold.contains((data[0, 0])) ? RCBit.one : RCBit.zero, x: 0, y: 0, count: 0)
var lastPattern = PixelPattern(bit: pixelThreshold.contains((data[0, 0])) ? RCBit.one : RCBit.zero, x: 0, y: 0, count: 0)
var pixelPatterns = [lastPattern]
var count = 0
let maxSize = size * size