woltapp / blurhash

A very compact representation of a placeholder for an image.
https://blurha.sh
MIT License
15.84k stars 360 forks source link

Add SwiftUI and MacOS support to BlurHashDecode #214

Open kevin-hv opened 2 years ago

kevin-hv commented 2 years ago

Adding SwiftUI and MacOS support, so that people who develop to those platforms will also be able to use blurhash.

SwiftUI example of initialising an Image: Image(blurHash: "LGF5]+Yk^6#M@-5c,1J5@[or[Q6.", size: .init(width: 400, height: 200))

MacOS example of initialising an NSImage: NSImage(blurHash: "LGF5]+Yk^6#M@-5c,1J5@[or[Q6.", size: .init(width: 400, height: 200))

XCode SwiftUI Preview of 2 tiles with blurhash images: image