onevcat / Kingfisher

A lightweight, pure-Swift library for downloading and caching images from the web.
MIT License
23.24k stars 2.66k forks source link

forSecurityApplicationGroupIdentifier kingfisher #981

Closed codebendr-product-designer closed 6 years ago

codebendr-product-designer commented 6 years ago

Am building a sticker app where images are cached in the main app and can also be accessed in the keyboard and iMessage extension.

I want to be able to access those images from kingfisher cache using grouped app feature.

Is this possible?

ludriv commented 6 years ago

You can do it your own by using the same container url in the main app and extensions.

let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "foo.bar.shared")!

KingfisherManager.shared.cache = ImageCache(name: "shared", path: containerURL.path)
codebendr-product-designer commented 6 years ago

Thank you for this.

Regards, Evans.

Sent from my iPhone 7

On Aug 24, 2018, at 7:56 AM, Ludovic Riviere notifications@github.com wrote:

You can do it your own by using the same container url in the main app and extensions.

let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "foo.bar.shared")!

KingfisherManager.shared.cache = ImageCache(name: "shared", path: containerURL.path) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

onevcat commented 6 years ago

👍 Thank you for sharing it @ludriv