I am a student coding an application to regulate textbook exchange between students at my school. I am using Xcode 10. I have been searching for a way to allow a user to input an image as a "profile picture" when they register for an account, and have that same image appear in the profile tab of the app, once they have logged in. I have coded a button that allows users to choose an image from their photo library to use as a profile picture, however, I cannot seem to find a way to retrieve this image in the profile tab. I am using a Firebase realtime database to store login information, however I may have to change it because it cannot store images. Is there some way to transfer this information between image views in the app? Also, is there a better alternative to firebase?
Thanks so much!
Using Firebase (or any other cloud based database) to retrieve images from other View Controllers
Can Firebase store data blobs? You could store the image as a blob and retrieve it when you need it in your displays. Probably want to cache it to keep from hitting the database too often (see below).
You could copy the image into an auxiliary storage directory and store the URL to that file in the database. If you store the URL in the database, you would use Image/NSImage initialization that can read from a file URL after retrieving the URL string from the database.
In either case, you would probably want to store the data in an application cache storage after the user logins and the image is retrieved. This cache image would be the source for any of your view for that user while logged in. You would flush the cache when the user logs out.
In Firebase you could use Firebase Storage to store and retrieve user-generated content such as images, audio and video without server-side code.