如何将 UIImage 从 iPhone 应用程序传递到 Apple Watch 应用程序 [英] How to pass UIImage from iPhone app to Apple Watch app

查看:32
本文介绍了如何将 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

这篇关于如何将 UIImage 从 iPhone 应用程序传递到 Apple Watch 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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