2017-12-22 11 views
1

私はXcodeと迅速に新しいです。私はTwitterKitで作業を開始しているTwitter.sharedInstance()は存在しません。すぐにTwitterKit

、私はcocoapodsを使用して私のプロジェクトでそれをインストールしている、私はこのチュートリアルに従っ:https://dev.twitter.com/twitterkit/ios/installation

問題は、私はAppDelegateでTwitterKitを初期化しようとすると、私が使用することはできませんTwitterが存在しないため、Twitter.sharedInstaceがあります。ここで

(私はimport TwitterKitを使用してAppDelegateでTwitterKitをインポートした)私のアプリDelegeteクラスである:私は間違っ

import UIKit 
import TwitterKit 
import Firebase 
import FirebaseAuth 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate { 

var window: UIWindow? 


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
     // Override point for customization after application launch. 
     Twitter.sharedInstance().start(withConsumerKey:"********", consumerSecret:"*******") 
     //Here I get the error: Use of unresolved identifier 'Twitter'  
     return true 
     } 

何をしているのですか?

+0

cocoapodsを使用する場合は、プロジェクトではなく作業領域を開く必要があります。あなたはそれをやりました? –

+0

ココアポッドを使用する場合は、プロジェクトを作成してフレームワークを作成してから、TwitterKitを使用することができます – Lenny1357

+0

[アプリケーションをSwift 4とiOS 11にアップグレードする - TwitterKitの問題点](https://stackoverflow.com/questions)/47858555/upgrade-app-to-swift-4-and-ios-11-twitterkit-issues) –

答えて

2

Swift 4を使用する場合は、TwitterクラスがTWTRTwitterに置き換えられているため、Twitter.sharedInstance()のTWTRTwitter.sharedInstance()を使用する必要があります。 Object Cでは、この変更を隠しているマクロがあるので、この問題はありません。残念ながら "dev.twitter.com"は更新されていません。

関連する問題