Using Xcode8 Beta my simulator crashes when using an inputAccessoryView and adding the line self.view.layoutIfNeeded() in the getter of the inputAccessoryView override. It works fine on my devices but this one line causes the simulator to crash everytime
override var inputAccessoryView: UIView? {
get {
self.view.layoutIfNeeded()
return customToolbar
}
}
The following message is displayed in the console:
libc++abi.dylib: terminating with uncaught exception of type NSException
If I just remove the line: self.view.layoutIfNeeded() it will work fine on the simulator. I need that line though or else the collectionView momentarily bounces as the inputAccessoryView keyboard change notification is called.
Copyright Notice:Content Author:「alionthego」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37881852/xcode8-beta-adding-self-view-layoutifneeded-in-inputaccessoryview-getter-causi