This repository has been archived by the owner on Oct 1, 2022. It is now read-only.
NukeUI 0.5
Pre-release
Pre-release
- Rework
LazyImage
to useFetchImage
on all platforms - Add new
init(source:content:)
initializer toLazyImage
:
LazyImage(source: $0) { state in
if let image = state.image {
image // Displays the loaded image
} else if state.error != nil {
Color.red // Indicates an error
} else {
Color.blue // Acts as a placeholder
}
}
- Add default placeholder to
LazyImage
(gray background) - Temporarily increase
LazyImage
supported platforms to iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 10.16 LazyImage
on watchOS now has an almost complete feature parity with other platforms. The main exception is the support for animated images which is currently missing.- Remove
LazyImage
initializer that takeImageContainer
– useLazyImageView
directly instead - Add infrastructure for registering custom rendering engines:
import SwiftSVG
// Affects both all `LazyImage` and `LazyImageView` instances
LazyImageView.registerContentView {
if $0.type == .svg, let string = $0.data.map( {
UIView(SVGData: data)
}
return nil
}