I try to fade the datepicker in and out smootly based on the switch setting on a view like below. I have tried the following in my view controller, but that just turns it on/off without animating.
-(IBAction)swithChanged:(id)sender{
BOOL setting = dateSwitch.isOn;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
datePicker.alpha = (setting) ? 100 : 0;
[UIView commitAnimations];
}
Also, is there a simple way to do other animations, like fly in from bottom/right/left on the datepicker (and other elements)?