Objective-C:
You need to import the class header that contains the method you want to use (ClassYouWantToUse.h) into the class you want to use in (TargetClass).
Inside TargetClass.h or TargetClass.m (depending on the area you want to give):
#import "ClassYouWantToUse.h"
Then create an instance of the class that you want to use inside the target class, or as a property like this:
@property (nonatomic,strong) ClassYouWantToUse *classObject;
Or as an instance variable:
ClassYouWantToUse *classObject;
Make sure you initialize it! (usually inside ViewDidLoad):
classObject = [[ClassYouWantToUse alloc] init];
Now you can call any public methods from this class as follows:
[classObject theClassMethodWithParam:param1 andSecondParam:param2]
Note. The ClassYouWantToUse class must have methods that you want to make available to others by declaring them in the header file:
- (void)theClassMethodWithParam:(UIImage*)someImage andSecondParam:(NSString*)someText;
Otherwise, you will not be able to see these methods.
Swift:
In fact, there is nothing special about this issue, just adding this as a link.
In the quick version, you simply create an instance of the class you want to use:
let classObject = ClassYouWantToUse()
And use it directly:
classObject.theClassMethodWithParam(param1, andSecondParam:param2)