Skip to content

Instantly share code, notes, and snippets.

@jhoughjr
Last active May 13, 2016 05:50
Show Gist options
  • Save jhoughjr/27ba04f758f7eecbc4ec4b2f6627f32a to your computer and use it in GitHub Desktop.
Save jhoughjr/27ba04f758f7eecbc4ec4b2f6627f32a to your computer and use it in GitHub Desktop.
func migrate(noteManager:NoteManager) {
let coreDataNotes = GNNote.MR_findAll() ?? []
for case let note as GNNote in coreDataNotes {
if let bundleID = note.appBundleID, docPath = note.documentPath, content = note.content where !content.string.isEmpty {
noteManager.createNote(bundleID, docID: docPath, content: content)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment