Latest 1.0.7
License MIT
Platforms ios 8.0

Distributing image assets with a dynamic framework in iOS with Swift

This demo shows how to distribute image assets with a dynamic framework.

The trick is to to provide the bundle of the framework when referencing the asset.

Here an the example code from the framework that shows an image with name "Ocean":

let bundle = NSBundle(forClass: self)
let image UIImage(named: "Ocean", inBundle: bundle, compatibleWithTraitCollection: nil)

Distributing framework with Carthage

No special setup is needed for distributing your framework with the assets with Carthage.

Yay 💥🐰🐰🐰💥

Distributing framework with CocoaPods

Specify the assets folder location in resources property in the podspec file:

s.resources  = "MyLib/**/*.xcassets"


There are two ways you can add this demo framework to your project.

Setup with Carthage (iOS 8+)

Add github "marketplacer/AssetFrameworkDemo" ~> 1.0 to your Cartfile and run carthage update.

Setup with CocoaPods (iOS 8+)

If you are using CocoaPods add this text to your Podfile and run pod install.

pod 'ImageDemoLib', '~> 1.0'


Here is how you can get the image from the framework in your app:

import ImageDemoLib
imageView.image = MyImage.getImage()

Latest podspec

    "name": "ImageDemoLib",
    "version": "1.0.7",
    "license": {
        "type": "MIT"
    "homepage": "",
    "summary": "Demo iOS project that shows how to distribute image assets with dynamic framework on iOS.",
    "authors": {
        "Evgenii Neumerzhitckii": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.7"
    "source_files": "ImageDemoLib/**/*.swift",
    "resources": "ImageDemoLib/**/*.xcassets",
    "platforms": {
        "ios": "8.0"

Pin It on Pinterest

Share This