How to animate UISlider Handle like in Apple's Music App? - swift

I have a custom image as the handle for my UISlider, using the following code:
slider.setThumbImage(UIImage(named: "scrollerHandle")!, forState: .normal)
In the default music app on iOS, when you want to change the position of a song and you click on the music slider, the handle animates and gets bigger, then when you let it go it shrinks once again. How does one do this with a UISlider?
I greatly appreciate every body's help.
Image of the slider in the music app

Related

How to create a translucent layer on click of button, which would slide up for iphone

Hi I want to create a layer of the type in the image below.
The layer (with Capture mode and Shutter speed) slides up when I click on the setting button.
I am unable to figure out what should I do do create something like this. Also want to have the similar translucency in the layer as well as in the buttons on it also.
On click on the same button again, the layer(with Capture mode and Shutter speed) disappears, leaving what was there on the screen before (the camera view and the lower bar with the camera capture button, and the two setting buttons)
Please any suggestions are much appreciated.
Thanks
Maybe you can create a UIView and place every button you need there, and place it below the screen size. then when you click the setting button you call core animation to move the view up, click setting again to move it down.

Display image of first frame of movie in MPMoviePlayerController before playing movie

I am a beginner in iPhone Development. I have an object of MPMoviePlayerController which loads a video from my application resource bundle. I have set the backgroundColor of the MPMoviePlayer to clear color. I have set shouldAutoplay property to NO. Before the user clicks on the play button, a blank screen is displayed. I tried to get the first image using the following method
UIImage *thumbnail =
[self.videoPlayer thumbnailImageAtTime:0 timeOption:MPMovieTimeOptionNearestKeyFrame];
But where do I set this image so that the black screen which appears before the user clicks on the play button will contain only the thumbnail image. Please help.
You are setting clear color as an background color. So try setting an imageview below ur movieplayer and if that continues to show black screen, add it above ur player.
When the user plays video, just hide ur imageview.

Working with iphone camera

I am using UIPickerView controller for displaying the camera on iphone screen for click event of button.
I want to add one button Draw Line on the camera screen and also i want to add an event with that Draw Line Button means if i will click on Draw Line button a one line will be draw on the screen of camera.
So pls reply me is it possible? and if yes then pls give me your reply with some examples or links.
This would be possible. You can achieve this with cameraOverlayView in UIImagePickerController.

How does iPhone draw controller?

I'm a newbie in iPhone development and now encounter a problem:
I want to add a small hotspot on a large image and simply came up with the idea that I can add a button in that area setting alpha 0 to hide the button. Unfortunately, the phone does not response click events any more. Instead, if I increase the alpha, I can receive click events without any problems. So I wonder in which order does iPhone draw controller on the screen. Is it because my background image is drawn after the button if I set alpha of button too low, so the click event is intercepted by the background image?
Any hints will be highly appreciated. Thank you all in advance!
Best Regards.
Set the button's style to Custom; the button will not be drawn, but should remain fully active.
The problem is not the order in which the views are drawn, it's rather that if a view's alpha is 0 it does not receive touch events. it's like the view is not there at all.
but you don't have to set the alpha to 0 on the UIButton, you can simply make it a Custom button instead of a Rounded Rect button. it'll be invisible and still work.

UIButton on iPhone -- making the button shake or wiggle

I have been working on this for a few days with no luck... I am using Interface Builder to build the views. I have a UIButton with an image as the background. When I shake the iPhone, I want the button to wiggle. Any ideas?
Wobbling effect code here: how to create iphone's wobbling icon effect?.
There are examples of shake detection in Apple sample code so I won't repeat it here. You'll want to set a threshold for how hard you want it shaken (and maybe in what direction, if you care). Once it reaches that point then just trigger the routine that kicks off the animation effect. You may want to turn off shake detection once it's started and then turn it back on in the animation completion handler.
I presume you'd have to change the CGRect defining the frame in which the button is drawn.