fix gif caching
This commit is contained in:
1 parent
71b1d0a21d
commit
395cbe5e13
19 files changed
+728
-475
No files matched your search
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// File.swift
|
||||
//
|
||||
//
|
||||
// Created by Igor Ferreira on 05/04/2022.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct GIFImageEnvironment: EnvironmentKey {
|
||||
static var defaultValue: ImageLoader = {
|
||||
return ImageLoader()
|
||||
}()
|
||||
}
|
||||
|
||||
extension EnvironmentValues {
|
||||
var imageLoader: ImageLoader {
|
||||
get { self[GIFImageEnvironment.self] }
|
||||
set { self[GIFImageEnvironment.self] = newValue }
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
@ViewBuilder
|
||||
func with(imageLoader: ImageLoader) -> some View {
|
||||
environment(\.imageLoader, imageLoader)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user