目前我找到了两种可能的解决方案:
1)从https://developer.apple.com/download/more/?q=xcode下载Xcode 11.3.1版本进行降级。
2)此UIButton扩展程序会破坏导航栏和工具栏中所有UIBarButton项。这只是我的情况,您可能有相同的重写函数会出现问题。
extension UIButton{
open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
return self.bounds.contains(point) ? self : nil
}
}