Tag: msmessage

如何在消息扩展中发送MSMessage?

我想实现一个imessage应用程序,但是对于消息框架和新的iMessage应用程序来说,新的东西没有太多的资源。 所以我正在关注WWDCvideo,并使用提供示例应用程序的 Apples来指导。 我有三个视图, MessageViewController处理几乎所有的function,然后CreateViewController和DetailsViewController 。 我只是试图从CreateViewController创build一个MSMessage ,并显示在DetailsViewController ..然后添加到数据。 但是,当我尝试创build数据时遇到了崩溃。 @IBAction func createAction(_ sender: AnyObject) { //present full screen for create list self.delegate?.createViewControllerDidSelectAdd(self as! CreateViewControllerDelegate) } 我试图传递的数据types是结构体中的字典: struct data { var title: String! var date: Date! var dictionary = ["title" : String(), "Array1" : [String](), "Array2" : [String]() ] as [String : Any] } 所以这里是如何build立的。 […]

正确地从MSMessagesAppViewController呈现一个UIAlertController

我想弄清楚如何在我的iMessage应用程序扩展中显示一个UIAlertController样式的UIAlertControllerStyleActionSheet 。 问题是,调用时出现的操作表出现在本机iMessage文本字段的下面: [self.view.window.rootViewController presentViewController:actionSheetController animated:YES completion:NULL]; 我怎么去解决这个问题? 码: UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Clear", nil) message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *clear = [UIAlertAction actionWithTitle:NSLocalizedString(@"Clear", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { [self clear]; }]; UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {}]; [actionSheetController addAction:clear]; [actionSheetController addAction:cancel]; [self.view.window.rootViewController presentViewController:actionSheetController animated:YES completion:NULL];