{"id":28559040,"url":"https://github.com/sdwebimage/sdwebimagesvgnativecoder","last_synced_at":"2025-10-19T12:48:35.385Z","repository":{"id":52213377,"uuid":"520834522","full_name":"SDWebImage/SDWebImageSVGNativeCoder","owner":"SDWebImage","description":"SVG-Native (SVG OpenType) image coder plugin for SDWebImage","archived":false,"fork":false,"pushed_at":"2024-01-11T09:48:39.000Z","size":323,"stargazers_count":20,"open_issues_count":5,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-04T03:24:19.520Z","etag":null,"topics":["ios","macos","opentype-svg-fonts","sdwebimage","svg","svg-native","tvos","watchos"],"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/SDWebImage.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-03T10:25:53.000Z","updated_at":"2025-04-24T07:24:27.000Z","dependencies_parsed_at":"2024-01-29T10:19:37.769Z","dependency_job_id":null,"html_url":"https://github.com/SDWebImage/SDWebImageSVGNativeCoder","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"09a6199bbc0899c90382e734bbe07850eae2aa83"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageSVGNativeCoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageSVGNativeCoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageSVGNativeCoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageSVGNativeCoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SDWebImage","download_url":"https://codeload.github.com/SDWebImage/SDWebImageSVGNativeCoder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageSVGNativeCoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259039547,"owners_count":22796853,"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":["ios","macos","opentype-svg-fonts","sdwebimage","svg","svg-native","tvos","watchos"],"created_at":"2025-06-10T08:35:57.679Z","updated_at":"2025-10-19T12:48:30.352Z","avatar_url":"https://github.com/SDWebImage.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SDWebImageSVGNativeCoder\n\n[![CI Status](https://img.shields.io/travis/dreampiggy/SDWebImageSVGNativeCoder.svg?style=flat)](https://travis-ci.org/dreampiggy/SDWebImageSVGNativeCoder)\n[![Version](https://img.shields.io/cocoapods/v/SDWebImageSVGNativeCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageSVGNativeCoder)\n[![License](https://img.shields.io/cocoapods/l/SDWebImageSVGNativeCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageSVGNativeCoder)\n[![Platform](https://img.shields.io/cocoapods/p/SDWebImageSVGNativeCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageSVGNativeCoder)\n\n## Background\n\nCurrently SDWebImage org provide 3 kinds of SVG Coder Plugin support, here is comparison:\n\n| Plugin Name| Vector Image | Bitmap Image | Platform | Compatibility | Dependency |\n|---|---|---|---|---|---|\n| [SVGNativeCoder](https://github.com/SDWebImage/SDWebImageSVGNativeCoder) | NO | YES | iOS 9+ | Best and W3C standard | adobe/svg-native-viewer |\n| [SVGCoder](https://github.com/SDWebImage/SDWebImageSVGCoder) | YES | YES | iOS 13+ | OK but buggy on some SVG | Apple CoreSVG(Private) |\n| [SVGKitPlugin](https://github.com/SDWebImage/SDWebImageSVGKitPlugin) | YES | NO | iOS 9+ | Worst, no longer maintain | SVGKit/SVGKit                   \n\nFor now, I recommand to use this SVGNativeCoder (this repo) for most cases, until there are any other native support on Apple platforms.\n\n## SVG-Native\n\n[SVG Native](https://svgwg.org/specs/svg-native/) is an upcoming specification of the SVG WG based on [SVG OpenType](https://docs.microsoft.com/en-us/typography/opentype/spec/svg).\n\nSVG Native will be a strict subset of SVG 1.1 and SVG 2.0.\n\n## Requirements\n\n+ iOS 9+\n+ tvOS 9+\n+ macOS 10.11+\n+ watchOS 2+\n\n## Installation\n\n#### CocoaPods\n\nSDWebImageSVGNativeCoder is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'SDWebImageSVGNativeCoder'\n```\n\nNote:\n\nIt's strongly recommended to use CocoaPods v1.7+ with multiple Xcode Projects, which can avoid issues when different header file contains the same file name. This applys to all SDWebImage organization maintained repo.\n\n```ruby\ninstall! 'cocoapods', generate_multiple_pod_projects: true\n```\n\n#### Carthage\n\nSDWebImageSVGNativeCoder is available through [Carthage](https://github.com/Carthage/Carthage).\n\n```\ngithub \"SDWebImage/SDWebImageSVGNativeCoder\"\n```\n\n#### Swift Package Manager\n\nSDWebImageSVGNativeCoder is available through [Swift Package Manager](https://swift.org/package-manager).\n\n```swift\nlet package = Package(\n    dependencies: [\n        .package(url: \"https://github.com/SDWebImage/SDWebImageSVGNativeCoder.git\", from: \"0.1\")\n    ]\n)\n```\n\n## Usage\n\n### Register Coder Plugin\n\nTo use SVG coder, you should firstly add the `SDImageSVGNativeCoder` to the coders manager. Then you can call the View Category method to start load SVG images. See [Wiki - Coder Usage](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#coder-usage) here for these steps.\n\n+ Objective-C\n\n```objectivec\n// register coder, on AppDelegate\nSDImageSVGNativeCoder *SVGCoder = [SDImageSVGNativeCoder sharedCoder];\n[[SDImageCodersManager sharedManager] addCoder:SVGCoder];\n```\n\n+ Swift\n\n```swift\n// register coder, on AppDelegate\nlet SVGCoder = SDImageSVGNativeCoder.shared\nSDImageCodersManager.shared.addCoder(SVGCoder)\n```\n\n\n### Render SVG as bitmap image\n\nThis coder plugin only support bitmap SVG image, which means once you load an image, even you change the image view size, the image size will not dynamic change and has to stretch up and may be blur. So you'd better provide the suitable large enough image size (like your image view size).\n\nBy default it use the SVG viewBox size. You can also specify a desired size during image loading using `.imageThumbnailPixelSize` context option. And you can specify whether or not to keep aspect ratio during scale using `.imagePreserveAspectRatio` context option.\n\n+ Objective-C\n\n```objectivec\nUIImageView *imageView;\nCGSize bitmapSize = CGSizeMake(500, 500);\n[imageView sd_setImageWithURL:url placeholderImage:nil options:0 context:@{SDWebImageContextThumbnailPixelSize: @(bitmapSize)];\n```\n\n+ Swift\n\n```swift\nlet imageView: UIImageView\nlet bitmapSize = CGSize(width: 500, height: 500)\nimageView.sd_setImage(with: url, placeholderImage: nil, options: [], context: [.imageThumbnailPixelSize : bitmapSize])\n```\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Screenshot\n\n\u003cimg src=\"https://raw.githubusercontent.com/SDWebImage/SDWebImageSVGNativeCoder/main/Example/Screenshot/SVGDemo.png\" width=\"300\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/SDWebImage/SDWebImageSVGNativeCoder/main/Example/Screenshot/SVGDemo-macOS.png\" width=\"600\" /\u003e\n\n## Author\n\nDreamPiggy\n\n## License\n\nSDWebImageSVGNativeCoder 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%2Fsdwebimage%2Fsdwebimagesvgnativecoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdwebimage%2Fsdwebimagesvgnativecoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdwebimage%2Fsdwebimagesvgnativecoder/lists"}