我有一个iPhone应用程序,并添加了WatchKitExtension。从iPhone应用程序中,我想将一个
String
传递到WatchApp,该应用程序应该更改手表上的图像。
- 我已经下载了源文件并导入了
MMWormhole.m
和.h
。它们是用Obj-C编写的,因此Xcode为我自动桥接了它们。 - 我还添加了一个应用组,并为我的WatchExtension和iPhone目标激活了它
在GitHub的教程中,它说我必须使用以下方式初始化wormhole:
self.wormhole = [[MMWormhole alloc] initWithApplicationGroupIdentifier:@"group.com.mutualmobile.wormhole"
optionalDirectory:@"wormhole"];
...并使用以下方式发送消息:
[self.wormhole passMessageObject:@{@"titleString" : title}
identifier:@"messageIdentifier"];
但是我实际上不知道该把它放在哪里,我在我的iPhone应用程序和WatchExtension中使用Swift。
有人可以帮帮我吗?
MMWormhole
...我尝试将其导入到我的 AppDelegate.swift 中,但当我键入import MMWormhole
或者加上.m
或.h
时,它会显示没有这个模块。 - LinusGeffarth#import "MMWormhole.h"
? - prawn#import "MMWormhole.h"
,但它仍然不起作用 :/ - LinusGeffarth