我引用了两个框架[PDFGenerator和PDFKit],它们都包含一个名为PDFPage的对象。在PDFGenerator框架中,PDFPage是一个枚举。在PDFKit框架中,PDFPage是一个对象。当我尝试创建PDFPage枚举的实例时,出现错误:
“ PDFPage”在这种情况下对于类型查找是不明确的。”
如何指定要实例化的PDFPage?
下面的简化示例:
import PDFKit
import PDFGenerator
public class VC: UIViewController {
var page:PDFPage? // <-- This throws the error mentioned above.
}
答案 0 :(得分:0)
尝试使用此代码将解决错误。
import PDFKit
import PDFGenerator
public class ViewController: UIViewController {
let page = PDFPage() // <-- This solve the error mentioned above.
override public func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override public func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}