I have a cell row which contains the following:
HStack {
Text(self.category.name.capitalizingFirstLetter())
.font(.body)
.fontWeight(.light)
Spacer()
.background(Color.red)
if category.id == selectedCategoryID {
Circle()
.foregroundColor(.pink)
.background(Color.yellow)
}
}
I am trying to have the Circle appear on the right side of the row and this is why I used the Spacer. This is how it actually looks like:
I added the background color for the circle and the spacer only for better visual of the situation.
Can anyone please help?


