如何将 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