{"id":1186,"url":"https://github.com/Asana/Drawsana","last_synced_at":"2025-07-30T20:32:48.434Z","repository":{"id":37734414,"uuid":"146244882","full_name":"Asana/Drawsana","owner":"Asana","description":"An open source library that lets your users draw on things - mark up images with text, shapes, etc.","archived":false,"fork":false,"pushed_at":"2023-04-07T07:39:52.000Z","size":9019,"stargazers_count":649,"open_issues_count":30,"forks_count":102,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-11-14T16:40:03.936Z","etag":null,"topics":["asana","drawing","ios","markup","swift"],"latest_commit_sha":null,"homepage":"https://asana.github.io/Drawsana/","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/Asana.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-08-27T03:58:39.000Z","updated_at":"2024-10-25T14:41:06.000Z","dependencies_parsed_at":"2024-04-21T18:11:33.912Z","dependency_job_id":null,"html_url":"https://github.com/Asana/Drawsana","commit_stats":{"total_commits":152,"total_committers":10,"mean_commits":15.2,"dds":"0.17763157894736847","last_synced_commit":"3862163d899830cd0756f7b00d01628b6048ed9b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asana%2FDrawsana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asana%2FDrawsana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asana%2FDrawsana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asana%2FDrawsana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Asana","download_url":"https://codeload.github.com/Asana/Drawsana/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228187570,"owners_count":17882327,"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":["asana","drawing","ios","markup","swift"],"created_at":"2024-01-05T20:15:40.801Z","updated_at":"2024-12-04T20:31:06.167Z","avatar_url":"https://github.com/Asana.png","language":"Swift","funding_links":[],"categories":["Graphics"],"sub_categories":["Getting Started","Linter"],"readme":"#  Drawsana 0.12.0\n\nDrawsana is a generalized framework for making freehand drawing views on iOS. You can\nlet users scribble over images, add shapes and text, and even make your own tools.\n\nDo you want to let your users mark up images? Are you writing a simple painting app?\nDrawsana might work for you!\n\n[Demo source code](https://github.com/Asana/Drawsana/blob/master/Drawsana%20Demo/ViewController.swift)\n\n[Docs](https://asana.github.io/Drawsana)\n\n[Blog post: Let your users mark up images on iOS with Drawsana](https://blog.asana.com/2018/10/mark-up-images-ios-drawsana/)\n\n_Like what you see? [Come work with us!](https://asana.com/jobs/all#)_\n\n## Features\n\n* Built-in tools\n  * Pen with line smoothing\n  * Eraser\n  * Ellipse, rect, line, arrow\n  * Selection\n  * Text\n* Undo/redo\n* Drawings are `Codable`, so you can save and load them\n* Extensible—make your own shapes and tools without forking the library\n\n![screenshot](https://raw.githubusercontent.com/asana/Drawsana/master/demo.gif)\n\n## Installation\n\nAdd `Asana/Drawsana` to your Cartfile and update your project like you would for any other\nCarthage framework, or clone the source code and add the project to your workspace.\n\n```\ngithub \"Asana/Drawsana\" == 0.12.0\n```\n\n## Usage\n\n```swift\nimport Drawsana\n\nclass MyViewController: UIViewController {\n  let drawsanaView = DrawsanaView()\n  let penTool = PenTool()\n  \n  func viewDidLoad() {\n    /* ... */\n    drawsanaView.set(tool: penTool)\n    drawsanaView.userSettings.strokeWidth = 5\n    drawsanaView.userSettings.strokeColor = .blue\n    drawsanaView.userSettings.fillColor = .yellow\n    drawsanaView.userSettings.fontSize = 24\n    drawsanaView.userSettings.fontName = \"Marker Felt\"\n  }\n  \n  func save() {\n    let jsonEncoder = JSONEncoder()\n    jsonEncoder.outputFormatting = [.prettyPrinted, .sortedKeys]\n    let jsonData = try! jsonEncoder.encode(drawingView.drawing)\n    // store jsonData somewhere\n  }\n  \n  func load() {\n    let data = // load data from somewhere\n    let jsonDecoder = JSONDecoder()\n    let drawing = try! jsonDecoder.decode(Drawing.self, from: jsonData)\n    drawsanaView.drawing = drawing\n  }\n  \n  func showFinalImage() {\n    imageView.image = drawsanaView.render() \n  }\n}\n```\n\n## Background images\n\nDrawsana does not currently have a way to automatically show an image under your drawing.\nWe recommend that, like in the example class, you add a `UIImageView` underneath your\n`DrawsanaView` and make sure your `DrawsanaView`'s frame matches the image frame. When\nit's time to get the final image, use `DrawsanaView.render(over: myImage)`.\n\n## Building docs\n\n```sh\nsudo gem install jazzy\nmake docs\nopen .docs/index.html\n\npip install ghp-import\nmake publish-docs\nopen https://asana.github.io/Drawsana\n```\n\n## Changelog\n\n### 0.12.0\n* Undo operations are now accessible outside the framework to enable you to make undoable changes with your own UI.\n  - `AddShapeOperation`\n  - `RemoveShapeOperation`\n  - `ChangeTransformOperation`\n  - `EditTextOperation`\n  - `ChangeExplicitWidthOperation`\n* Fix drawing view not being redrawn after being resized.\n* Fix bugs related to color serialization.\n* Fix bugs related to text entry.\n\n### 0.11.0\n\n* `DrawingOperationStack.clearRedoStack()` clears all redo operations from the\n  redo stack.\n* `DrawingToolForShapeWithThreePoints` and \n  `DrawingToolForShapeWithTwoPoints` are declared `open` instead of `public` so\n  they can be subclassed.\n* `PenShape` now works with the selection tool.\n* `DrawsanaView.selectionIndicatorAnchorPointOffset` allows Drawsana to\nkeep working when you change the anchorPoint.\n* `Shape.id` is now settable.\n* Fix bug that prevented character input of some languages, including Chinese.\n* Fix bugs in gesture recognizer.\n\n### 0.10.0\n* Convert to Swift 5\n* Fix `NgonShape` and `TextShape` serialization bugs. Old data can't be fixed, but\n  new data will be correct.\n* Deserialization error reporting is more detailed. Shapes that find a JSON object with\n  the correct type will now throw errors instead of causing the whole operation to silently\n  fail, as long as you enable `Drawing.debugSerialization`.\n* Replacing `DrawingView.drawing` now behaves correctly instead of being unusably\n  buggy.\n* `PenLineSegment`'s members are now public.\n* `ShapeTransform` and `PenLineSegment` are now `Equatable`.\n\n### 0.9.4\n* Star, triangle, pentagon, and angle tools\n* `DrawsanaView.render()` accepts a `scale` parameter instead of always using zero\n\n### 0.9.2\n* Convert to Swift 4.2\n* CocoaPods support\n\n### 0.9.1\n\n* `DrawsanaView.selectionIndicatorViewShapeLayer` is exposed, allowing you to more\n  easily customize the appearance of the selection indicator\n* Changes to `DrawsanaView.selectionIndicatorView`'s style are animated in fewer\n  cases, which more closely matches user intent\n* Improved text tool use in the demo app\n\n### 0.9.0\n\nInitial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAsana%2FDrawsana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAsana%2FDrawsana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAsana%2FDrawsana/lists"}