[有人尝试过将CallKit
与SwiftUI
一起使用吗?谁能给我任何指示,无论是否可行? CallKit
与UIKit
配合得很好,但是,我还没有看到任何由SwiftUI
实现的此类功能。
我亲爱的朋友,使用CallKit
或Swift
实现swiftUI
并没有什么不同>
[在CallKit
或Swift
中创建SwiftUI
扩展名时,两者相同。
因此SwiftUI
和Swift
CallKit
的实现没有变化。
class CallDirectoryHandler: CXCallDirectoryProvider {
override func beginRequest(with context: CXCallDirectoryExtensionContext) {}
private func addAllBlockingPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
private func addOrRemoveIncrementalBlockingPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
private func addAllIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
private func addOrRemoveIncrementalIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
}
extension CallDirectoryHandler: CXCallDirectoryExtensionContextDelegate {
func requestFailed(for extensionContext: CXCallDirectoryExtensionContext, withError error: Error) {}
}
class CallDirectoryHandler: CXCallDirectoryProvider {
override func beginRequest(with context: CXCallDirectoryExtensionContext) {}
private func addAllBlockingPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
private func addOrRemoveIncrementalBlockingPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
private func addAllIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
private func addOrRemoveIncrementalIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) {}
}
extension CallDirectoryHandler: CXCallDirectoryExtensionContextDelegate {
func requestFailed(for extensionContext: CXCallDirectoryExtensionContext, withError error: Error) {}
}