我有一个使用iOSDFULibrary更新 BLE 设备的应用程序。
我有这个功能:
func dfuProgressDidChange(for part: Int, outOf totalParts: Int, to progress: Int, currentSpeedBytesPerSecond: Double, avgSpeedBytesPerSecond: Double) {
print("\t\(part)\t\(totalParts)\t\(progress)\t\(currentSpeedBytesPerSecond)\t\(avgSpeedBytesPerSecond)")
}
当更新正在进行时,我希望我的 UIProgressView 相应地移动progress
并在进度达到 100 时完全填充。
到目前为止,我所拥有的是:
@IBOutlet weak var progressView: UIProgressView!
progressView.progressViewStyle = .default
progressView.tintColor = .orange
progressView.progressTintColor = .orange
progressView.backgroundColor = .none
progressView.progress = Float(progress)
progressView.setProgress(100.0, animated: true)