更新到LayerKit 0.22.0后LYRConversationOptionsDistinctByParticipantsKey未解析的标识符

时间:2016-10-21 15:44:11

标签: cocoapods swift3 layerkit

从第0.17层更新到0.22后,我收到此构建错误: "使用未解析的标识符' LYRConversationOptionsDistinctByParticipantsKey'"

代码:

let currentConversation = try! appDelegate.layerClient.newConversation(withParticipants: participantSet, 
    options: [LYRConversationOptionsDistinctByParticipantsKey : 0])

(新线上的可选性选项)

1 个答案:

答案 0 :(得分:0)

阅读更改日志总是值得的!

  

0.22.0 引入了LYRConversationOptions对象,用于在初始化时配置对话实例。它取代之前通过带有字典的options参数传递的LYRConversationOptionsMetadataKey,LYRConversationOptionsDeliveryReceiptsEnabledKey和LYRConversationOptionsDistinctByParticipantsKey。

LYRClient.newConversation(withParticipants: participantSet, 
   options: [LYRConversationOptionsDistinctByParticipantsKey : 0])

变为

let options = LYRConversationOptions()
options.distintByParticipants = false
layerClient.newConversation(withParticipants: participantSet, 
    options: options)