{"id":20305921,"url":"https://github.com/aslanyanhaik/roundcode","last_synced_at":"2025-04-06T21:15:07.581Z","repository":{"id":42477917,"uuid":"182530595","full_name":"aslanyanhaik/RoundCode","owner":"aslanyanhaik","description":"Custom rounded QR code with lots of customization.","archived":false,"fork":false,"pushed_at":"2020-06-23T17:41:59.000Z","size":3610,"stargazers_count":406,"open_issues_count":8,"forks_count":54,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-30T19:08:46.805Z","etag":null,"topics":["aztec-code","barcode","cocoapods","ios","qrcode","qrcode-reader","roundcode","swift","swift-package-manager","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aslanyanhaik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-21T12:32:23.000Z","updated_at":"2025-02-18T14:33:49.000Z","dependencies_parsed_at":"2022-08-19T08:53:08.895Z","dependency_job_id":null,"html_url":"https://github.com/aslanyanhaik/RoundCode","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslanyanhaik%2FRoundCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslanyanhaik%2FRoundCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslanyanhaik%2FRoundCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aslanyanhaik%2FRoundCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aslanyanhaik","download_url":"https://codeload.github.com/aslanyanhaik/RoundCode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247550690,"owners_count":20956987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aztec-code","barcode","cocoapods","ios","qrcode","qrcode-reader","roundcode","swift","swift-package-manager","xcode"],"created_at":"2024-11-14T17:10:42.035Z","updated_at":"2025-04-06T21:15:07.557Z","avatar_url":"https://github.com/aslanyanhaik.png","language":"Swift","readme":"# RoundCode for iOS\n\n[![License](http://img.shields.io/badge/License-MIT-green.svg?style=flat)](https://github.com/aslanyanhaik/RoundCode/blob/master/LICENSE)\n[![Swift 5](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://swift.org)\n[![Twitter: @aslanyanhaik](https://img.shields.io/badge/Contact-Twitter-blue.svg?style=flat)](https://twitter.com/aslanyanhaik)\n\n\nRoundCode is custom circular QR code with lots of customization. \nSimilar to Facebook messenger and Apple's App Clip Codes the RoundCode includes convenient camera scanner and decoder.\n\n\u003ch3 align=\"center\"\u003e\n\u003cimg src=\"appearance.png\" alt=\"Different styles of RoundCode for iOS\"/\u003e\n\u003c/h3\u003e\n\n## Installation\n\n### Cocoapods:\n\n```curl\npod 'RoundCode'\n```\n\n### Swift Package Manager:\n\nFile \u003e Swift Packages \u003e Add Package Dependency\n\n```swift\nhttps://github.com/aslanyanhaik/RoundCode\n```\n\n## Usage example\n\nimport framework\n\n```swift\nimport RoundCode\n```\n\n### Encoding\ncreate coder and encode\n\n```swift\nlet image = RCImage(message: \"Hello World\")\nlet coder = RCCoder()\ndo {\n  imageView.image = try coder.encode(image)\n} catch {\n  //handle errors\n}\n```\n\nYou can also validate the messsage before encoding\n\n```swift\nlet coder = RCCoder()\nlet isValidText = coder.validate(\"Hello world\")\n```\n\n### Decoding\n\nCreate instane of RCCameraViewController and handle the delegate\n\n```swift\nclass ViewController: UIViewController, RCCameraViewControllerDelegate {\n  \n  func scan() {\n    let cameraController = RCCameraViewController()\n    cameraController.delegate = self\n    present(cameraController, animated: true)\n  }\n  \n  func cameraViewController(didFinishScanning message: String) {\n    messageLabel.text = message\n  }\n}\n``` \n\nYou can also decode a UIImage like this\n\n```swift\nlet coder = RCCoder()\ndo {\n  messageLabel.text = try coder.decode(UIImage(named: code)!)\n} catch {\n  //handle errors\n}\n```\n\n## Appearance\n\nYou can change the appearance like this\n\n```swift\nvar image = RCImage(message: \"Hello world\")\nimage.contentInsets = UIEdgeInsets(top: 8, left: 10, bottom: 4, right: 10)\nimage.attachmentImage = UIImage(named: \"Profile\")\nimage.size = 300\nimage.gradientType = .linear(angle: CGFloat.pi)\nimage.tintColors = [.red, .black]\n```\nIf image is on dark background you should change scanning mode to `darkBackground`\n\n```swift\nlet coder = RCCoder()\ncoder.scanningMode = .darkBackground\n```\n\n## Advanced coding configuration\n\nYou can provide custom coding configuration in order to encode long text by reducing number of characters\n\n```swift\nlet configuration = RCCoderConfiguration.shortConfiguration\nlet coder = RCCoder(configuration: configuration)\n```\n\n```swift\nlet configuration = RCCoderConfiguration(characters: \" -abcdefghijklmnopqrstuvwxyz0123456789\")\nlet coder = RCCoder(configuration: configuration)\n```\n\n⚠️ If you are encoding with custom configuration, then you should change the RCCameraViewController configuration ⚠️\n\n```swift\nlet configuration = RCCoderConfiguration(characters: \" -abcdefghijklmnopqrstuvwxyz0123456789\")\nlet coder = RCCoder(configuration: configuration)\nlet camera = RCCameraViewController()\ncamera.coder = coder\n```\n\n## Compatibility\n\nWritten in Swift 5 and requires Xcode 11.0\n\nRoundCode is compatible with iOS 13.0+.\n\n\u003ch3 align=\"center\"\u003e\n\u003cimg src=\"screenshot.gif\" alt=\"Screenshot of RoundCode for iOS\"/\u003e\n\u003c/h3\u003e\n\n## Author\n\n* [Haik Aslanyan](https://twitter.com/aslanyanhaik)\n\n## License\n\nCopyright 2020 Haik Aslanyan.\n\nLicensed under MIT License: https://opensource.org/licenses/MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faslanyanhaik%2Froundcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faslanyanhaik%2Froundcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faslanyanhaik%2Froundcode/lists"}