I have framework that written in Swift like this.
import Foundation
import WebKit
import ObjectiveC
public extension WKWebView {
public func someFunc(_ completionHandler:@escaping (_ capturedImage: UIImage?) -> Void) {
//Some code
}
}
When I build the frameworks and import to Objective-C code that use Cocoapods for Dependency Manager. I Can't call above someFunc function. The error said this:
No visible @interface for 'WKWebView' declares the selector 'someFunc'
This is how I implement Swift framework in Objective-C:
#import <Foundation/Foundation.h>
#import <ProjectName-umbrella.h>
@implementation CapturerDefault
- (void)captureWebViewScreenWith:(UIView *)containerView
andCompletionHandler:(void (^)(UIImage *))completion {
WKWebView *webView = [self findWebViewInViewController:containerView];
[webView someFunc: resultImage] //The error show here.
}
}
What is wrong? Did i miss something?