Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Data Assets #454

Closed
417-72KI opened this issue Sep 28, 2018 · 2 comments · Fixed by #766
Closed

Support for Data Assets #454

417-72KI opened this issue Sep 28, 2018 · 2 comments · Fixed by #766

Comments

@417-72KI
Copy link
Contributor

Introduction

Asset Catalog supports Data Assets from macOS 10.11/iOS 9.0.
Data Assets can use with NSDataAsset.

Here is a document.
https://developer.apple.com/documentation/uikit/nsdataasset

Subject

Now

I'm using animation.gif in Assets.xcassets with below.

if let asset = NSDataAsset(name: "animation.gif") {
    let data = asset.data
    let animationImage = imagesFromAnimationGif(data)
}

func imagesFromAnimationGif(_ data: Data) -> UIImage {
    // parse data
}

Hope

I want call animation.gif via R.swift like below.

let data = R.data.animation_gif
let animationImage = imagesFromAnimationGif(data)
@giulio92
Copy link

I would also like this feature!

@isaac-weisberg
Copy link

In real programming, usage of Data Assets is immensely rare, and right now, for the first time in 5 years I would've had use of this feature, probably for the last time in my life :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants