27 lines
610 B
Swift
27 lines
610 B
Swift
|
//
|
||
|
// WrappedProgressView.swift
|
||
|
// Tusker
|
||
|
//
|
||
|
// Created by Shadowfacts on 8/30/20.
|
||
|
// Copyright © 2020 Shadowfacts. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import SwiftUI
|
||
|
|
||
|
struct WrappedProgressView: UIViewRepresentable {
|
||
|
typealias UIViewType = UIProgressView
|
||
|
|
||
|
let value: Double
|
||
|
let total: Double
|
||
|
|
||
|
func makeUIView(context: Context) -> UIProgressView {
|
||
|
return UIProgressView(progressViewStyle: .bar)
|
||
|
}
|
||
|
|
||
|
func updateUIView(_ uiView: UIProgressView, context: Context) {
|
||
|
if total > 0 {
|
||
|
uiView.setProgress(Float(value / total), animated: true)
|
||
|
}
|
||
|
}
|
||
|
}
|