Skip to content

Commit

Permalink
CallKit overlay with apinotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Moiseev committed Jul 8, 2016
1 parent c2c1b84 commit 29d7e66
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions apinotes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(SWIFT_API_NOTES_INPUTS
AVFoundation
AppKit
AudioToolbox
CallKit
CloudKit
CoreBluetooth
CoreData
Expand Down
16 changes: 16 additions & 0 deletions apinotes/CallKit.apinotes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
Name: CallKit
Classes:
- Name: CXProviderConfiguration
Properties:
- Name: 'supportedHandleTypes'
SwiftPrivate: true
Tags:
- Name: CXErrorCode
NSErrorDomain: CXErrorDomain
- Name: CXErrorCodeIncomingCallError
NSErrorDomain: CXErrorDomainIncomingCall
- Name: CXErrorCodeRequestTransactionError
NSErrorDomain: CXErrorDomainRequestTransaction
- Name: CXErrorCodeCallDirectoryManagerError
NSErrorDomain: CXErrorDomainCallDirectoryManager
1 change: 1 addition & 0 deletions stdlib/public/SDK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ endif()
# Please keep this list sorted.
add_subdirectory(AppKit)
add_subdirectory(AssetsLibrary)
add_subdirectory(CallKit)
add_subdirectory(CoreAudio)
add_subdirectory(CoreData)
add_subdirectory(CoreGraphics)
Expand Down
7 changes: 7 additions & 0 deletions stdlib/public/SDK/CallKit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_swift_library(swiftCallKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
CallKit.swift
CXProviderConfiguration.swift

TARGET_SDKS IOS IOS_SIMULATOR
SWIFT_MODULE_DEPENDS Foundation
FRAMEWORK_DEPENDS_WEAK CallKit)
29 changes: 29 additions & 0 deletions stdlib/public/SDK/CallKit/CXProviderConfiguration.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

@_exported import CallKit
import Foundation

@available(iOS 10.0, *)
extension CXProviderConfiguration {
@nonobjc
public final var supportedHandleTypes: Set<CXHandleType> {
get {
return Set(__supportedHandleTypes.map {
CXHandleType(rawValue: $0.intValue)!
})
}
set {
__supportedHandleTypes = Set(newValue.map { $0.rawValue })
}
}
}
11 changes: 11 additions & 0 deletions stdlib/public/SDK/CallKit/CallKit.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

0 comments on commit 29d7e66

Please sign in to comment.