Я пытаюсь реализовать набор инструментов набора карандашей (полоска карандаша, ластик и т. Д. c.), Который появляется в нижней части экрана. Однако после выполнения этой строки кода:
guard let window = view.window, let toolPicker = PKToolPicker.shared(for: window)
else {return}
В журнале появляется следующая ошибка, и средство выбора не появляется:
PDF Reader[926:85385] [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:0x60000191d450 UIView:0x7fdfb7376ff0.height == 75 (active)>",
"<NSLayoutConstraint:0x60000191d4a0 V:|-(0)-[UIView:0x7fdfb7376ff0] (active, names: '|':PKPaletteContainerView:0x7fdfb737b7e0 )>",
"<NSLayoutConstraint:0x60000191dae0 V:|-(0)-[PKPaletteContainerView:0x7fdfb737b7e0] (active, names: '|':UIView:0x7fdfb46181d0 )>",
"<NSLayoutConstraint:0x60000191dc70 PKPaletteContainerView:0x7fdfb737b7e0.bottom == UIView:0x7fdfb46181d0.bottom (active)>",
"<NSLayoutConstraint:0x600001901ea0 V:|-(0)-[UIView:0x7fdfb46181d0] (active, names: '|':PKPaletteView:0x7fdfb462d3e0 )>",
"<NSLayoutConstraint:0x600001901ef0 UIView:0x7fdfb46181d0.bottom == PKPaletteView:0x7fdfb462d3e0.bottom (active)>",
"<NSLayoutConstraint:0x6000019fcf00 PKPaletteView:0x7fdfb462d3e0.height == 122 (active)>",
"<NSLayoutConstraint:0x60000191d720 UIView:0x7fdfb7376ff0.bottom == PKPaletteContainerView:0x7fdfb737b7e0.bottom (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000191d450 UIView:0x7fdfb7376ff0.height == 75 (active)>
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.
Я не совсем уверен, как возиться с ограничениями PKPalette или с какими ограничениями противоречат ниже. Я также попытался отключить translatesAutoResizingMaskIntoConstraints, и он не работает, так как другие части моего приложения полагаются на него. Любая помощь приветствуется, спасибо!