forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update master to build with Xcode 10 beta 1, OS X 10.14, iOS 12, tvOS…
… 12, and watchOS 5 SDKs.
- Loading branch information
1 parent
ec1ed4c
commit 3f8ce7d
Showing
60 changed files
with
6,404 additions
and
156 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
43 changes: 43 additions & 0 deletions
43
stdlib/public/SDK/CloudKit/CKFetchRecordZoneChangesOperation.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the Swift.org open source project | ||
// | ||
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See https://swift.org/LICENSE.txt for license information | ||
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
@_exported import CloudKit // Clang module | ||
|
||
@nonobjc | ||
@available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *) | ||
extension CKFetchRecordZoneChangesOperation.ZoneConfiguration { | ||
/** | ||
Declares which user-defined keys should be fetched and added to the resulting CKRecords. | ||
If nil, declares the entire record should be downloaded. If set to an empty array, declares that no user fields should be downloaded. | ||
Defaults to nil. | ||
*/ | ||
@available(swift 4.2) | ||
public var desiredKeys: [CKRecord.FieldKey]? { | ||
get { return self.__desiredKeys } | ||
set { self.__desiredKeys = newValue } | ||
} | ||
|
||
@available(swift 4.2) | ||
public convenience init(previousServerChangeToken: CKServerChangeToken? = nil, resultsLimit: Int? = nil, desiredKeys: [CKRecord.FieldKey]? = nil) { | ||
self.init() | ||
if let previousServerChangeToken = previousServerChangeToken { | ||
self.previousServerChangeToken = previousServerChangeToken | ||
} | ||
if let resultsLimit = resultsLimit { | ||
self.resultsLimit = resultsLimit | ||
} | ||
if let desiredKeys = desiredKeys { | ||
self.desiredKeys = desiredKeys | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the Swift.org open source project | ||
// | ||
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See https://swift.org/LICENSE.txt for license information | ||
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
@_exported import CloudKit | ||
|
||
// MARK: - Iterate over records | ||
|
||
@available(macOS 10.10, iOS 8.0, watchOS 3.0, *) | ||
public struct CKRecordKeyValueIterator : IteratorProtocol { | ||
private var keyArray: [CKRecord.FieldKey] | ||
private var record: CKRecord | ||
private var index: Array<CKRecord.FieldKey>.Index | ||
|
||
fileprivate init(_ record: CKRecord) { | ||
self.record = record | ||
keyArray = record.allKeys() | ||
index = keyArray.startIndex | ||
} | ||
|
||
public mutating func next() -> (CKRecord.FieldKey, CKRecordValueProtocol)? { | ||
var key: CKRecord.FieldKey? = nil | ||
var objcValue: __CKRecordObjCValue? = nil | ||
while objcValue == nil { | ||
guard index < keyArray.endIndex else { return nil } | ||
key = keyArray[index] | ||
objcValue = record[key!] | ||
index = index.advanced(by: 1) | ||
} | ||
|
||
let swiftValue = objcValue!.asSwiftNativeValue() | ||
|
||
return (key!, swiftValue) | ||
} | ||
} | ||
|
||
@nonobjc | ||
@available(macOS 10.10, iOS 8.0, watchOS 3.0, *) | ||
extension CKRecord : Sequence { | ||
public func makeIterator() -> CKRecordKeyValueIterator { | ||
return CKRecordKeyValueIterator(self) | ||
} | ||
} | ||
|
||
@nonobjc | ||
@available(macOS 10.10, iOS 8.0, watchOS 3.0, *) | ||
extension CKRecord { | ||
public typealias RecordType = String | ||
public typealias FieldKey = String | ||
|
||
@available(swift 4.2) | ||
public enum SystemType { | ||
public static let userRecord: CKRecord.RecordType = __CKRecordTypeUserRecord as CKRecord.RecordType | ||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) | ||
public static let share: CKRecord.RecordType = __CKRecordTypeShare as CKRecord.RecordType | ||
} | ||
|
||
@available(swift 4.2) | ||
public enum SystemFieldKey { | ||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) | ||
public static let parent: CKRecord.FieldKey = __CKRecordParentKey as CKRecord.RecordType | ||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *) | ||
public static let share: CKRecord.FieldKey = __CKRecordShareKey as CKRecord.RecordType | ||
} | ||
} | ||
|
Oops, something went wrong.