Xcode8 beta adding self.view.layoutIfNeeded() in inputAccessoryView getter causing crash
NickName:alionthego Ask DateTime:2016-06-17T20:41:38

Xcode8 beta adding self.view.layoutIfNeeded() in inputAccessoryView getter causing crash

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

More about “Xcode8 beta adding self.view.layoutIfNeeded() in inputAccessoryView getter causing crash” related questions

Xcode8 beta adding self.view.layoutIfNeeded() in inputAccessoryView getter causing crash

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...

Show Detail

CollectionViewController not adjusting for keyboard showing with InputAccessoryView

I have a chat page in my app, and am using an InputAccessoryView for the textfield. When the keyboard opens and closes the textfield follows the keyboard and looks great. The issue is that when the

Show Detail

how to authorize callkit in xcode8 beta 6

How to authorize callkit, CXProvider.authorizationStatus is not avilable in latest version of xcode8 beta. let cxpor = CXProvider(configuration: conf) cxpor?.setDelegate(self, queue:

Show Detail

AnyObject not working in Xcode8 beta6?

In Xcode8 beta6, the following code will cause a warning: 'is' test is always true. But it won't print pass. struct TestStruct { } //warning: 'is' test is always true if TestStruc...

Show Detail

AnyObject not working in Xcode8 beta6?

In Xcode8 beta6, the following code will cause a warning: 'is' test is always true. But it won't print pass. struct TestStruct { } //warning: 'is' test is always true if TestStruc...

Show Detail

InputAccessoryView causing EXC_BAD_ACCESS on UITextview resignFirstResponder

I'm using an inputAccessoryView with a next and a done button, to help manage to keyboard. However, I've run into a problem, where every so often the app will crash with an EXC_BAD_ACCESS error whe...

Show Detail

move collection view chats up when inputAccessoryView appears

I am working with chat screens where I have a InputAccessoryView where user type message and UICollectionView which contains chats. I want to display latest chat message when user send it in

Show Detail

xcode8 beta4 not generating the managedObjectContext

I am using a blank core data proj and trying to copy the code from this examples. https://www.and rewcbancroft.com/2015/02/18/core-data-cheat-sheet-for-swift-ios-developers/ As there is no

Show Detail

How to "Delete derived data" in Xcode8?

In Xcode7 you click Window -> Projects and select the projects that you want the derived data to be deleted. But with Xcode8 beta 2 the project menu no longer exists under the Windows menu. Are th...

Show Detail

inputAccessoryView not showing above keyboard

Problem relates to this. I'm trying to use a custom view that I made that has two TextField inputs and a button, I made it using IB its xib, I've placed it in my story board and have it set to be a...

Show Detail