It is not a question that can be answered with yes or no as it depends on both which kind of iPhone (model) and version of iOS, you're interested in.
In general I can say that TRIM is not used, simply because TRIM is a specific command found in the SATA protocol. As no iPhone uses a SATA storage interface, they cannot ofcourse implement TRIM.
The disk on the iPhone is actually a NAND flash directly soldered to the PCB in the phone. This means that there's no SATA-connector or PCIe connector or similar. However the actual electrical and logical protocols used for transferring data differs depending on model and iOS versions.
NAND flash chips work differently than an old fashioned hard drive. In order for the kernel and application software on an iPhone to treat them as a linear space of "blocks" or "bytes" something needs to happen.
On iOS 1 and 2 this was done through a flash translation layer called VFL. On iOS 3 and 4.0 Apple switched to using YaFTL and VSFL. On iOS 4.1 and later, they changed again to PPNFTL for those phones that had physical hardware with PPN (Perfect Page New NAND flash). Only on the PPN hardware is there are an actual controller inside the NAND flash. However most of the flash translation work actually still takes place in software.
In addition to handling the conversion between actual "flash realities" and the "linear space of blocks" logical view, the FTL is also responsible for doing wear-levelling. The functionality you know as TRIM is actually deeply rooted in the wear-levelling system.
The short answer is that the use of a "TRIM-like" functionality is very much dependent on your actual iPhone hardware model, the iOS version used and on whether or not Apple has actually decided to use the functionality. It is however clear that Apple designed the NAND layouts and flash translation layers to actually support a TRIM-like functionality, and they did this many years ago. So it would make sense that it is also being used. However it is not documented publicly whether or not Apple actually uses this TRIM-like functionality in practice.
You can read more about the layouts and flash translations layers in iOS/iPhone here: