Is there a method to call to be able to enable/disable the feature of taking pictures with the volume up button?
I have noticed that using imagePicker.showsCameraControls=NO; and by setting a custom overlay of the cameraOverlayView of the UIImagePickerController, the volume button is disabled. Now the problem is that you have to redefine the behaviors of the camera(zoom, ect).
Short of jailbreaking your device or using private api, this cannot be done, much less approved by Apple, using the standard methods.
If your device is jailbroken, I believe there is an Activator setting that will allow you to accomplish this.
Also, there is a package in Cydia that does exactly this called SnapTap.
Related
I can't see how this is possible from the documentation but here nike is doing it in their app so there must be a way.
It's impossible unfortunately. Apple developed it for Nike, so they used tricks of their own to do it. It might actually be possible, but it's certainly undocumented if possible. Impossible for an App Store app. Let us know if you figure out a way to do it even if it's undocumented.
If you use the library InAppSettingsKit, you can have a setting that uses a custom subview (a custom UIViewController) to display the choice to the user. So all you have to do is to create a custom view controller that looks just the one in your picture (it's basically just a UITableView and a UIPickerView).
In the example app that comes along with InAppSettingsKit, there is an example on how to use a custom subview.
i want in my app to increase and decrease the app volume programmatically from the code and not to use MPVolumeView.
You cannot change the volume programmatically, and that's a deliberate design choice. Imagine an app that constantly sets the volume to the highest level, that would not only be annoying but could even damage your ears if you're wearing in-ear headphones.
You should show an MPVolumeView to the user so he can change the volume himself. You can walk its subview hierarchy and search for the UISlider and adjust its appearance like with any normal UISlider. This way you can adapt the MPVolumeView to your app design.
Officially: You can't.
If you really want to do so, link against Celestial.framework and use its controllers to change the volume - that is how SpringBoard and friends do it. I don't remember how to do it, but with a bit of research you should be able to find the answer. This will get your app rejected. If you're developing for a jailbroken device, this is the way to go.
If you want to go deeper you can do it via the vTable of the appropriate CoreAudio service. You also need Celestial.framework for that. And if you want to go even deeper, kill mediaserver and make your own implementation which should occupy your for the next few months.
Is it possible to share copy and delete image using UIImagePickerController in SDK3.0?
The UIImagePickerController class and it's delegate protocol are for capturing images that you can use within your application, either by using the camera (if available) or the photo library.
You can't use the interface provided by the UIImagePickerController for anything other than what is stated above.
You can however, use it to pick the image you want. Once that it done, you can do anything with that image within your app. If you want to create a similar interface to the UIImagePickerController, you can. You can then implement the copy and share functionality from there. I don't think you can delete images from the user's photo library though, so that may not be possible.
How do I programmatically lock and unlock the main screen (i.e. the device itself) of an iPhone?
It's not possible. However, you can "prevent" your phone from locking when your app is running. [UIApplication sharedApplication].idleTimerDisabled = YES should do it.
It can be done by caling GSEventLockDevice (); from your app. This function can be found in GraphicsServices.framework.
This has already been resolved . You can find it on Github: https://github.com/neuroo/LockMeNow (work below IOS 7)
char*framework="/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices";
void *handle= dlopen(framework, RTLD_NOW);
if (handle)
{
void (*GSEventLockDevice)() = dlsym(handle, "GSEventLockDevice");
if (GSEventLockDevice)
{
GSEventLockDevice();
NSLog(#"Phone is Locked");
//.........
}
dlclose(handle);
}
It is probably possible with undocumented Apple functions (maybe GSEventLockDevice() ?) but it certainly leads to automatic App Store REJECTION.
Apple simply don't want anyone to fiddle with core functionalities like this.
If you want to do this so, Apple never approve this, your app must be jailbreak. you can do this by calling Private framework on your project. you can use GraphicsServices.framework.
NOTE :
This GraphicsServices.framework is a private framework. Apple will never accept your app. By calling GSEventLockDevice() method you can lock or unlock your Device easily. This GSEventLockDevice() resides in the GSEvent.h.
I hope this one helps you.
Please let me know if you still facing any problem
I don't believe that there is a way to achieve this.
One thing that i believe is possible is to stop the IPhone from locking. you could then build a view that copied the lock unlock function and you would still have control over the phone.
it basically isn't possible because this probably is part of the private frameworks which can be used by Apple only. There are apps such as the fake caller apps that utilize a "fake" lockscreen but as you've pointed out, pressing the home button quits the app, rendering your lock screen useless.
Describe lock and unlock. I would try a switch that enabled = YES and enabled = NO for the view property. So basically you can disable all the UIGestureRecognizers and 'lock' the screen, if this is what you mean. I do it with UIbuttons once I add them as an IBOutlet as well as IBAction, so they are an object and can be modified at the property level. I am working on this very thing right now. I will post my findings.
It seems like the built in UIImagePickerController cannot accept sources other than its device camera Roll.
I would like to get the functionality of picking and enlarging pictures within my own app. Also I would like to allow the user to select the pictures and save it into their camera roll (so they can later use it as wall paper)
1) what is the recommended way of building a custom UIImagePickerController that supports what I need ? Is there another built in controller I am missing?
3) Is there a way to take a UIImage and save it to the desktop background of the device directly? Or is it a two step (first save to camera roll), then have the user load the picture from there to save as wallpaper
Thanks in advance!!
At this point, it seems that the only way to build a custom UIImagePickerController functionality is to subclass, and then muck with the view hierarchy directly. This allows you to move, hide, and replace UI elements and access the non-public classes that control the operation of the camera, but as you probably gather, this technique is both unsupported (in that it may, and probably will, break with future updates) and not recommended (in that it may, and probably will, get your app rejected from the App Store if detected).
As far as your second point (somehow numbered 3), John is right: there is no call in the public SDK to accomplish this. You could probably hack something together if you're clever, but remember the warnings in my first paragraph...
Regarding #3) there is no public call in the SDK to save an UIImage to the desktop.
I don't know about the rest of your questions though.
Just today I started a open source UIImagePickerController clone, it is not perfect but it works quite ok. Feel free to fork http://github.com/jeena/JPImagePickerController