GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

Day 17: Constraints error when adding toolbar "Done" button

Forums > 100 Days of SwiftUI

Using XCode 14.3 with an iPhone 14 Pro simulator I'm getting a constraints error when putting focus into the TextField after adding the "Done" button to the keyboard. This causes the decimal keypad not to show up. Any idea how to do this properly on iOS 16?

2023-04-08 21:53:56.778052-0500 WeSplit[24267:1959792] Can't find keyplane that supports type 8 for keyboard iPhone-PortraitChoco-DecimalPad; using 27344_PortraitChoco_iPhone-Simple-Pad_Default 2023-04-08 21:53:56.877824-0500 WeSplit[24267:1959792] [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:0x600002c912c0 h=--& v=--& _UIToolbarContentView:0x7fafc2f25990.width == 0 (active)>", "<NSLayoutConstraint:0x600002c86da0 H:|-(0)-[_UIButtonBarStackView:0x7fafc2f2ae30] (active, names: '|':_UIToolbarContentView:0x7fafc2f25990 )>", "<NSLayoutConstraint:0x600002c86df0 H:[_UIButtonBarStackView:0x7fafc2f2ae30]-(16)-| (active, names: '|':_UIToolbarContentView:0x7fafc2f25990 )>" )

Will attempt to recover by breaking constraint <NSLayoutConstraint:0x600002c86df0 H:[_UIButtonBarStackView:0x7fafc2f2ae30]-(16)-| (active, names: '|':_UIToolbarContentView:0x7fafc2f25990 )>

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.

2      

Check out this On Log Noise

2      

Thanks, the constraints error prevents the decimal pad from showing up, I only see the "Done" toolbar item come up in the screen. It goes away once I remove the toolbar item code.

2      

Hacking with Swift is sponsored by Proxyman.

SPONSORED Debug 10x faster with Proxyman. Your ultimate tool to capture HTTPs requests/ responses, natively built for iPhone and macOS. You’d be surprised how much you can learn about any system by watching what it does over the network.

Try Now!

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.