I used npx create-react-native-library to scaffold a module with the Swift template. My Swift code looks like this:
// ios/MyModule.swift
@objc(MyModule)
class MyModule: NSObject {
@objc(handleUserActivity:)
func handleUserActivity(_ userActivity: NSUserActivity) -> Void {
print("handleUserActivity > UserActivity", userActivity)
}
}
How can I access handleUserActivity inside the example app's AppDelegate.m file?
// example/ios/MyModuleExample/AppDelegate.mm
// <-- what do I import here to be able to access handleUserActivity?
@implementation AppDelegate
-(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
handleUserActivity(userActivity);
return YES;
}
I used
npx create-react-native-libraryto scaffold a module with the Swift template. My Swift code looks like this:How can I access
handleUserActivityinside the example app's AppDelegate.m file?