Is there a way to use code in iOS using Swift to access a text message and read the contacts and addresses in that message?
You cannot (for privacy reason) access text messages.
Imagine if it were possible, an app could read all your personal messages, without you even knowing.
May read this discussion:
Retrieving data ...