WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

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!

   

Save 50% in my Black Friday sale.

SAVE 50% To celebrate WWDC22, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

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

Reply to this topic…

You need to create an account or log in to reply.

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.