UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Thoughts on full-screen background image across devices

Forums > iOS

Long time listener, first time caller.

We have an 12+ years old app where we have a full-screen background image. It's patterned, so a shift in proportions could look a bit weird, which we'd optimally don't want. We also want to make sure that it's crispier on devices, we're currently just using 2x/3x.

I've read around and there's a couple of approaches:

1 - Use many different images, set them manually depending on device. This would keep the image proportions exactly as desired, but a lot of work and needs to be maintained for new devices - not optimal.

2 - Which we're leaning towards. Have a single, sufficiently large png, say 1440X3200 or even larger, have the "background" viewcontroller ImageView use that image with view.imageNamed and set scaling to UIViewContentModeScaleAspectFill. I don't mind that it might require a tad more memory on "smaller" devices.

On SO there are tons of approaches, but i thought that i'd ask here instead:

Is there anything i haven't thought of, is there another, better, approach or would approach #2 above work ok?

Thoughts and tips appreciated!


Hacking with Swift is sponsored by Superwall

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.