Skip to content
Discussion options

You must be logged in to vote

Found the answer in reusable offline downloads example. Here is the code if anyone is interested.

public struct ResourceLoader {
    public enum Action: Equatable {
        case loaded
        case updateProgress(Double)
        case updateProgressMessage(String)
    }

    var load: (_ id: AnyHashable, _ tags: Set<String>, _ bundle: Bundle) -> Effect<Action, Error>
    var cancel: (_ id: AnyHashable) -> Effect<Never, Never>
}

public extension ResourceLoader {
    static let live = Self { id, tags, bundle in
        .run { subscriber in
            let request = NSBundleResourceRequest(tags: tags, bundle: bundle)
            request.loadingPriority = NSBundleResourceRequestLoadingPriorit…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@stephencelis
Comment options

Answer selected by surajbarkale
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants