Latest 1.0.1
Homepage https://github.com/pouyayarandi/EasySVG
License MIT
Platforms ios 11.0
Authors

EasySVG

EasySVG is a framework written in swift for loading vector assets in UIImageView. this framework uses WebKit‘s WKWebView for loading vectors.

EasySVG

Add to project

cocoapods: add this line to your Podfile:

pod 'EasySVG'

and then run pod install

manually: also you can add this framework to your project by downloading the source.

How to use

it’s really simple. just add vector file to your project with drag and drop. then add the following code for your UIImageView in ViewController

imageView.setSVG("YOUR_VECTOR_NAME")

also this framework has some other features

Other methods

you can call setSVG() method with other arguments:

  • with url of vector file:
    if let url = Bundle.main.url(forResource: "like", withExtension: "svg") {
    imageView.setSVG(url)
    }
  • with an optional overlay color:
    imageView.setSVG("crown", withColor: .red)

    Cache vectors

    EasySVG caches vectors for better performance. if you want to enable this feature you can add following code to your AppDelegate‘s didFinishLaunchingWithOptions method:

    EasySVG.allowCache = true

    also you can remove cached vectors using removeCache() method

    EasySVG.removeCache()

    Storyboard and XIB

    in Storyboard and XIB you can use EasyImageView as an outlet. this class is subclass of UIImageView and you can use it instead of a normal image view.

add EasyImageView and EasySVG as class and module of your UIImageView
identity inspector tab

then set EasyImageView attributes in the attribute inspector tab
attribute inspector tab

Support us

support us with click on star icon. thanks ❤️

License

MIT

Latest podspec

{
    "name": "EasySVG",
    "version": "1.0.1",
    "summary": "A Swift framework for loading vectors in UIImageView",
    "swift_version": "4.2",
    "homepage": "https://github.com/pouyayarandi/EasySVG",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": {
        "pouya yarandi": "[email protected]"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source": {
        "git": "https://github.com/pouyayarandi/EasySVG.git",
        "tag": "1.0.1"
    },
    "source_files": "EasySVG"
}

Pin It on Pinterest

Share This