strvcom / ios-chat-component

Chat modular library
MIT License
1 stars 1 forks source link

Update pods #10

Closed schwarja closed 4 years ago

schwarja commented 4 years ago
schwarja commented 4 years ago

@danpecher please test this and approve or reject it

danpecher commented 4 years ago

@schwarja I tested this and the installation and build is OK but for some reason when I try to use ChatCore like this

let core = ChatCore<ChatNetworkFirebase, ChatModelsUI>(
        networking: ChatNetworkFirebase(
            config: ChatNetworkFirebase.Config(configUrl: "...", userId: "...")
        )
    )

I get an error Type 'ConversationFirestore' does not conform to protocol 'ChatUIConvertible'

Maybe I'm doing something wrong 🤔

schwarja commented 4 years ago

@danpecher I probably know why it doesn't work for you. We have 3 layers ChatNetworkingFirestore, ChatCore and ChatUI. These 3 layers are connected together in Chat framework that also implements the conformance to ChatUIConvertible and ChatNetworkingConvertible. So if you type:

import Chat

let chat = Chat(configuration: ...)

it should work just fine. It should be also fine if you use your piece of code and you import also Chat because the conformance is defined there. Generally speaking, if you instantiate ChatCore on your own you need to implement also the conformance to those *Convertible protocols on your own. But you don't need to instantiate Core separately because Chat provides you with a complete solution.

danpecher commented 4 years ago

@schwarja you're right, importing Chat module solves it 🙂