Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

NukeUI 0.5

Pre-release
Pre-release
Compare
Choose a tag to compare
@kean kean released this 10 Jun 22:00
· 80 commits to main since this release
  • Rework LazyImage to use FetchImage on all platforms
  • Add new init(source:content:) initializer to LazyImage:
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 take ImageContainer – use LazyImageView 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
}