I am working on a SwiftUI project and have encountered a design challenge. In my current setup, I have a List that displays posts. Each post in the list has a small green dot (Circle) aligned to the left within an HStack. Here’s the relevant snippet of my code:
List {
Section(header: Text("New")) {
ForEach(viewModel.posts.filter { !$0.isReposted }) { post in
HStack(alignment: .center, spacing: 5) {
Circle()
.fill(Color.green)
.frame(width: 5, height: 5)
.cornerRadius(10)
.padding(.leading, -16)
PostView(post: post)
// ... Other views
}
}
// ... Other sections and views
}
}
I would like to move this green dot so that it is positioned outside and to the left of the List, rather than within each list item. My goal is to have the dot aligned with each post but not be part of the list row itself.
Is it even possible?




