ChatView

struct ChatView : View

The ChatView displays a conversation and all the messages that have been sent and received in said conversation.

It is also here that we send new messages.

  • The CoreData object context to which we save messages to persistent storage.

    Declaration

    Swift

    @Environment
    var context: NSManagedObjectContext { get }
  • The users current colorscheme for pretty visuals.

    Declaration

    Swift

    @Environment
    var colorScheme: ColorScheme { get }
  • The ChatBrain object is used to send and receive messages. It handles the logic behind this view.

    Declaration

    Swift

    @EnvironmentObject
    var chatBrain: ChatHandler { get }
  • The current conversation that the user is in. Used to get messages from conversation.

    Declaration

    Swift

    @ObservedObject
    var conversation: ConversationEntity { get set }
  • Fetched results of the messages for this conversation.

    Declaration

    Swift

    @FetchRequest
    var messages: FetchedResults<MessageEntity> { get }
  • Temporary storage of the textfield entry.

    Declaration

    Swift

    @State
    var message: String { get nonmutating set }
  • A boolean for showing the report alert or not. Showed if we press the report button after a longpress on a message.

    Declaration

    Swift

    @State
    var showingReportAlert: Bool { get nonmutating set }
  • Our username for comparisons to the username of the conversation.

    Declaration

    Swift

    let username: String
  • Undocumented

    Declaration

    Swift

    init(conversation: ConversationEntity)
  • Declaration

    Swift

    var body: some View { get }