Closed hechukwu closed 5 years ago
InputBarButtonItem
is a subclass of UIButton
and conforms to the protocol InputItem
. So long as your left stack view items are all InputBarButtonItem
then you can try casting them: as? InputBarButtonItem
and that should resolve your error.
Thank you @travischapman for your help, you saved me days of debugging.
So what would be the final code? Still new is this kind of things.
self.messageInputBar.leftStackViewItems.forEach { item in guard let item = item as? InputBarButtonItem else { return } item.isEnabled = !self.isSendingPhoto }
Thanks!
I want to disable the leftStackViewItem when sending a photo, so I do this
self.messageInputBar.leftStackViewItems.forEach { item in item.isEnabled = !self.isSendingPhoto }
but I get this errorValue of type 'InputItem' has no member 'isEnabled'