iOS - 对MFMessageComposeViewController进行子类化以添加额外的功能 [英] iOS – Subclassing MFMessageComposeViewController to add extra functionality

查看:103
本文介绍了iOS - 对MFMessageComposeViewController进行子类化以添加额外的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经子类 RMMessageComposeViewController:MFMessageComposeViewController 。我正在瞄准的额外功能是 MFMessageComposeViewController 能够自己呈现一个新的消息组合控制器(自身)。

I have subclassed RMMessageComposeViewController : MFMessageComposeViewController. The extra functionality that I'm aiming for is for the MFMessageComposeViewController to be able by itself to present a new message compose controller (over itself).

所以我应该从一个 RMMessageComposeViewController 实例中提出一个新实例。应将新实例的消息结果发送给父实例(或旧实例)。所以我想我需要在创建子项时设置父消息compose controller作为委托(new)。

So I should from one RMMessageComposeViewController instance present a new one. The message result from the new instance should be sent to the parent (or "old" one). So I suppose I need to set the parent message compose controller as the delegate when I'm creating the child ("new" one).

有人可以帮我想一想,我需要添加哪些实例变量(父母,孩子?)如何设置子消息撰写控制器?

Could someone please help me think this out, what instance variables I need to add (parents, children?) How to setup the child message compose controller?

推荐答案

来自文档:


消息编写接口本身不可自定义,您的应用程序不得修改。此外,在显示界面后,您的应用程序无法对SMS内容进行进一步更改。

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.

您要尝试的内容由于安全问题,显然不支持:它可以使应用程序轻松伪造消息。虽然你可能会在它上面推出一个视图,但我怀疑你的应用程序会被App Store拒绝。

What you're trying to do there is explicitly not supported because of security concerns: It would make it easy for an application to forge messages. While you can probably push a view on top of it, I suspect your app would get rejected from the App Store for doing it.

如果MFMessageComposeViewController我不会感到惊讶防止应用程序一次创建多个实例,但我还没有确认这一点。

I wouldn't be surprised if MFMessageComposeViewController prevents an application from creating more than one instance at a time, though I haven't confirmed this.

这篇关于iOS - 对MFMessageComposeViewController进行子类化以添加额外的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆