transferCurrentComplicationUserInfo 更适合复杂度更新吗? [英] Is transferCurrentComplicationUserInfo more suitable for complication update?

查看:38
本文介绍了transferCurrentComplicationUserInfo 更适合复杂度更新吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

transferCurrentComplicationUserInfotransferUserInfo 有什么区别?

我想将数据从我的 AppDelegate 发送到时钟套件并发症.

I want to send data from my AppDelegate to a clock kit complication.

transferCurrentComplicationUserInfo 似乎与 transferCurrentUserInfo 做的事情完全一样.我错过了什么吗?

transferCurrentComplicationUserInfo seems to do exactly the same thing as transferCurrentUserInfo. Am I missing something?

推荐答案

这两者的区别WCSession 方法涉及数据何时发送,watchkit 扩展是否被唤醒.

The distinction between these two WCSession methods involve when the data is sent, and whether the watchkit extension is woken up or not.

transferCurrentComplicationUserInfo: 专门用于传输要立即显示在表盘上的复杂用户信息.

transferCurrentComplicationUserInfo: is specifically designed for transferring complication user info meant to be shown on the watch face right now.

  • 并发症用户信息被标记为紧急",并被放置在队列的前面,
  • 手表在后台唤醒扩展程序以接收信息,并且
  • 转移会立即发生.(其他排队的信息也可能在那时传输.)

transferUserInfo: 排队信息,当系统确定是处理队列的好时机时传输:

transferUserInfo: queues up information, to be transferred when the system determines it's a good time to process the queue:

  • 用户信息放在队列的后面,
  • 如果分机未唤醒,则存储传输的信息,
  • 转移不会立即发生,并且
  • 信息按发送顺序发送.

更多详细信息,请参见 WWDC 2015 手表连接性介绍视频.

More details can be found in the WWDC 2015 Introducing Watch Connectivity video.

iOS 10 更新:

在 iOS 10 中,WCSession 添加了一个 remainingComplicationUserInfoTransfers 属性会影响 iOS 将使用哪种方法传输用户信息:

In iOS 10, WCSession adds a remainingComplicationUserInfoTransfers property which can affect which method that iOS will use to transfer the user info:

当天可以调用transferCurrentComplicationUserInfo:的剩余次数.如果此属性设置为 0,则对 transferCurrentComplicationUserInfo: 的任何其他调用都使用 transferUserInfo: 代替.

The number of remaining times that you can call transferCurrentComplicationUserInfo: during the current day. If this property is set to 0, any additional calls to transferCurrentComplicationUserInfo: use transferUserInfo: instead.

如果复杂功能出现在活跃的表盘上,您每天可以进行 50 次传输.如果复杂功能未激活,则此属性默认为 0.

If the complication is on the active watch face, you are given 50 transfers a day. If the complication is not active, this property defaults to 0.

这篇关于transferCurrentComplicationUserInfo 更适合复杂度更新吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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