transferCurrentComplicationUserInfo是否更适合并发症更新? [英] Is transferCurrentComplicationUserInfo more suitable for complication update?

查看:112
本文介绍了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天全站免登陆