I start my pigs off in a training area, which is small so I don't like to keep them in there long. It's basically a pig pen with an outside area. The outside area has two rows of electric rope around it, really hot. I like the rope because it's white and easy for them to recognize.
Once they're trained to that, I let them into a big area with electric rope around it. As long as I keep fresh food and water available, they don't even try the fence. One time I did let the water run out, a couple of them got out.
I will say that a couple years ago, I had a couple pigs from a local guy and they were quite wild. I did the usual training to the fence, they respected it while we were looking, then ran down the road. I tried multiple times and ended up selling them for about what we paid for them.