iOS Swift Today Extension:从容器应用程序导入类? [英] iOS Swift Today Extension: import class from container app?

查看:286
本文介绍了iOS Swift Today Extension:从容器应用程序导入类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有Today小部件的应用。我想在 TodayViewController.swift 中使用容器应用程序中的模型类。

I have an app with a Today widget. I would like to use a model class from the container app in the TodayViewController.swift.

是这样的事情可能?

我将文件复制到Today Extension文件夹并尝试导入它。没有骰子。

I copied the file into the Today Extension folder and tried to import it. No dice.

我在文档或网上找不到答案。

I can't find an answer in the documentation or online.

谢谢

推荐答案

您需要将文件包含在目标中会员。选择文件,然后在右侧窗格中勾选正确的目标。

You need to include the file in the target membership. Select the file and then, in the right hand pane, tick the correct target.

这篇关于iOS Swift Today Extension:从容器应用程序导入类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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