I'm developing a pdf parser in swift, so i've stumbled upon the function CGPDFScannerPopString which takes a CGPDFScannerRef and an UnsafeMutablePointer?
The Objective C code looks like this:
CGPDFStringRef pdfString;
CGPDFScannerPopString(pdfScanner, &pdfString);
How do I write this in swift 3?
The type of the second parameter of CGPDFScannerPopString
is UnsafeMutablePointer<CGPDFStringRef?>?
. So, you need to prepare a variable of type CGPDFStringRef?
and pass it as an inout argument:
var pdfString: CGPDFStringRef?
_ = CGPDFScannerPopString(pdfScanner, &pdfString)