2016-11-03 7 views
0

xCode 7.4でswift 2.2で構築されたアプリケーションを変換しようとしています。私は現在xCode 8.1を使用しており、すべてのポッドを最新バージョンに更新しました。次に、すべてのコードをswift 3に変換しました.DBAlertControllerフレームワークのコンパイラエラーが6つある以外は、すべてうまくいっています。xcode 8プロジェクトを迅速に変換する3 - DBAlertControllerエラー

githubページを見ると、DBAlertControllerはswift 3をサポートしていないようです。私はxCode/swiftの開発には非常に新しく、ここで何が起こっているのかよくわかりません。私はもともと私のPodfileにバージョンを設定せず、バージョン0.2.6をインストールしました。私はgithubページでこれを見てからバージョンを0.3.0に設定しましたが、コンパイルエラーと、実行中のpod installのエラーが表示されます。私のcocoapodsのバージョンは1.2.0.beta.1です。

大変申し訳ございません。

[!] There are duplicate dependencies on `DBAlertController` in `Podfile`: 

- DBAlertController (~> 0.3.0) 
- DBAlertController 

答えて

0

コードをSwift 2.3に変換できます。

また、DBAlertControllerを使用する代わりに、自分で警告を表示することもできます。詳細

ため、この stackoverflow's post

let alertController = UIAlertController(title: "title", message: "message", preferredStyle: .Alert) 
//... 
var rootViewController = UIApplication.shared.keyWindow?.rootViewController 
if let navigationController = rootViewController as? UINavigationController { 
    rootViewController = navigationController.viewControllers.first 
} 
if let tabBarController = rootViewController as? UITabBarController { 
    rootViewController = tabBarController.selectedViewController 
} 
rootViewController?.present(alertController, animated: true, completion: nil) 

ルック:あなたはこのような何かを行うことができ

let alertController: UIAlertController = UIApplication.shared.keyWindow?.rootViewController?.present(alertController, animated: true, completion: nil) 

または:Swift 3.0では、アラートとして表示することができます

関連する問題