PSPDFSignatureStore
Objective-C
@protocol PSPDFSignatureStore <NSObject, NSSecureCoding>
Swift
protocol SignatureStore : NSSecureCoding, NSObjectProtocol
An object that stores signature annotations.
You can implement this protocol and set the object as the PDFConfiguration
’s signatureStore
to use your own backend for saving and loading the user’s signatures.
Read more: https://pspdfkit.com/guides/ios/signatures/signature-storage/
The store must support NSSecureCoding
because the store is part of the PDFConfiguration
object. If your store requires any identifiers such as a store name or a username, ensure these are serialized and deserialized.
If you want a simple on-device store, PSPDFKit provides KeychainSignatureStore
, which implements this protocol.
-
Add a signature to the store.
The new signature should be included in any future calls to
signatures
but your implementation is free be insert the new signature in any position, such as at the start or end.Declaration
Objective-C
- (void)addSignature:(nonnull PSPDFSignatureContainer *)signature;
Swift
func addSignature(_ signature: SignatureContainer)
-
Remove a signature from the store.
The signature should not be included in any future calls to
signatures
.Declaration
Objective-C
- (BOOL)removeSignature:(nonnull PSPDFSignatureContainer *)signature;
Swift
func removeSignature(_ signature: SignatureContainer) -> Bool
-
Access the saved signatures (
SignatureContainer
objects).This property may be set when the user reorders the signature list. Reading this property must preserve the order that was set.
Declaration
Objective-C
@property (nonatomic, copy, null_resettable) NSArray<PSPDFSignatureContainer *> *signatures;
Swift
var signatures: [SignatureContainer]! { get set }