我有一个iPhone应用程序并添加了WatchKitExtension.从iPhone应用程序我想传递String给WatchApp,它应该改变Watch上的图像.
MMWormhole.m&.h.它们是用Obj-C编写的,因此Xcode会自动为它们桥接它们.在GitHub的教程中,它说我必须用以下内容初始化虫洞:
self.wormhole = [[MMWormhole alloc] initWithApplicationGroupIdentifier:@"group.com.mutualmobile.wormhole"
optionalDirectory:@"wormhole"];
Run Code Online (Sandbox Code Playgroud)
...并使用以下方式发送消息:
[self.wormhole passMessageObject:@{@"titleString" : title}
identifier:@"messageIdentifier"];
Run Code Online (Sandbox Code Playgroud)
但我实际上不知道在哪里放,我在我的iPhone应用程序和 WatchExtension中使用Swift .
有人可以帮助我吗?