I need to write these two Swift functions in Objective-C and then call the returned values in Swift how do i go about doing this?
Also where do i need to put them in my AppDelegate?
Sorry this might be really easy but I have no experience using Objective-C.
Thanks in advance!
Functions to convert:
class func getAppDelegate() -> AppDelegate {
return UIApplication.shared.delegate as! AppDelegate
}
func getDocDir() -> String {
return NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
}
AppDelegate.m:
#import "AppDelegate.h"
#import "MainViewController.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
}
@end
AppDelegate.h:
#import <Cordova/CDVViewController.h>
#import <Cordova/CDVAppDelegate.h>
@interface AppDelegate : CDVAppDelegate {}
@end