本文介绍了ios 10中的Sirikit和父应用程序通信:切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Sirikit与我的付款域应用程序集成,需要与该应用程序进行交互.在阅读Apple文档时,他们要求使用通用框架.可以使用越区切换吗?如果是,那怎么办?如何从sirikit调用父应用程序中的另一个viewController?

I am using Sirikit to integrate with my payment domain app where I need to interact with the app. I read Apple documentation, they asked to use common frameworks.Is it possible to use handoff? if yes then how? How can I call the other viewController which is in parent app from sirikit?

我将非常感谢您的帮助.谢谢

I will really appreciate for any help. Thanks

推荐答案

检查 SiriKit编程指南

要使用切换,可以使用NSUserActivity对象创建意图响应对象.在创建NSUserActivity对象时,将userInfo属性分配给所需的适当对象,

To use handoff, You can create intent response object with NSUserActivity object. While creating NSUserActivity object assign userInfo property to appropriate object that you want,

let userActivity = NSUserActivity()
userActivity.userInfo = ["myKey": myAnyObject]

您将在父应用程序AppDelegate中获得此NSUserActivity对象,

You will get this NSUserActivity object in parent application AppDelegate,

optional public func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Swift.Void) -> Bool

在这里您可以获得userInfo对象,可以根据需要对其进行比较并调用适当的viewController.

Here you can get userInfo object which you can compare as per your requirement and call appropriate viewController.

这篇关于ios 10中的Sirikit和父应用程序通信:切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 11:59