I created list witch elements loads from bottom to top. (Reversed List)
All works very good except Sections. When section fliped, header of section is still on bottom. I want section header move to Up and under section can be cells.
VStack {
List {
ForEach(messagesViewModel.processedMessages, id: .self) { section in
Section(header: Text(section.date.relativeFormat!)
.frame(maxWidth: .infinity, alignment: .center)
) {
ForEach(section.messages, id: .self) { item in
SUIMessageCell(data: item, avatar: messagesViewModel.metaData!.av96, viewModel: messagesViewModel)
.listRowInsets(.init(top: 2, leading: 24, bottom: 2, trailing: 24))
.listRowBackground(Color(UIColor(hexString: "#F2F3F4")))
.modify {
if #available(iOS 15.0, *) {
$0.listRowSeparator(.hidden)
}
}
}
}
.rotationEffect(.radians(.pi))
.scaleEffect(x: -1, y: 1, anchor: .center)
}
}
.listStyle(.plain)
.rotationEffect(.radians(.pi))
.scaleEffect(x: -1, y: 1, anchor: .center)
.environment(.defaultMinListRowHeight, 0)
.onAppear {
UITableView.appearance().separatorStyle = .none
}
.padding(.bottom, 8)
.background(Color(UIColor(hexString: "#F2F3F4")))
SUIMessagesInputView(messageViewModel: messagesViewModel)
}