I asked this in stackoverflow as well but I thought I would ask it here too.
I was under the assumption that SwiftUI no longer uses NSLayoutContstraints. However I am getting constraint errors in console. Anyone have any idea how to debug?
The following prints out if with the list view when I open the context menu:
2019-12-09 10:52:52.029091-0700 ContextMenuTest[26384:13138419] [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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "", "= 44 (active, names: groupView.actionsSequence...:0x7fd98781de00 )>", "", "", "", "" )
Will attempt to recover by breaking constraint = 44 (active, names: groupView.actionsSequence...:0x7fd98781de00 )>
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.
struct ContentView: View {
var body: some View {
List {
Text("one")
Text("two")
.contextMenu(menuItems: {
Text("test")
})
}
}
}