I followed your sample code but there's one catch. My button (that triggers the share sheet) is on a sheet as well. Not sure if that's causing the below issue:
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2022-07-08 15:19:09.297048+0100 Cluedo Notes[68004:12824046] [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.
(
"<NSLayoutConstraint:0x28029f200 _UIActivityActionCellTitleLabel:0x1293c41c0.height >= 22 (active)>",
"<NSLayoutConstraint:0x28029ecb0 UIView:0x1293c32e0.height >= _UIActivityActionCellTitleLabel:0x1293c41c0.height + 30 (active)>",
"<NSLayoutConstraint:0x2802881e0 'UIView-Encapsulated-Layout-Height' UIView:0x1293c32e0.height == 30 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x28029f200 _UIActivityActionCellTitleLabel:0x1293c41c0.height >= 22 (active)>
Any ideas on how to resolve this? This isn't causing any trouble to my app but I do not like to see messages on my console. Last but not least, thanks a mil for your sample code.
Using Swift 5 and iOS 15