I'm toying around with an image display within SwiftUI and decided to attach an Alert to activate if an image can't be found.
The following is the abridge code:
struct ContentView: View {
...
@State var image: URLImage = URLImage()
...
@State var showActionSheet = true
var body: some View {
ZStack {
Color.green
NavigationView {
VStack {
Button(action: {
self.url = "https://xxxx.org/\(Int.random(in: 0 ..< 10)).png"
self.image.imageLoader.load(url: URL(string: self.url)!)
}) {
Text("Get Random Image")
}
image.actionSheet(isPresented: $showActionSheet) {
ActionSheet(title: Text("Action Time"), message: Text("Greetings Ric!"), buttons:
[.default(Text("First Button"), action: {
print("First Button")
})])
}
}.navigationBarTitle(Text("Ric's Images"))
}
}
}
}
When I set the 'showAlertSheet' flag to 'true', I get the alert but also the compiler's constraint complaint:
2019-11-25 12:41:21.628064-0800 GetImages[32413:1078621] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "" )
Will attempt to recover by breaking constraint
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful.
The constraints are auto-generated.
How do I solve this?