项目为OC与Swift混编,在swift类里面使用Webkit
import UIKit
import WebKit
class WebVC: UIViewController,WKNavigationDelegate,WKUIDelegate,UIScrollViewDelegate{
//编译的编译时,一直提示:Cannot find protocol declaration for 'WKNavigationDelegate'; did you mean 'UINavigationBarDelegat
//在当前类里面引入WebKit 报错
//在TARGETS->Gender->Framework,Libraries,and Embedded Content 里面引入 WebKit依然报错,
}
image.png
解决办法:在项目pch文件里面:
'#import <WebKit/WebKit.h>'
网友评论