nancy, That would only keep the unit from tipping forward onto the porch. You still have to keep it from tipping backward away from the porch. I'd favor diagonals running down and back to concrete bases in the ground.
I know you used to be able to get swing kits consisting of chains, anchor eyebolts, washers and the like, all presumably designed for the purpose. My dad made one for my family when I was a very little brat using I think 8 by 8 posts, based on maybe 4 foot base boxes that were full of rocks. It had single vertical posts but diagonals both ways, front and back, from the verticals to the ends of the base boxes. It all just rested on the ground, and had two swings and a center chinning bar. Was solid as a rock I think it was a kit from sears, that was over 60 years ago. Tom Fowle