progress bar percentage is been treated as Double for two decimal places(Like 54.17) in iOS JSON object, due to that progress percentage is not shown, where as working on Android.

So, changing Float to Double.
This commit is contained in:
Khan, Arshad 2019-12-18 21:20:58 +05:30
parent 6cc31113f7
commit 95c528b658

View File

@ -54,8 +54,8 @@ import Foundation
if let thickness = json?.optionalCGFloatForKey("thickness") {
self.thickness = thickness
}
if let percentage = json?["percent"] as? Float {
progress = percentage/100.0
if let percentage = json?["percent"] as? Double {
progress = Float(percentage/100.0)
}
if let progressColor = json?.optionalStringForKey("progressColor") {
progressTintColor = UIColor.mfGet(forHex: progressColor)