wanted to implement brightness bar in ipad app - iphone

hey guys,
i am working on a ebook reader and in its course i wanted to allow the reader to reduce/increase the brightness accordingly. what i tried is ,placed a UISlider and gave the values as 0 and 1 for min and max respectively. I placed a imageView on the main view and aplied alpha component to the uiview which responds to the slider accordingly.
i succeeded but i know that it doesn't save the battery life of the ipad.
are there any predefined methods or framework which enables us to alter the brightness of the device.
thank you in advance

There is a private api call GSEventSetBacklightLevel(float). But if you are planning to submit this to the app store it will get rejected.

There is now of doing this via the public API, you could use, like you stated, a semi tranparent view with a black background over the window to make it look like you can control the brightness.,

Related

labels on images in ios like instagram

In iOS 10 ( Swift 2) how would I go about getting a tag on an image like Instagram does in the pic below ? I want to get the 'topgearporsche" label and get it on the right object in this case - the porsche for an app I am building.
Thanks in advance.
This is pretty basic.
image.addSubview(label)
It is a lil complicated if u exactly want how instagram does it... U will have to make a custom view using uibezierpath... Place these views exactly where you want them to point out, like literally spoon feeding the cgrect (cgpoint and cgsize). Assign an uitapgesturerecogniser to show the views which were hidden in the beginning.... And then after a certain amount of time they should vanish which can be achieved using uiview.animatewithduration function... And hide those views again in its completionblock...

How do I change the tint color (background) of a UIActionSheet in iOS5?

I would like to change the tint color of my UIActionSheet for my iOS apps. Is there an easy answer or custom class which I can use to achieve this?
I have found help on changing the colors of the Action Sheet buttons which is helpful, but I haven't found anything about changing the background color.
There is no API, but you could subclass UIActionSheet and play around with its subviews array till you find the one that draws the background and either edit it directly, or add a subview to cover it up.
While this isn't the greatest approach, it isn't using any hidden APIs to it won't get rejected from the iTunes store. Before iOS 5, this is how most customization was done.
Here is a great example of doing it with Navbars.
I am not able to respond to the above comments. However the link provided by #Luke is broken, but I have found it to be active here: https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets
There is no legal API for this, and if you use illegal API your app will be rejected from the app store. The simplest solution is to roll your own interface and not use UIActionSheet.

iOS display a lock/unlock slider like the lock screen?

I'm trying to let the users of my app cancel an active alarm using a slider, like the timer app or the iPhone lock screen.
Is this control available to us as developers? If so, what's the name of it, and do I need to add it programmatically? I do not see it in the interface builder.
Thank you!
You could always try this on cocoacontrols.
Slide to unlock control
There you go,
http://xcodenoobies.blogspot.com/2011/03/how-to-do-slide-to-unlock.html
It's not a standard control - you'll need to create it yourself.
However, I think you should be able to customize the slider control. You can change the look and feel of that by supplying your own graphics, and it should be easy to simulate the behavior of the lock slider (such as making it slide back to 0 if it doesn't get all the way across).

How to create a custom UIView that shows 5 stars

I have a requirement for a UIView that displays stars similar to the way one can rate albums in iTunes on the Mac and iPhone.
Does anyone know what it would involve to create this or whether one is available online?
Have a look at the TouchCustoms library. I'm pretty sure there's a star rating component for iOS in there.
I had it done it a couple of months back. It is very simple.
Subclass a UIView.
Add the 5 stars(UIImageviews)
Write a function to toggle the image of the stars
In the touches Began and touches moved method Check for the touch and accordingly change the images of the imageviews.
Also add a int variable that will have the current rating.(you can set the value whenever the toggle changes the images of the stars)

Modify photo selected by UIImagePicker before it's used in the move-and-scale screen

as you probably know, the UIImagePickerController in the UIKit Framework allows the user to take a photo which is then handed over to my App for further processing.
If the property allowsEditing is set to YES, the user is allowed to move and scale the photo after taking it.
What I'd like to accomplish is to modify the photo in my code BEFORE the user is presented with the move and scale screen. This is because I'd like to add some visual effects to the photo and the user should be able to move and scale with these effects already applied to the photo.
I know that there's the cameraOverlayView property, but this is not useful in my case as far as I'm concerned.
Any ideas?
Thanks, Thomas
Not so easy way is to implement move and scale functionality on your own.
make showsCameraControls NO. You can design your own preview screen (with modified Image).
Looks like there are issues with touches in IOS5 cameraOverlayView. Make sure the above solution works for IOS5 also :).