Failed to set custom keyboard height for using any of the versions of xcode beta 3, beta 4, beta 5, beta 6

This question appeared in many places, but could not find an exact solution, I tried to include apple code in viewWillAppear, viewDidLoad, setNeedsUpdateConstraints, but nothing is useful even with the updated beta version below, this is the code

CGFloat _expandedHeight = 500;
NSLayoutConstraint *_heightConstraint = 
    [NSLayoutConstraint constraintWithItem: self.view 
                                 attribute: NSLayoutAttributeHeight 
                                 relatedBy: NSLayoutRelationEqual 
                                    toItem: nil 
                                 attribute: NSLayoutAttributeNotAnAttribute 
                                multiplier: 0.0 
                                  constant: _expandedHeight];
[self.view addConstraint: _heightConstraint];

Where exactly should I place the above code block?

Failed to snap current keyboard view due to low reputation

+2
source share

All Articles