How to add annotations programmatically in iOS

To programmatically add annotations to the saved annotation list, you need to create a new AnnotationSet and append it to the annotation sets stored in SavedAnnotationsViewController.sharedAnnotationStore, like so:

// New annotations to save.
let annotations = /* ... */
// Get the default annotation set store.
let store = SavedAnnotationsViewController.sharedAnnotationStore
// Modify the stored annotation sets.
try store.modifyAnnotationSets { annotationSets in
annotationSets.append(AnnotationSet(annotations: annotations, copyAnnotations: true))
}