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

Storage of jpg & PDF

Forums > SwiftUI

Hi everyone, I have an app that will contain many small images and pdf's, what is the best way to store them so that they are available when the app is downloaded from the App Store. What is the best / easiest way to get the images / pdf's into the app initially?

Thanks for all your help

1      

Typically there are several approaches and the best way depends on your use-case.

What is your eventual goal? Will there be only ever a fixed number of images and PDFs, or are you going to add more and make them available in the future? Are you clear about your requirements now, and the likely requirements of how your app might develop?

Deciding what your app will do now and in the future, will help determine a possible design direction.

If your app will have many images and PDFs, but will never add to them, then it might be best to include them with your app. (Take note of Apple's limits on app sizes when published to the App Store).

If your app will add more images and PDFs in the future, then consider having a separate web server providing the images and PDFs.

Or something between these two cases.

1      

Hi, thanks for your help

I had contemplated how to deal with the images and pdf's, they will increase overtime, so I wondered if

I could store all the current images in the app, and release updates on say a quarterley basis

Give all the current images and allow the user to add aditional

A mixture of the 2

I had not considered a web server, and that seems a better solution

While prototyping I tried storing the images in the Assets, but this seems very clunky when there are many images

Thanks again

1      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

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.