質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Q&A

解決済

1回答

247閲覧

エラーメッセージ「Use of unresolved identifier 'Twitter'」が表示されてしまう

tora1986

総合スコア7

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

0グッド

0クリップ

投稿2018/01/30 11:05

前提・実現したいこと

ここに質問の内容を詳しく書いてください。
(例)PHP(CakePHP)で●●なシステムを作っています。
■■な機能を実装中に以下のエラーメッセージが発生しました。

発生している問題・エラーメッセージ

Use of unresolved identifier 'Twitter'

該当のソースコード

swift

1import UIKit 2import TwitterKit 3import Firebase 4 5@UIApplicationMain 6class AppDelegate: UIResponder, UIApplicationDelegate { 7 8 var window: UIWindow? 9 10 11 func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { 12 13 if Twitter.sharedInstance().application(app, open: url, options: options) { 14 return true 15 } 16 return true 17 } 18 19 20 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 21 22 FirebaseApp.configure() 23 24 Twitter.sharedInstance().start(withConsumerKey:"", cosumerSecret:"") 25 26 27 // Override point for customization after application launch. 28 return true 29 } 30 31 func applicationWillResignActive(_ application: UIApplication) { 32 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 34 } 35 36 func applicationDidEnterBackground(_ application: UIApplication) { 37 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 } 40 41 func applicationWillEnterForeground(_ application: UIApplication) { 42 // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 43 } 44 45 func applicationDidBecomeActive(_ application: UIApplication) { 46 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 47 } 48 49 func applicationWillTerminate(_ application: UIApplication) { 50 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 } 52 53 54} 55 56

試したこと

udemyのビデオの手順通りに作業した(つもり)だが、ビデオに表示されているコードと何度見比べてもエラーが2ヶ所表示されてしまう。

補足情報(FW/ツールのバージョンなど)

Xcode ver9.2

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

nakasho_dev

2018/01/30 13:22

「Twitter」が名前解決できないようですが「import TwitterKit」は認識されているのでしょうか。
tora1986

2018/01/30 14:03

ありがとうございます。一応、動画の流れに沿ってターミナルでpod installは試みました。それだけでは認識されないのでしょうか?
nakasho_dev

2018/01/30 14:57

「import TwitterKit」で特にエラーが出ていないのであればimportは問題なさそうですね。Udemyは有料コンテンツなのでこちらに多くの情報を載せられないでしょうし、Udemyの講師へ質問したらいかがでしょうか。
tora1986

2018/01/31 00:00

かしこまりました。色々とありがとうございます!
guest

回答1

0

ベストアンサー

https://teratail.com/questions/107623

これと同じ話ではないでしょうか?

投稿2018/01/30 17:53

TakeOne

総合スコア6299

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

tora1986

2018/01/31 01:37

おっしゃる通り TWTRTwitter.sharedInstance() と記載したらうまく行きました!ありがとうございます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問