Reputation:
The below block of code yields these two errors when I try to build. Can anybody help me out? Xcode 8 had its way with my project using its migrator and I haven't seen this error before.
let url = URL(string: "http://www.google.com")!;
var pdf:CGPDFDocument = CGPDFDocument(url);
error: cannot invoke initializer for type 'CGPDFDocument' with an argument list of type '(URL)'
note: overloads for 'CGPDFDocument' exist with these partially matching parameter lists: (CGDataProvider), (CFURL)
Upvotes: 2
Views: 1755
Reputation: 7415
Hello it should like this below.
let url = URL(string: "http://www.google.com")!
fileprivate var pdfDoc: CGPDFDocument
pdfDoc = CGPDFDocument(url as CFURL)!
Upvotes: 3