I had an inquiry about the fencing requirements for pigs, and what works best. I have practical experience, but I am no expert on fencing. I can only tell you what has worked for me on our farm.
My personal go-to for fencing is pig panel. 16′ welded wire panels that are spaced for raising pigs. They are approximately 3′ tall and are narrow spaced on the bottom and wider spaced on the top. The narrow spacing by design is to keep the young pigs in, but I have seen little piglets run full speed and jump through the upper larger spaced area. So it may slow them down a little. I have not had a full grown hog go over one yet, but they can eventually separate the seams of two panels and escape. Daily visual inspection of any fencing for hogs is a necessity.
Woven wire with spacing like the welded wire can also work if stretched tight enough and with posts close enough. Pigs will dig next to the wire and then lift it with their noses to crawl under the fence. This seems to be a younger pig trick, as they get older and fatter they tend not to try it.
Electric wire will also work fine if the pigs were properly trained to respect it. A 2 or 3 wire system will keep most pigs in. I used this successfully even to separate breeding groups and boars. the fencer needs to be strong, and daily inspection of the fence is necessary to make sure they have not pushed dirt onto a lower wire to short it out.
Fencing is really a personal choice. It may depend on what you have available, or what budget you have to get started. Electric wire is the cheapest per foot of fence, and the pig panel is the most expensive. I have had all three in use at the same time.
No matter what fencing I have up, I find the best way to keep them where I want them is to keep them adequately fed at all times. I also bucket feed twice daily, if one does get out, it will come running back to the bucket.