IOS以编程方式拒绝来电?

时间:2017-02-20 12:07:59

标签: ios iphone swift swift3

有没有办法在swift中以编程方式拒绝来电。我的代码是这样的:

self.callCenter.callEventHandler = {(_ call: CTCall) -> Void in
            if call.callState == CTCallStateDisconnected {
                print("Call has been disconnected")
            }
            else if call.callState == CTCallStateConnected {
                print("Call has just been connected")
            }
            else if call.callState == CTCallStateIncoming {
                print("Call is incoming")
                }
            else {
                print("None of the conditions")
            }

我通过这种方式检测来电状态。但我不知道如何更改callstate的{​​{1}}。请帮帮我!

1 个答案:

答案 0 :(得分:0)

function String getStringOfSource()
{
   return "username=" + source.username + " password=" + source.password;
}