UISlider with sound effect and vibration - iphone

I need to do a lot of things with UISlider. First of all I want to know what are all the things are possible and what are not. Please give me ideas for the doable ones.
I need to add a slider control in my iPhone application (that should resemble the one which is displayed in the iphone when the phone is getting charged).
Can the round button of the UISlider be changed to any other shape. Can any image be added on top of that round button?
When the UISlider is being moved, we need ad a sound effect(for example car stating sound) and when the sliding ends the sound should be stopped. is this possible? if yes, please gimme ideas to do this. 3. vibration should also happen while sliding (possible?)
Thanks in advance!!!

All of these can be done via the public API. Read the docs :-)
The button is called the "thumb image"; there's a property to replace the image.
Assign a delegate and set the 'continuous' property on the slider.
See the Application Programming Guide for more on delegates.

As far as question number 2, just write up the methods to accomplish playing a sound and vibrating and then have them fire when the value changes on the slider.

Related

Fade To Black When iPhone is Set Face Down

As a new AppDeveloper, I've never used orientation. So, I would like to try to learn with a simple task. What I want to do is have the screen fade to black when the device is set face down. Is that something that would be simple to do, that perhaps somebody could assist me in, or provide helpful information?
Thanks! :D
Your help is appriciated
You can use orientation (using the XYZ values when the screen is face down). I do not recommend this, because your screen will fade out even if a user is using the app while lying down, and staring up at the screen.
There is an easier and cleaner way. Notice how during phone calls, having the phone close to your ear blacks out the screen?
You can access that property by monitoring the proximityState property of UIDevice. Details here
Doing something like:
BOOL closeToUser = [[UIDevice currentDevice] proximityState];
will assign a YES to closeUser when the device is face down on a surface of some kind, and a NO when it is not
If the value is YES, you can invoke code to do whatever you want.

Recreating the iTunes (iOS app) tableViewCell which previews songs

I'm creating an app which would provide the user with a list of audio files and let them sample a small piece of audio when they select the song (just like the iTunes iOS app).
I love the way the iTunes iOS App has implemented it (image attached); wherein I can click on a cell and the album cover flips over to show a progress indicator and a stop button. I can select a cell and the sample starts to play, and the moment I stop it, the progress indicator flips back over to show the album/song art.
I'd like to create something like that for my app. Any suggestions on how I can go ahead with it.
Thanks a ton in advance! :D
EDIT: Based on Till's suggestion, I'm adding this edit. What I wish to get by asking this question is suggestions for the best approach to make the flip animation, showing a custom view in a UITableViewCell image space, possible. Currently, I'm not worried about playing the audio or displaying the progress of the playback. I simply need suggestions on the best approach to perform the flip animation and substitute the image with a custom UIView. :) Thanks again! :D
You will need to create it. I suggest making it as a custom tablecell. If you polish it well enought, you can put it on CodeCanyon and make it worth your while.
Also, I can recommend looking at the works on http://cocoacontrols.com/ - It might not have exactly this one, but it has many interesting controls and inspirations.
This is exactly what u looking for:
https://github.com/marshluca/AudioPlayer
You can also refer to some Sources :
https://github.com/lipka/LLACircularProgressView

how to activate the thumb of slider to work as a button?

I want to make the thumb of my slider to work as the button so that when a user done selecting the value and pull his finger up it should do something i want.
Is there any way to do this.
Thanks,
Hi,
Create this function
- (IBAction)mySliderUserFinshed:(UISlider *)theSlider
Make sure you add it to the header of you file.
The in interface builder, right click on the slider you want to act as a button.
You will need to wire up the Sent Event
Touch Up Inside to the function that you created. If you dont know how to use interface builder watch a few quick videos on youtube or in Xcode 4 there is a short guide on some of the new and awesome features of xCode 4 with very very cool videos (takes about 10mins to watch and will save you hours of coding).
Good Luck, John.

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)

Making fire effect on iPhone

I'll describe ways that I already know, and can do, and want to hear another suggestions, or may be even solutions :)
Create N frames of fire with semi-transparent pictures (PNGs)
Like at this site
Create pixel-based fire - line by line with shifting up. (not the best way I think)
Like here
Any other solutions?
Mr.doob's fire effect in flash is very clever.
Particles Fire Prototype by Nicolas Goles
Chapter 7 of iPhone Games Projects begins with a discussion of fire effects.
A movie with the fire animation playing, or maybe an animated .gif image.