/SDWebImageSVGCoder-Swift

SVG coder plugin for SDWebImage, using Macaw/SwiftSVG

Primary LanguageSwiftMIT LicenseMIT

SDWebImageSVGCoder

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8+

Installation

SDWebImageSVGCoder is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SDWebImageSVGCoder'

Usage

To use SVG coder, you should firstly add the SDImageSVGCoder to the coders manager. Then you can call the View Category method to start load SVG images.

  • Objective-C
SDImageSVGCoder *SVGCoder = [SDImageSVGCoder sharedCoder];
[[SDImageCodersManager sharedManager] addCoder:SVGCoder];
UIImageView *imageView;
[imageView sd_setImageWithURL:url];
  • Swift
let SVGCoder = SDImageSVGCoder.shared
SDImageCodersManager.shared.addCoder(SVGCoder)
let imageView: UIImageView
imageView.sd_setImage(with: url)

Screenshot

Author

DreamPiggy

License

SDWebImageSVGCoder is available under the MIT license. See the LICENSE file for more info.