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

How to render image? #17

Open
metrue opened this issue May 5, 2021 · 1 comment
Open

How to render image? #17

metrue opened this issue May 5, 2021 · 1 comment

Comments

@metrue
Copy link

metrue commented May 5, 2021

Thanks for building this great lib, but I could not find a example how to render a image, just tried with

![](https://picsum.photos/200/300.jpg)

but not working.

@dasautoooo
Copy link
Owner

dasautoooo commented May 13, 2021

Hi @metrue ,
Parma doesn't include any image rendering logic or related dependencies. You can use Kingfisher or SDWebImage to render an image whose link is provided by Parma.

For example:

func imageView(with urlString: String, altTextView: AnyView?) -> AnyView {
    AnyView(
        KFImage(URL(string: urlString))
            .resizable()
            .scaledToFit()
            .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
    )
}

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

No branches or pull requests

2 participants