如何将UIImage从iPhone应用程序传递到Apple Watch应用程序

问题描述:

我有一个iPhone应用程序,在5-10秒后将UIView捕获为UIImage。是否可以将UIImage传递给我的Apple Watch应用并在那里用UIImageView显示?

I have an iPhone app that captures a UIView as UIImage after 5-10 seconds. Is it possible to pass that UIImage to my Apple Watch app and show it in UIImageView there?

是的。您需要做的就是创建一个 NSDictionary ,如:

Yes it is. All you need to do is create a NSDictionary like:

var dict:[NSString : UIImage] = ["image" : yourImage]

然后你只需使用以下内容Apple Watch和iOS应用程序之间进行通信的方法:
链接

And then you just use the following methods to communicate between the Apple Watch and the iOS app: LINK