mirror of
https://github.com/tappollo/WWDC.git
synced 2026-01-12 22:45:32 +08:00
30 lines
580 B
Swift
30 lines
580 B
Swift
//
|
|
// CMSCloudKitRepresentable.swift
|
|
// WWDC
|
|
//
|
|
// Created by Guilherme Rambo on 15/05/17.
|
|
// Copyright © 2017 Guilherme Rambo. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import CloudKit
|
|
|
|
public enum CMSCloudKitError: Error {
|
|
case missingKey(String)
|
|
case invalidData(String)
|
|
case notFound
|
|
}
|
|
|
|
public protocol CMSCloudKitRepresentable {
|
|
|
|
static var recordType: String { get }
|
|
|
|
var originatingRecord: CKRecord? { get set }
|
|
var identifier: String { get }
|
|
|
|
init(record: CKRecord) throws
|
|
|
|
func makeRecord() throws -> CKRecord
|
|
|
|
}
|