1

I'm interested in doing something similar to this, however the component subviews of MFMessageComposeViewController are a much different than MFMailComposeViewController.

I figured out how to set focus to the input that let's you to type your message text by simply calling setRecipients: with an array containing a blank NSString. However, I'd like to paste non-text from the pasteBoard into the input, so I can't simply use setBody:.

Problem: What I need to do is get a reference to the actual text field that is the current first responder for my MFMessageComposeViewController. This way, I have a "sender" I can pass to UIPasteboard's paste: method. The problem is, I can't seem to walk the subview hierarchy the same way as MFMailComposeViewController, so I can't find out which view is first responder.

I've even tried this, but the view is always returned as nil if I do a [myMessageVC.view findFirstResponder]

Community
  • 1
  • 1
ThaDon
  • 7,826
  • 9
  • 52
  • 84

1 Answers1

3

Word of caution, you're not supposed to have your hands inside that view. Apple will refuse your app for doing so. You are only allowed to set the body and recipients.

Important The message composition interface itself is not customizable and must not be modified by your application. In addition, after presenting the interface, your application is unable to make further changes to the SMS content. The user can edit the content using the interface, but programmatic changes are ignored. Thus, you must set the values of content fields, if desired, before presenting the interface

http://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMessageComposeViewController_class/Reference/Reference.html

Daniel
  • 23,129
  • 12
  • 109
  • 154
  • Thanks. I guess I'll do without :( Look like the thing doesn't even share the generalPasteboard either! So I can't even instruct my users to paste an image I've set in the pasteboard :( – ThaDon Apr 14 '12 at 20:48