The OP has probably already made his/her decision, and there have been several great comments here, on both sides of the argument. As someone who owns a Canon M50 with several lenses and has owned several iPhones, I'll just throw out some random thoughts...
- I think that the quality level between the two has certainly narrowed, to the point where a skilled photographer can probably take photos of better quality with a modern iPhone than the average person could take with a dedicated camera and great lens.
- In certain conditions, that skilled photographer can also probably take photos with that iPhone that are difficult to discern* from photos that same skilled photographer would take with the more expensive rig. My asterisk is to point out that I'm talking here about whether a non-pro photographer viewing those photos via a typical delivery mechanism (their own iPhone, iPad, or computer) will be able to discern the difference. I'm not talking about taking those photos, printing them out professionally at super-high resolution and large format and displaying in a gallery, or "pixel-peeping" on a monitor. I'm talking about what matters most, IMO, which is a casual observer looking at the photo and saying, "Wow, that's a great photo!"
- There are absolutely going to be some conditions where an iPhone simply can't compete, such as when a high-speed long-range telephoto lens is needed (e.g., taking a photo of an eagle in flight). Keep in mind that the lens needed for these kinds of shots may be quite expensive.
- On the other hand, there are some scenarios where a dedicated camera can't compete with the iPhone (unless you're talking about some *really* expensive camera gear). Most notably: 4K/60fps or 1080p/240fps slow-mo video.
- Unless photography is a primary focus in your life, it can be difficult to master the equipment you're using, and memorize how the UI works. I'm talking here about both an iPhone using something like the Filmic app, or my Canon M50 and it's slew of features and UI screens. Unless you want to take on mastering/memorizing both, I think a good argument could be made for mastering one of the better 3rd party photo/video apps for the iPhone, since you'll have that with you more often.
- Along the lines of that last point, some of the money you save on the dedicated camera could be put to use on things like lighting, microphones, or a gimbal for your iPhone.
After re-reading my list, I think I'd probably say that the right answer probably depends most on the types of photos that you want to take, and whether the lens on the iPhone will be suitable for it. If you want to take portrait shots with great bokeh, the latest iPhones can take some very impressive shots, but they're doing a lot of that with software, that can sometimes have obvious defects compared to a dedicated camera with a lens optimized for portrait shots. Or, per the example I gave farther above, if you want to take photos/video of wildlife from very far distances away, the iPhone isn't going to be very good for that, and the add-on lenses available are not that great, from what I've seen.
I think it would be really cool to see Apple offer something like an iPhone with a screw-on lens attachment. There are some 3rd parties that offer iPhone cases with threaded lens attachments, but you're putting a lens on top of the existing lens, which degrades quality. I'm talking about the ability to remove the iPhone lens completely, and replace it with other types of lenses.
A while back Sony came out with the DSC-QX10 and DSC-QX100 lenses, which were larger lenses (more glass) which could mount onto an iPhone or just be used standalone. They had some issues, and there wasn't enough of a market for the idea at the time, but maybe we'll see something like that reappear in the future.