How do I call this -(void){} (function, method? sorry, I forgot the terminology) from another .m file?
I would also like to be able to call it in the local .m file like such [self closeMenu];
Here’s the -(void){} :
-(void)closeMenu{
//close the menu
[UIView animateWithDuration:0.6 animations:^{
[UIView setAnimationBeginsFromCurrentState:YES]; // so it doesn't cut randomly, begins from where it is
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[menuView setFrame:CGRectMake(menuView.frame.origin.x, -menuView.frame.size.height, menuView.frame.size.width, menuView.frame.size.height)];
}];
}
You have to declare the method in a .h file that has the interface.
In YourClass.h
In YourClass.m
Then you have to import (
#import "YourClass.h") in the other file that you want to call this method from.