我想在我的项目中集成Twitter登录。我正在使用Xcode7并关注Twitter login tutorial。但我收到AppDelegate value of type 'Twitter' has no member start
中的错误。我已经安装了pod 'TwitterKit'
并在#import <TwitterKit/TwitterKit.h>
中添加了bridging header
。下面是AppDelegate中的代码
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Twitter.sharedInstance().start(withConsumerKey:"hTpkPVU4pThkM0", consumerSecret:"ovEqziMzLpUOF163Qg2mj")
return true
}
任何帮助,将不胜感激。提前致谢
从你的代码看起来你似乎使用Swift2
但你使用Swift3
方法为Twitterkit
使用这个Swift2
方法再试一次,它应该适合你
Twitter.sharedInstance().startWithConsumerKey("your_key", consumerSecret: "your_secret")
使用此对于Swift4.0
TWTRTwitter.sharedInstance().start(withConsumerKey: "your_key", consumerSecret: "your_secret")