Upgrading App to Swift 4 and iOS 11 - TwitterKit Issues

孤街浪徒 提交于 2019-12-06 02:18:15

Thank you, Andy Piper, I fixed the issue as following:

  1. Updated pod so that TwitterCore 3.1.0 and TwitterKit 3.3.0

  2. In Bridging-Header.h file

imported as TwitterKit/TWTRKit.h instead of TwitterKit/TwitterKit.h

  1. In didFinishLaunchingWithOptions,

    • Modified Twitter.sharedInstance().start(withConsumerKey: ”your consumer key”, consumerSecret:”your consumer secret”)

TWTRTwitter.sharedInstance().start(withConsumerKey: ”your consumer key”, consumerSecret:”your consumer secret”)

i.e replace Twiter with TWTRTwitter where it is used.

  • No need to initialize with fabric, so removed this line or removed

Fabric.with([Twitter.self]) or Fabric.with([TWTRTwitter.self])

There’s a bit of a code change with the latest Twitter Kit release. We changed Twitter -> TWTRTwitter - but also added a macro so that you should still be able to use [Twitter sharedInstance]. Unfortunately, this currently does not work with Swift - so have a try with TWTRTwitter as suggested. We'll get this sorted out in the docs! sorry!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!