Skip to content

Instantly share code, notes, and snippets.

@apatronl
Last active April 12, 2024 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apatronl/0b9d3bb24bc80ffde970cb60061dc6f7 to your computer and use it in GitHub Desktop.
Save apatronl/0b9d3bb24bc80ffde970cb60061dc6f7 to your computer and use it in GitHub Desktop.
import SwiftUI
struct ChatMessagesList: View {
@Bindable var viewModel: ChatViewModel
var body: some View {
ScrollView {
ForEach(viewModel.messages) { message in
MessageCell(message: message)
.padding(message.role.padding)
}
}
.defaultScrollAnchor(.bottom)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment