Lots of opinions on when to charge and how long to charge a cell phone battery. Apple says to charge it to 80% and let it drain to 20%. IMO I really don't think it matters, batteries are disposable wear items, when battery performance declines either replace the battery or the phone.......
Apple doesn't really make any recommendation other than don't let it get into a "deep discharge" state, which is well below the programmed "0%" state. It would require allowing it to self-discharge after it will no longer power up a device. They have something called "Optimized Charging" for iPhones that tries to figure out a user's charging pattern, and then charges only up to 80% until a typical morning waking time when it completes the charge to 100%. That's on the premise that reducing the time it's close to 100% will have an effect on the battery.
Batteries - Maximizing Performance
Maximize the life and lifespan of the rechargeable lithium-ion batteries in your MacBook, iPod, iPhone, and iPad.
www.apple.com
I personally think life's too short to worry about it. There are marginal benefits to this or that, but it gets insane trying to do it manually. Some laptop computers (and EVs) can be programmed to stop charging at certain levels. But it's really a PITA to try to do that manually.
I generally wouldn't worry about it for any well-designed charging system. I do whatever I feel like whether is charging it to 100% or even letting it shut off automatically when the battery gets down to 0%.
As far as battery swelling goes, that's caused by several things including charging errors (charging is inside a phone) or possibly battery manufacturing defects. Maybe damage to the battery from shock. And it can be random. I've had that happen exactly once to me in a laptop computer, but one where the battery mounted on the outside through an exposed hatch. Kind of the old fashioned type where there's a latch and it pops out the bottom and isn't buried inside. It damaged the battery housing, but that wasn't too bad since it swelled outward but didn't otherwise damage the computer.