Skip to content

Request for additional example code #1

@jbehrens94

Description

@jbehrens94

Hi @AvdLee,

Thank you very much for this helpful repository and the great examples you gave. I was wondering if you could add more example code to demonstrate how you would setup the PersistentContainer + PersistentHistoryTracking for a second target, because if I'm correct, you don't demonstrate that yet.

I would guess you don't want every instance of PersistentContainer.shared to have the .app target such as in the example from your repository below:

func startObservingPersistentHistoryTransactions() -> PersistentHistoryObserver {
        let observer = PersistentHistoryObserver(.app, userDefaults: .standard, persistentContainer: self)

        viewContext.name = "view_context"
        viewContext.transactionAuthor = "main_app_view_context"

        observer.startObserving()
        return observer
}

Would you compile different extensions per target for example, or build several PersistentContainer instances per target?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions