DAKeyboardControl icon indicating copy to clipboard operation
DAKeyboardControl copied to clipboard

MFMessageComposeViewController broken on iOS 5

Open manuelkasper opened this issue 12 years ago • 2 comments

Merely including DAKeyboardControl in a project breaks MFMessageComposeViewController under iOS 5: when the view appears, the message text input field is not visible. If a list of recipients has also been set via code, then the text field appears initially, but disappears as soon as the user taps the recipient field.

It seems that the "null" input accessory view that DAKeyboardControl sets interacts badly with MFMessageComposeViewController. I've been able to fix the missing input field with the following ugly hack. Not sure if this is the right way though:

- (void)swizzled_addSubview:(UIView *)subview
{
    if (([subview isKindOfClass:[UITextView class]] || [subview isKindOfClass:[UITextField class]]) &&
        strcmp(object_getClassName(subview), "MFRecipientTextField") != 0)
    {

No problems on iOS 6, presumably due to the new remote view controllers.

dak_test_mfmsgview

manuelkasper avatar Dec 25 '12 10:12 manuelkasper

Thanks for bringing this to my attention. I do not have access to a physical iOS5 device at the moment, but will debug when I am able to.

danielamitay avatar Dec 26 '12 23:12 danielamitay

Same over here. even on iOS 6 it doesn't work for me. The log says: "Application tried to push a nil view controller on target <MFMessageComposeViewController: 0x14081e30>."

Mojo90 avatar Jan 15 '13 09:01 Mojo90