2017-03-01 22 views
0

在您的iOS SDK PlivoLogin中,有PlivoLoginAppDelegate.h和PlivoLoginAppDelegate.m。 我想將其更改爲swift文件。 我將其更改爲以下內容。無法將iOS中的PlivoLoginAppDelegate更改爲swift

import UIKit 
 

 
@UIApplicationMain 
 
class AppDelegate: UIResponder, UIApplicationDelegate { 
 

 
class var shared: AppDelegate { 
 
return UIApplication.shared.delegate as! AppDelegate 
 
} 
 
    
 
var providerDelegate: ProviderDelegate? 
 
    
 
var window: UIWindow? 
 
@IBOutlet var viewController: ViewController? 
 
var phone: Phone? 
 
    
 
// MARK: UIApplicationDelegate 
 
    
 
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { 
 
print("Finished launching with options: \(launchOptions)") 
 
    
 
// // Phone 
 
self.phone = Phone() 
 
self.viewController = self.window?.rootViewController as? ViewController 
 
self.viewController?.phone = self.phone 
 
self.phone?.setDelegate(self.viewController) 
 
    
 
    
 
return true 
 
} 
 
... 
 
}

但日誌只是說

  • 創建端點
  • 生成隨機密碼

和停止,未能獲得代表迴應 - (無效)successWithResponse :. 我們如何獲得委託迴應?

回答

0

Plivo銷售工程師在這裏。

Plivo iOS SDK具有Objective C接口,您可以從Swift 3.0訪問Objective-C庫。 This是使用iOS SDK的Objective-C界面的Swift 3.0中的示例應用程序。這個應用程序進行傳出調用,並獲取Swift 3.0中的委託回調。

相關問題