ProgressView not visible in ios14

Hi,
Anyone facing problem with progressview not showing in ios 14. I have used Xcode 12 beta 6 and 7 to create new advanced widget and i wanted to show progressview but a yellow image with red cross is being shown. Tried this
VStack(alignment: .leading, spacing: nil, content: {
ProgressView()
}
OR
VStack(alignment: .leading, spacing: nil, content: {
ProgressView("Downloading", 50, 100)
}
This shows only "Downloading" and not horizontal bar.
Am i missing something? Watched mainy videos where it was working and they were using xcode 12 beta 2 or 3
Answered by iosDeveloperr in 633008022
Forgot to mention in question it was not working in widgetKit.

Found this https://stackoverflow.com/questions/62835019/progressview-in-ios-14-widget-causing-fatal-error

Solution

So made a CustomProgressView for my problem

struct CustomProgressView: View {
var body: some View {
ZStack {
ZStack {
}
.frame(width: 300, height: 6, alignment: .center)
.background(RoundedRectangle(cornerRadius: 3)
.fill(Color.blue))
ZStack(alignment: Alignment(horizontal: .leading, vertical: .center), content: {
Code Block
})
.frame(width: 100, height: 6, alignment: .center)
.background(RoundedRectangle(cornerRadius: 3)
.fill(Color.green))
}
}
}

Not sure it's your problem, but the latest beta release notes say this...


SwiftUI
...Known Issues
......ProgressView generic type signature has changed, adding the ProgressViewStyleConfiguration.CurrentValueLabel generic parameter. This change does not require any source changes, but will cause apps you compile using an earlier beta SDK to quit unexpectedly. (63580200)

You might want to file bugs and wait for next beta/release.
Thanks. Will do it.
Accepted Answer
Forgot to mention in question it was not working in widgetKit.

Found this https://stackoverflow.com/questions/62835019/progressview-in-ios-14-widget-causing-fatal-error

Solution

So made a CustomProgressView for my problem

struct CustomProgressView: View {
var body: some View {
ZStack {
ZStack {
}
.frame(width: 300, height: 6, alignment: .center)
.background(RoundedRectangle(cornerRadius: 3)
.fill(Color.blue))
ZStack(alignment: Alignment(horizontal: .leading, vertical: .center), content: {
Code Block
})
.frame(width: 100, height: 6, alignment: .center)
.background(RoundedRectangle(cornerRadius: 3)
.fill(Color.green))
}
}
}

I have created the custom progress view, which can be easily used in SwiftUI Widget

https://github.com/shubham14896/swiftUI_widget_progress_bar
ProgressView not visible in ios14
 
 
Q