This repository was archived by the owner on Oct 1, 2022. It is now read-only.
NukeUI 0.5
Pre-release
Pre-release
- Rework
LazyImageto useFetchImageon 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
LazyImagesupported platforms to iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 10.16 LazyImageon 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
LazyImageinitializer that takeImageContainer– useLazyImageViewdirectly 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
}