タグ付けされた質問 「swift2」

このタグは、AppleのSwiftプログラミング言語のバージョン2.xの変更に直接関連する質問にのみ使用してください。より一般的な言語の質問にはタグ[swift]を使用します。Appleプラットフォームでの開発に関する質問には[ios]、[cocoa]、[apple-watch]などのタグを使用します。

2
Swiftで「catchall」例外の詳細を印刷するにはどうすればよいですか?
Swiftを使用するようにコードを更新していますが、「catchall」句に一致する例外のエラーの詳細を出力する方法を知りたいと思っています。私のポイントを説明するために、このSwift言語ガイドページの例を少し変更しました。 do { try vend(itemNamed: "Candy Bar") // Enjoy delicious snack } catch VendingMachineError.InvalidSelection { print("Invalid Selection.") } catch VendingMachineError.OutOfStock { print("Out of Stock.") } catch VendingMachineError.InsufficientFunds(let amountRequired) { print("Insufficient funds. Please insert an additional $\(amountRequired).") } catch { // HOW DO I PRINT OUT INFORMATION ABOUT THE ERROR HERE? …
84 ios  swift  swift2 

6
通常のメソッドからプロトコルのデフォルト実装を呼び出す
そのようなことを成し遂げることは可能かと思います。 私はこのような遊び場を持っています: protocol Foo { func testPrint() } extension Foo { func testPrint() { print("Protocol extension call") } } struct Bar: Foo { func testPrint() { // Calling self or super go call default implementation self.testPrint() print("Call from struct") } } let sth = Bar() sth.testPrint() でデフォルトの実装を提供できますが、デフォルトの実装にあるすべてのものに加えて追加のものが必要extensionな場合Barはどうなりますか?すべてのプロパティなどを実装するという要件を満たすためにesでメソッド を呼び出すのとどういうわけか似ていますが、で同じことを達成する可能性はありません。super.classstructs
83 swift  oop  protocols  swift2 


17
フレームワークが見つかりませんGoogleToolboxForMac
「ポッドアップデート」でFirebaseをアップデートした後、次のようなエラーが発生しました: ld: warning: directory not found for option '-F/Users/bennysantoso/Library/Developer/Xcode/DerivedData/FCM-atfcxuircoryufazlomgwfgmvaqm/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac' ld: framework not found GoogleToolboxForMac clang: error: linker command failed with exit code 1 (use -v to see invocation) ここに私のポッドファイル: # Uncomment this line to define a global platform for your project # platform :ios, '9.0' pod 'Firebase/Core' pod 'Firebase/Messaging' target …

12
Swiftを使用してiOSでViewControllerを右から左に表示する方法
presentViewControllerを使用して新しい画面を表示しています let dashboardWorkout = DashboardWorkoutViewController() presentViewController(dashboardWorkout, animated: true, completion: nil) これにより、新しい画面が下から上に表示されますが、を使用せずに右から左に表示したいと思いUINavigationControllerます。 ストーリーボードの代わりにXibを使用していますが、どうすればよいですか?
82 ios  swift  swift2  segue 
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.