Simple UIContextMenuConfiguration causes Unable to simultaneously satisfy constraints

Hi.
I created a simple ContextMenu in a collectionView

Code Block    override func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
    let configuration = UIContextMenuConfiguration(identifier: nil, previewProvider: nil){ action in
      let delete = UIAction(title: "Delete", image: UIImage(systemName: "trash.fill"), identifier: nil,discoverabilityTitle: nil, attributes: .destructive, handler: {action in
        self.deleteItem(index: indexPath.item)
      })
       
      return UIMenu(title: "", image: nil, identifier: nil, children: [delete])
    }
     
    return configuration
  }


and it causes the following warning in the console.

Code Block
020-07-16 22:58:16.227394+0200 RunPersonalRecord[8410:2186970] [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)
"<NSAutoresizingMaskLayoutConstraint:0x280eec230 h=--& v=--& UIInterfaceActionGroupView:0x1658ca700.height == 0 (active)>",
"<NSLayoutConstraint:0x280ed7e80 groupView.actionsSequence....height >= 44 (active, names: groupView.actionsSequence...:0x158340200 )>",
"<NSLayoutConstraint:0x280ed4a00 UIInterfaceActionGroupView:0x1658ca700.top == _UIContentConstraintsLayoutGuide:0x157d4dae0''.top (active)>",
"<NSLayoutConstraint:0x280ed4140 V:[_UIContentConstraintsLayoutGuide:0x157d4dae0'']-(0)-| (active, names: '|':UIInterfaceActionGroupView:0x1658ca700 )>",
"<NSLayoutConstraint:0x280ed6710 groupView.actionsSequence....top == _UIContentConstraintsLayoutGuide:0x157d4dae0''.top (active, names: groupView.actionsSequence...:0x158340200 )>",
"<NSLayoutConstraint:0x280ed6760 groupView.actionsSequence....bottom == _UIContentConstraintsLayoutGuide:0x157d4dae0''.bottom (active, names: groupView.actionsSequence...:0x158340200 )>") Will attempt to recover by breaking constraint <NSLayoutConstraint:0x280ed7e80 groupView.actionsSequence....height >= 44 (active, names: groupView.actionsSequence...:0x158340200 )>

I found 2 projects on GitHub with same functionality and both cause the problem i described.
Could it be an apple bug or it is possible to fix somehow? Thanks!



Answered by junkpile in 621833022
Apparently this is just a bug in iOS. Other posters have claimed you can safely ignore the warnings. Here’s a recent thread on it: https://developer.apple.com/forums/thread/651992
Accepted Answer
Apparently this is just a bug in iOS. Other posters have claimed you can safely ignore the warnings. Here’s a recent thread on it: https://developer.apple.com/forums/thread/651992
thanks for the answer!
Simple UIContextMenuConfiguration causes Unable to simultaneously satisfy constraints
 
 
Q