This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // CKSyncHandler+SyncHandlerDelegate.swift | |
| // Pendo | |
| // | |
| // Created by Shawn Gong on 5/29/19. | |
| // Copyright © 2019 Lychee Isle. All rights reserved. | |
| // | |
| import CloudKit | |
| extension CKSyncHandler: SyncHandlerDelegate { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Since CloudKit doesn't provide a way to query all recordIDs, we should keep that info in a Meta record so that we can efficiently maintain in sync. | |
| A Meta record will have a String field "recordNames", which contains a list of record names like: | |
| {title}___note_{UUID}___{update}___deleted | |
| {title}___note_{UUID}___{update} | |
| {title}___note_{UUID}__media_{mediaUUID}___{update} | |
| {title}___note_{UUID}__media_{mediaUUID}_data___{update} | |
| At init we fetch the Meta to compile the recordNames, then when we write or delete records, update the Meta and upload. We listen to changes to it and update our local copy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func test() { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Fluent 2 model - note that in fluent.json I have: | |
| // "idType": "uuid", | |
| // "keyNamingConvention": "camelCase" | |
| import Foundation | |
| import Vapor | |
| import FluentProvider | |
| import HTTP | |
| final class User: Model { |
NewerOlder