Значение типа «ConversationDataSource» не имеет члена «message At» - ошибка Swift - PullRequest
0 голосов
/ 27 апреля 2020

Я следую руководству Apple по созданию чат-бота и столкнулся с этой ошибкой, для которой не могу найти решение:

Значение типа 'ConversationDataSource' не имеет члена 'messageAt '

Мой код в ConversationViewController.swift

 import Foundation
class ConversationDataSource {


    /// message array
    var messages = [openingLine]

    var messageCount: Int {
        return messages.count
    }

    /// Add a new question to the conversation
    func add(question: String) {
        print("Asked to add question: \(question)")

        let message = Message(date: Date(), text: question, type: .question)
        messages.append(message)

    }

    /// Add a new answer to the conversation
    func add(answer: String) {
        print("Asked to add answer: \(answer)")

        let message = Message(date: Date(), text: answer, type: .answer)
        messages.append(message)

    /// The Message at a specific point in the conversation
        func messageAt(index: Int) -> Message {
        print("Asking for message at index \(index)")

        return messages[index]
        }

    }
}

Любая помощь будет оценена.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...