Using PromiseKit, I am trying to set the output of the when
block to the local variable allChatRooms
var allChatRooms : [ChatRoom]
var chatRoomIDs : [String:Bool] = ...
firstly {
when(resolved: chatRoomIDs.map{fetchChatRoom(id: $0.key)})
}.then { chatRooms -> Void in
allChatRooms = chatRooms <-- Error here
}
The complier error is:
Note: (
ChatRoom
and KChatRoom
are the same)
How can I set the result to the allChatRooms
variable?