What I am trying to do: I want to move the x and y coordinates of my search bar on a touch event. I have placed my code in viewDidLoad to test it out. However I am getting an error.
Error: Property 'frame' not found on object of type 'UISearchBar'.
My code:
NSNumber *newX = @0;
NSNumber *newY = @0;
[UIView animateWithDuration:0.3f animations:^{
[UISearchBar setFrame:CGRectMake(newX, newY, UISearchBar.frame.size.width,
yourSearchBar.frame.size.height)];
}
completion:^(BOOL finished) {}
];
Ultimately I would like that animation/move to be executed when the search bar is selected and then move back after deselect.