Custom image name on iOS - ios

I'm developing an iPhone application, which has similar functionality to Camera Roll. In full size mode (e.g. viewing selected image in full size), I want to display the picture name (image file name).
The problem here: If the user changes the picture name on their PC and upload the picture back to their iPhone, I'm still getting original file name (e.g. "IMG_xxx), while I would like to get the name given by user. If I go to MyPictures on my iPhone, I do see user custom names.
How I can get a custom image name?
Thanks!

simple answer is No. You cannot do what are requesting.
In your app you can call an image whatever you want but once you save it to iPhone/iPad camera roll then it is renamed automatically by iOS. We developers have no control over that behavior.
Now if you were to save that picture in your apps document dir and some how let the user download / upload those pics using iTunes file sharing then perhaps that may work for you.

Related

Prevent manual screenshot in IOS Objective-C

On iOS, my requirement is disallow user to take manual screenshot from my application, either disallow or blur the captured screenshot. How?
The only solution is to simulate the iOS controls you have in your View using DRM'ed videos.
For each widget you need to create a video subclass that renders the widget, and apply DRM to the video.
You can try to do it yourself, or use a commercial solution such as the following:
https://screenshieldkit.com
It is possible but I don't recommend it because of the room for error. It was easier to do in the past, in iOS13 you will have to do it like this:
You will have to ask for the user's permission to read and edit their photo library, then you have a listener which is checking the number of photos in their library while they are using your app, if that number changes, they have just taken a screenshot (unless you allow other things in your app like tap and hold to save image, etc). When this happens, read said photo and apply a blur, then delete the photo from their library and save the blurred photos.
Warning: There are times where a user may get a photo while using your app that is not a screenshot (e.g. they received an airdrop) and you will now be tampering with their photos, which is very bad. To prevent this you may need to use key value pixel encoding on your screen at all times, for example the first 3 pixels of the screen are 3 very specific RGB values, that way if a new photo is detected and the first 3 pixels are those exact RGB values you know it's a screenshot of your app and not just another photo that was somehow saved while the user was using the app.
There isn't any regular solution to your problem!
You can do some tricks such as if you force the user to have their finger on the screen for the image to show then I don't think they can create screenshots. Because as soon as you press the home+lock keys to actually take the screenshot, the screen seems to behave as if there are no fingers touching it.
BUT what if the user takes a screenshot by AssistiveTouch?!
OR what do you want to do if user records screen and taking screenshot from the video?
I think it's better to change your strategy for example notify the owner of picture for taking screen shot by another one (like SnappChat)!

How to add an image as background at run time in swift and keep it?

Good morning I am writing an app in Swift 3.1, and one of the features that I would like to provide is that the user can choose their own background for the main View and keep it as part of the application.
I know how to do it at design time, but what I want is to allow the user once they install the application on their devices to select a picture from the photo library and use that as background of the main View. Also I would like to make sure the app doesn't the depend on the photo library after the image was set as background, in other words, I want to copy the image to the app so if the user deletes the image from the photo library, I have a copy of the image as part of the app.
May I ask if what I want to achieve is possible? If so may I ask for some code guidance please?
Thanks in advance.
Yes this can be acheive by following steps:
1) You need to implement UIImagePickerController to select a photo from photos library.
https://turbofuture.com/cell-phones/Access-Photo-Camera-and-Library-in-Swift
2) You need to write a code to save that image in your Application document folder
https://iosdevcenters.blogspot.com/2016/04/save-and-get-image-from-document.html
3) You need to write code to delete the existing image otherwise app size will increase.
Delete files from directory inside Document directory?
4) Get image from Application document folder and add it to your view as background.
https://iosdevcenters.blogspot.com/2016/04/save-and-get-image-from-document.html

How do I invoke iOS photo editing extension?

Let's say I'm writing a word-processing application. Users can embed images using the app. Now since the application is not a photo editor, naturally it would delegate photo editing of embedded images to other applications.
The question is, how to do that? How to invoke photo editing extensions in an iOS app?
Theoretically it should be as simple as passing an image, invoke the extension, and then get another image back as the "edited" image. However the SDK documentation doesn't seem to provide any hint on how to do this.
Looks like the SDK doc actually says it doesn't provide a UI per se:
When using built-in editing controls, the image picker controller enforces certain options. For still images, the picker enforces a square cropping as well as a maximum pixel dimension. For movies, the picker enforces a maximum movie length and resolution. If you want to let the user edit full-size media, or specify custom cropping, you must provide your own editing UI."
From:
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/PickinganItemfromthePhotoLibrary.html
I'm looking at the Adobe Creative SDK Image Editor, which seems to provide a UI. Might show some of their branding in the photo editor, however. Hope to follow up...

Accessing Images from gallery and showing in iOS app gallery

I have around 1000 ’s of Images, I want show them in my app. What are the possibilities to do that..
The ideas which I’m thinking
1.Saving all images in phone gallery. accessing images form gallery… but It seems not possible as each iOS app has its own sandbox.
2.Saving in my bundle which will increase the memory size.
In android there is a control called “ViewPager”, how can i achieve the same control in iOS ….
Tried scrollview with paging technique but crashes due to memory ....
Please guide me…..
I dont think you can show images from the gallery directly to your application . But you can store it into document directly , for that you have to first pick images from the gallery . you can refer
How to load photos from photo gallery and store it into application project?
And next time when you start application you can load images from the document directory so you dont need to go to the gallery again .

How to show the 'preview' screen after picking a photo using UIImagePickerController

In my project, i am using UIImagePickerController to allow the user to pick a photo from the iDevice gallery (that is from the saved images, NOT camera)
I would like to present the preview screen as done when picking an image in the native messages app (it has 'cancel/choose button at the bottom)
I tried setting the allowEditing to YES, but the result is 'Move and Scale' which i dont want.
Is there a way to do it, or do i need to create this 'preview' view in my app?
Sorry for the bad news, but the Move and Scale is a view you'll have when setting allowEditing to YES. If you want something else, you'll have to built it by yourself (or to find some open source for it)...

Resources