{"id":18317513,"url":"https://github.com/alladinian/swiftprocessing","last_synced_at":"2025-07-23T10:34:21.011Z","repository":{"id":69146925,"uuid":"284018787","full_name":"alladinian/SwiftProcessing","owner":"alladinian","description":"A Processing Environment for Swift","archived":false,"fork":false,"pushed_at":"2022-04-30T20:37:21.000Z","size":2000,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T21:35:05.162Z","etag":null,"topics":["animation","graphics","ios","macos","processing","prototyping","swift","visual-arts"],"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/alladinian.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,"publiccode":null,"codemeta":null}},"created_at":"2020-07-31T11:15:59.000Z","updated_at":"2024-05-13T19:12:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"3bb57bc0-315b-4e61-be62-e0f30f686b3f","html_url":"https://github.com/alladinian/SwiftProcessing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alladinian/SwiftProcessing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alladinian%2FSwiftProcessing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alladinian%2FSwiftProcessing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alladinian%2FSwiftProcessing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alladinian%2FSwiftProcessing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alladinian","download_url":"https://codeload.github.com/alladinian/SwiftProcessing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alladinian%2FSwiftProcessing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266663046,"owners_count":23964675,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["animation","graphics","ios","macos","processing","prototyping","swift","visual-arts"],"created_at":"2024-11-05T18:06:23.603Z","updated_at":"2025-07-23T10:34:20.995Z","avatar_url":"https://github.com/alladinian.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftProcessing\nA [Processing](https://processing.org/) Environment for Swift\n\n\u003e Please note that the project is under active development, so it is subject to frequent changes. \n\n![workflow status](https://github.com/alladinian/SwiftProcessing/workflows/Swift/badge.svg)\n\n## What is it?\nThis project is an attempt to maintain the same Processing-style prototyping experience as much as possible. It also tries to follow the original apis in order to achieve sketch compatibility with minimal changes. It is _not_ a Swift Processing mode and is not affiliated with the Processing Foundation.\n\n## What can I do with it?\nWell, I think this quote from the Processing website offers an excellent intro:\n\n\u003e Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology. There are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning and prototyping.\n\nMy personal motivation \u0026 inspiration for getting involved with this project was mainly [Daniel Shiffman](https://shiffman.net/)'s [excellent video series](https://www.youtube.com/c/TheCodingTrain/featured) (especially Coding Challenges \u0026 Nature of Code). \nIf you've never watched any of Daniel's videos go ahead and do so, you wont regret it.\n\n## Installation \u0026 Usage\nThis project is in the form of a Swift Package, supporting both iOS (v10+) \u0026 macOS (v10.12+). The package have no external dependencies.\n\nPart of Processing's appeal is the simplicity \u0026 how quickly you can prototype ideas. In order to achieve a similar experience, I wanted to be able to compile sketches quickly without even opening Xcode if possible. \n\nSo here is a workflow that I found to be working quite well (if you know a better way you are welcome to contribute or let me know):\n\n1. Install [swift sh](https://github.com/mxcl/swift-sh)\n\n   `brew install swift-sh`\n\n   or\n\n   `mint install mxcl/swift-sh`\n\n   This will enable importing of packages in a Swift file.\n\n2. Import `SwiftProcessing` in a .swift file in the editor of your choice and write a sketch:\n\n```swift\n#!/usr/bin/swift sh\n\nimport Cocoa\nimport SwiftProcessing // @alladinian\n\nclass FractalTreeSketch: SPSView {\n\n    var angle: CGFloat!\n    var slider: Slider!\n\n    override func setup() {\n        slider = createSlider(0, TWO_PI, PI/4, 0.01)\n    }\n\n    override func draw() {\n        strokeWeight(1)\n        background(20)\n        angle = CGFloat(slider.doubleValue)\n        stroke(255)\n        translate(width/2, height)\n        branch(height * 0.3)\n    }\n\n    func branch(_ len: CGFloat) {\n        line(0, 0, 0, -len)\n        translate(0, -len)\n        if len \u003e 4 {\n            push()\n            rotate(angle)\n            branch(len * 0.67)\n            pop()\n            push()\n            rotate(-angle)\n            branch(len * 0.67)\n            pop()\n        }\n    }\n}\n\nlet sketch = FractalTreeSketch(size: .init(width: 400, height: 400))\n\nlaunchSketch(sketch)\n```\n\nFinally, execute the sketch file:\n\n`$ swift sh mySketch.swift`\n\nor\n\n`$ chmod u+x mySketch.swift`\n`$ ./mySketch.swift`\n\nThis will launch a window and run your sketch.\n\n![tree](https://i.ibb.co/c18BBRY/Fractal-Tree.gif)\n\nThere are some examples also included in the package, such as this beautiful noise wave\n\n![noisewave](https://i.ibb.co/Wsjjx9W/Noise-Wave.gif)\n\n## Technical Details\nThe current implementation relies on `CoreGraphics` to perform drawing and `CADisplayLink` / `CVDisplayLink` for screen updates. \nEventually different renderers could be used with a protocol oriented approach for possible improvements in performance.\nAnother significant missing piece is glsl shaders and 3D support. We could leverage `SpriteKit` \u0026 `SceneKit` for that.\n\n## Supported Features\nSee the dedicated [wiki page](https://github.com/alladinian/SwiftProcessing/wiki/Supported-Features) for currently supported features.\n\n## Author\nVasilis Akoinoglou, alladinian@gmail.com  \nTwitter: @alladinian\n\n## License\n\n**SwiftProcessing** is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falladinian%2Fswiftprocessing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falladinian%2Fswiftprocessing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falladinian%2Fswiftprocessing/lists"}