Xcode --> Mongo DB Atlas

What’s the easiest way to connect an IOS app to Mongo DB Atlas? I’ve read the Realm SDK documentation and there’s a section about how to connect to Atlas and also performs CRUD operations, can I make an iOS app communicating with Atlas through Realm or is it needed to have a backend service such as Vapor?
(The app is a social media app, where users authenticate and can post images, and I would use Atlas running on AWS). Thanks for your answers.