Files
simplex-chat/apps/ios/Shared/Views/ChatView.swift
Evgeny Poberezkin 7c36ee7955 swift API for chat, started chat UI (#228)
* started swift API for chat

* skeleton UI

* show all chat responses in Terminal view

* show chat list in UI

* refactor swift API
2022-01-29 11:10:04 +00:00

38 lines
910 B
Swift

//
// ChatView.swift
// SimpleX
//
// Created by Evgeny Poberezkin on 27/01/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
import SwiftUI
struct ChatView: View {
@EnvironmentObject var chatModel: ChatModel
var chatInfo: ChatInfo
var body: some View {
VStack {
if let chat: Chat = chatModel.chats[chatInfo.id] {
VStack {
ScrollView {
LazyVStack {
ForEach(chat.chatItems) { chatItem in
Text(chatItem.content.text)
}
}
}
}
} else {
Text("unexpected: chat not found...")
}
}
}
}
//struct ChatView_Previews: PreviewProvider {
// static var previews: some View {
// ChatView()
// }
//}