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

Crash when using custom image decoder for svg (Swift 6) #827

Open
tolteste opened this issue Dec 27, 2024 · 0 comments
Open

Crash when using custom image decoder for svg (Swift 6) #827

tolteste opened this issue Dec 27, 2024 · 0 comments

Comments

@tolteste
Copy link

I am trying to transition my codebase to swift 6. However, I am getting a crash in Nuke library when compiled with Swift version 6. The crash happens when I am trying to load an svg image. For decoding svg images I am using SwiftSVG library. To use the library I am registering a decoder for a svg context upon app startup:

ImageDecoderRegistry.shared.register { context in
            let isSVG = context.urlResponse?.url?.absoluteString.lowercased().hasSuffix(".svg") ?? false
            return isSVG ? ImageDecoders.Empty(assetType: .svg) : nil
        }

When I then go to a screen that needs to load an svg image I get the following error:

image

Everything works as expected when app is compiled under Swift version 5. Crash is still happening when I try registering just a simple decoder closure like this:

ImageDecoderRegistry.shared.register { context in
            return nil
        }

Any idea what could I be doing wrong? Thanks a lot!

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

1 participant