It will work but it definitely is not the best choice. If you have all the time in the world for your shots it will work. But for a moving target it definitely wouldn't be my choice. I prefer a 270. I like to hunt out of a tree climber for them. Jackie B.
I do have a night gun for use over a corn box and it's a 22 hornet with a gen II night scope. Shots are normally less than 75 yards and ear shots are the name of the game. Instead of running off, I've had them to start eating the hog I shot when they smelled the blood. It can be fun. LOL Jackie B.
The body of a pig is pretty tough. As others have said, head shots. Give the .223 bullet a chance to do its job.
If your gun can stabilize them, Nosler makes some 60 grain Particians (factory loaded by Federal - see link) whose construction is tougher and they penetrate deeper before expanding. Their intended purpose is for light big game, like some of the smaller deer. They'll work better for penetration than varmint bullets, which are designed to rapidly expand upon contact. This works great for small varmints and coyotes, but for larger critters, especially those with very solid bodies, they leave ugly shallow surface wounds, craters really, that often result in a cruel, lingering death. Use the right bullet.
When I was young we used to shoot some huge hogs with 22lr right at ear. Sometimes we missed and learned how to climb trees real fast. Usually had someone in group with a shotgun slug. Those things looked like alligators on wheels when they come after you. jim w.
I use a .223 on pigs up here around Amarillo. Shot placement is the key, though. But if you get into alot of them, handling the bolt can be slow. That's why I like a semi-auto. Shooting them can be like shooting at a tank though. They are tough son of a guns.