Sequence Protocol
Hi, when trying to iterate through the form container I get:
Type 'ILPDFFormContainer?' does not conform to protocol 'Sequence'
Any thoughts?
Any idea? I have the same problem!
I have ended up opening my pdf in Adobe Acrobat and making a note of all the form fields ID, I then use these strings to refer to the form fields which works fine.
Thanks @shnabz! I've used the same solution although I'm looking for a dynamic solution.
@fboemeke I've found a solution! Add this extension to your .swift file.
extension ILPDFFormContainer: Sequence {
public func makeIterator() -> NSFastEnumerationIterator {
return NSFastEnumerationIterator(self as NSFastEnumeration)
}
}
You can then do:
for form in document.forms {
let x = form as! ILPDFForm
print(x.name)
}
@shnabz Thank you!