If your answer is negative, you’re most likely not dealing with a faulty detached part floating around your iPhone’s internals, but are hearing the sound of the rear-facing camera that joggles because of the stabilization system. The iPhone’s optical image stabilization feature controls the lens with the help of very fine springs and magnets to obtain the desired results!
This Camera feature has been included in the iPhone Plus models, so previous owners should be familiar with it. However, the iPhone XS is the first “smaller” model that packs optical image stabilization for its camera. Of course, that the option is also present in the oversized “Max” terminal! So, if you previously owned a non-Plus iPhone model you might think that there is something wrong with your iOS device, when you shake the iPhone to undo typing, for example.
Fact: Confusion can become even bigger if you recently dropped your device and suspect that some damage occurred during the event!
Tip: What you can do is open the Camera app and start recording. Shake your iPhone while the Camera is capturing and see if the device still rattles. If the noise continues you might have to make an appointment to the Genius bar and get your iPhone checked out.
Related: Is your iPhone XS Max experiencing cellular data connectivity problems? Read more here!