save all app data Xcode - ios

I'm starting now with swift and wanted to know how do I save the data from my app. I have text and photos in my app. how can I save this using the firebase or saving directly to the user's iphone?
I want the user to terminate an action and the app to save automatically.
an example the user added an image in the imageview using the photos library closed and left the app. when he reopened everything he did this as he had left.

Related

Detect screenshots taken ON ANY APP within my iOS app

Is it possible to detect when the user takes a screenshot in any app while my app is in the background ? And how would I do that ?
If not, can I background check regularly for screenshots (not pictures from the camera) in the photo library ? Like every minute or hour ?
One way to get your app to detect Screenshots is:
Register with the Photo Library's PHPhotoLibraryChangeObserver
When your app receives a notification that a photo has been added,
check its PHAssetMediaSubtype
If the Subtype is PHAssetMediaSubtypePhotoScreenshot, you know a new
Screenshot has been taken.
The PHPhotoLibraryChangeObserver protocol notifies you of changes that
occur in the Photos library, regardless of whether those changes are
made by your app, by a user in the Photos app, or by another app that
uses the Photos framework.
https://developer.apple.com/reference/photos/phphotolibrarychangeobserver

Refresh photo gallery in swift

I've made a photo gallery and now I want to know how to refresh it. If I open my app and have 5 photos in my library I see all of them. If I press on the home button and take another photo and open the app again I can't see that. So I have to close the app manually and restart to make it work

How can I detect if a photo has already been imported to a photo album?

I've got an app that copies screenshots from another device onto an iOS device and adds them to a photo album, using [ALAssetsLibrary assetForURL] and [ALAssetsGroup addAsset]. But every time I do this it adds the screenshots even if they've been added previously. Is there a way of knowing whether I've previously imported an image? I can't use the filename because the screenshots use a simple index that gets incremented.

How to upload images in the background in ios using Afnetworking

I want to upload images from an iOS app to a php server. I am currently using POST Multi-Part Request in AFNetworkingOperationManager.
What I want to do is that when a user taps to upload image, Its starts uploading in the background and then a user can migrate away to a different controller. And when the upload the finished, The image is added to the list of images in a different controller where they are displayed in a table view just like twitter.
Can I accomplish this using AFNetworking?
Yes ,you can get it, First ,I aways get a mutableArray instead of some paths of picture, then you can upload them in background.

Validating iOS screen for user errors

I have developed an iOS enterprise app for iPad. When it is launched it connects to a webservice, gets some data, and stores it in Core Data. Then the next screens use this data and do what is needed, like fill UITextFields, drop downs, show the user a UIAlertView, etc. Basically i use the data, manipulate it, and save it.
Consider this: I install the app now in morning, I use it immediately, and then I click the home button on iPad and leave it there for couple of hours. I then launch the app, and it shows a black screen before crashing and going back to iPad main menu.
Why is it crashing like that? Any ideas?
If you need more information please let me know.
You need to check your logs for errors.
Plug your device to your computer and open Xcode/Organizer/Devices/Device Logs

Resources