tauri-plugin-system-components 0.1.4

Native system UI components for Tauri 2 — native iOS tab bar over the webview, native controls, and glass window backgrounds on macOS/iOS.
Documentation
//
//  ProgressComponent.swift
//  tauri-plugin-system-components
//

import UIKit

/// UIProgressView — display only.
enum ProgressComponent: ComponentBuilder {
    static func make(_ args: CreateComponentArgs, _ ctx: ComponentContext) -> UIView? {
        let props = args.props
        let control = UIProgressView(progressViewStyle: .default)
        control.progress = Float(props?.value ?? 0)
        if let tint = props?.tint.flatMap(ColorUtil.from(hex:)) {
            control.progressTintColor = tint
        }
        return control
    }

    static func update(_ control: UIView, _ props: ComponentPropsArgs) {
        if let progress = control as? UIProgressView, let value = props.value {
            progress.setProgress(Float(value), animated: true)
        }
    }
}