New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[✨ FEAT] : CloudKit Manager 생성 #27
Comments
위에서 제시하는 순서대로 아래의 코드를 import UIKit
import CoreData
import CloudKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
lazy var persistentContainer: NSPersistentCloudKitContainer = {
let container = NSPersistentCloudKitContainer(name: "GiveCake")
container.loadPersistentStores(completionHandler: {
(storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
...
|
https://www.raulferrergarcia.com/en/develop-a-todo-app-with-cloudkit/ 다만 중간에 .perfrom()함수가 fetch()함수로 대체된다고 합니다. /// `CKQueryOperation` is the more configurable, `CKOperation`-based alternative to this method
///
/// Queries can potentially return a large number of records, and the server will return those records in batches. This API may return a `queryCursor` which can be used to continue the query via the `fetch(withCursor:)` function.
///
/// The successful result of this function includes a dictionary mapping matched record IDs to the fetched record.
///
/// If a record fails in post-processing (say, a network failure materializing a `CKAsset` record field), the record ID will map to a per-record error instead
///
/// - Parameter zoneID: Declares which zone the query should target. Nil indicates "perform query across all zones in the database"
/// Queries invoked within a `sharedCloudDatabase` must specify a `zoneID`; cross-zone queries are not supported in a `sharedCloudDatabase`
/// - Parameter desiredKeys: Declares which user-defined keys should be fetched and added to the resulting `CKRecord`s. If `nil`, declares the entire record should be downloaded. If set to an empty array, declares that no user fields should be downloaded.
/// - Parameter resultsLimit: If set, requests that the server limit the number of matched records sent in any one response. The server may choose to set its own limit lower than this value.
@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)
public func fetch(withQuery query: CKQuery, inZoneWith zoneID: CKRecordZone.ID? = nil, desiredKeys: [CKRecord.FieldKey]? = nil, resultsLimit: Int = CKQueryOperation.maximumResults, completionHandler: @escaping (Result<(matchResults: [(CKRecord.ID, Result<CKRecord, Error>)], queryCursor: CKQueryOperation.Cursor?), Error>) -> Void) |
이 부분은 어떤 용도로 쓰이는건가요?? 올려주신 레퍼런스에 같은 코드가 기입되있지 않은거 같아 잘 이해가 안갑니다 ㅠ |
@SeonJeon 결론은 맞습니다 fetch함수는 쓰이지 않았어요. |
작업내용
스크린샷
UI 작업은 없습니다.
Reference
레퍼런스는 그때그때 올릴게요.
The text was updated successfully, but these errors were encountered: