Member-only story
Want To Make Simple Apps That Earn You Income?
Monetize Your SwiftUI App With AppLovin
Using UIViewRepresentable To Display Your Ads
Disclaimer
: I don’t advocate for any particular ad network, aggregation service, or “app technology platform” and you aren’t meant to take this as a how-to for monetizing your app. This is more about how to integrate AppLovin into your SwiftUI app if you’ve taken the path I did and have already built out your app’s UI with SwiftUI, then decided to use AppLovin and found it difficult to integrate it into your SwiftUI app. This also isn’t a “best practices” tutorial, rather it’s meant to get you off the ground and displaying ads once you’ve set your ad units up in AppLovin’s dashboard. I can almost promise you’ll have bugs using the exact implementation laid out, but I hope it gives you a good starting point.
Why SwiftUI?
SwiftUI is an excellent choice for an app with a simple, clear-cut purpose. It helps you quickly prototype and get off the ground. With changes in iOS 14 and beyond, it’s ready for production. Once you’re used to event-driven programming and SwiftUI, you can, for instance, make an app in a week that’d take a month or longer using UIKit
and traditional patterns. The app will even look and behave almost the same out of the box…