{"id":13992794,"url":"https://github.com/pocketsvg/PocketSVG","last_synced_at":"2025-07-22T16:32:15.728Z","repository":{"id":4157470,"uuid":"5271714","full_name":"pocketsvg/PocketSVG","owner":"pocketsvg","description":"Easily convert your SVG files into CGPaths, CAShapeLayers, and UIBezierPaths ","archived":false,"fork":false,"pushed_at":"2024-09-13T11:26:05.000Z","size":761,"stargazers_count":1664,"open_issues_count":8,"forks_count":239,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-10-29T12:39:35.583Z","etag":null,"topics":["cocoapods","ios","macos","objective-c","svg","svg-files","swift"],"latest_commit_sha":null,"homepage":"","language":"Objective-C++","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/pocketsvg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2012-08-02T11:27:10.000Z","updated_at":"2024-10-28T02:29:03.000Z","dependencies_parsed_at":"2022-08-06T15:15:10.050Z","dependency_job_id":"efb444a8-7496-41b8-b107-1d38bebf1920","html_url":"https://github.com/pocketsvg/PocketSVG","commit_stats":{"total_commits":374,"total_committers":43,"mean_commits":8.69767441860465,"dds":0.6122994652406417,"last_synced_commit":"10c6885e427e88d35fbb64010fbd6385cb58fef7"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketsvg%2FPocketSVG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketsvg%2FPocketSVG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketsvg%2FPocketSVG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocketsvg%2FPocketSVG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocketsvg","download_url":"https://codeload.github.com/pocketsvg/PocketSVG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227133900,"owners_count":17735823,"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":["cocoapods","ios","macos","objective-c","svg","svg-files","swift"],"created_at":"2024-08-09T14:02:08.353Z","updated_at":"2024-11-29T13:31:19.309Z","avatar_url":"https://github.com/pocketsvg.png","language":"Objective-C++","readme":"# PocketSVG\n\n[![Platforms](https://img.shields.io/badge/Platforms-macOS_iOS_tvOS_watchOS-green?style=flat-square)](https://img.shields.io/badge/Platforms-macOS_iOS_tvOS_watchOS-green?style=flat-square)\n[![Build Status](https://github.com/pocketsvg/pocketsvg/workflows/CI/badge.svg)](https://github.com/pocketsvg/PocketSVG/actions) \n[![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/PocketSVG.svg)](https://cocoapods.org/pods/PocketSVG) \n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) \n[![Code Coverage](https://img.shields.io/cocoapods/metrics/doc-percent/PocketSVG.svg)](http://cocoadocs.org/docsets/PocketSVG) \n[![code size](https://img.shields.io/github/languages/code-size/pocketsvg/pocketsvg.svg)](#) \n[![license](https://img.shields.io/github/license/pocketsvg/pocketsvg.svg)](https://github.com/pocketsvg/PocketSVG/blob/master/LICENSE)\n[![Swift Forums](https://img.shields.io/badge/Swift_Forums-PocketSVG-orange?style=flat-square)](https://youtu.be/iik25wqIuFo)\n\n\nA simple toolkit for displaying and manipulating SVGs on iOS and macOS in a performant manner.\n\nThe goal of this project is not to be a fully compliant SVG parser/renderer. But rather to use SVG as a format for serializing CG/UIPaths, meaning it only supports SVG features that can be represented by CG/UIPaths.\n\nThoroughly documented.\n\n## Features\n\n* Support for SVG elements: `path`, `line`, `polyline`, `polygon`, `rect`, `circle`, `ellipse`\n* Support for SVG named colors.\n* Fully working iOS and macOS demos.\n* Straightforward API for typical SVG rendering as a `UIImageView`/`NSImageView` or `CALayer` subclass.\n* Access every shape within your SVG as a `CGPath` for more fine-grained manipulation.\n\n\n## Installation\n\n### Swift Package Manager\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/pocketsvg/PocketSVG.git\", .upToNextMajor(from: \"2.6.0\"))\n]\n```\n\n### Cocoapods\n\nAdd this to your Podfile:\n```ruby\npod 'PocketSVG', '~\u003e 2.6'\n```\n\nThen run `pod install`\n\n### Carthage\n\nAdd this to your Cartfile:\n```\ngithub \"pocketsvg/PocketSVG\" \u003e= 2.7.2\n```\n\nThen run `carthage update --use-xcframeworks`\n\n## Usage\n\n### Render an SVG file using `SVGImageView`\n\n```swift\nlet url = Bundle.main.url(forResource: \"tiger\", withExtension: \"svg\")!\nlet svgImageView = SVGImageView.init(contentsOf: url)\nsvgImageView.frame = view.bounds\nsvgImageView.contentMode = .scaleAspectFit\nview.addSubview(svgImageView)\n```\n\n**Output**\n![image](https://user-images.githubusercontent.com/1756909/38315263-6664fe64-3828-11e8-8d49-1e0c52f3d4e2.png)\n\nNote: By default, SVGLayer has `shouldRasterize` set to `YES` when running on iOS. If you need to animate changes to the layer's transform you might want to reset that to `NO`.\n\n\n### Manually render each path of an SVG file using `CAShapeLayer`\n\n```swift\nview.backgroundColor = .white\n\nlet svgURL = Bundle.main.url(forResource: \"tiger\", withExtension: \"svg\")!\nlet paths = SVGBezierPath.pathsFromSVG(at: svgURL)\nlet tigerLayer = CALayer()\nfor (index, path) in paths.enumerated() {\n    let shapeLayer = CAShapeLayer()\n    shapeLayer.path = path.cgPath\n    if index%2 == 0 {\n        shapeLayer.fillColor = UIColor.black.cgColor\n    }\n    else if index%3 == 0 {\n        shapeLayer.fillColor = UIColor.darkGray.cgColor\n    }\n    else {\n        shapeLayer.fillColor = UIColor.gray.cgColor\n    }\n    tigerLayer.addSublayer(shapeLayer)\n}\n\nvar transform = CATransform3DMakeScale(0.4, 0.4, 1.0)\ntransform = CATransform3DTranslate(transform, 200, 400, 0)\ntigerLayer.transform = transform\nview.layer.addSublayer(tigerLayer)\n```\n\n**Output**\n![image](https://user-images.githubusercontent.com/1756909/38315982-f3f7017c-3829-11e8-9c7f-420eb15e727e.png)\n\n## Contributing\n\n### Bug Reports \u0026 Feature Requests\n\nPlease use the [issue tracker](https://github.com/arielelkin/pocketsvg/issues) to report any bugs or file feature requests.\n\n### Developing\n\nPRs are welcome.\n","funding_links":[],"categories":["Objective-C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocketsvg%2FPocketSVG","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocketsvg%2FPocketSVG","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocketsvg%2FPocketSVG/lists"}