1

I need to check if MFMessageComposeViewController is currently visible. How can I do that?

What I'm doing right now is:

//Get the current visible view controller
ViewController *visible = ...

if([visible isKindOfClass:[MFMessageComposeViewController class]])
// This doesn't work because the class is actually CKSMSComposeController

And I can't check for CKSMSComposeController then Xcode will complain about "Use of undeclared identifier 'CKSMSComposeController'"

Peter Warbo
  • 11,136
  • 14
  • 98
  • 193

2 Answers2

1

Adding a boolean after you have presented the modal view controller is the easiest way.

Peter Warbo
  • 11,136
  • 14
  • 98
  • 193
1

If you check your visible controller's parentViewController property, it's class should be MFMessageComposeViewController class (at least in iOS 7).

Jeff Mascia
  • 564
  • 1
  • 6
  • 11