【问题标题】:Embed user timeline - Twitterkit/Swift嵌入用户时间线 - Twitterkit/Swift
【发布时间】:2015-07-28 21:39:40
【问题描述】:

有人可以解释一下如何使用 TwitterKit 开始到完成设置和 iOS/Swift 视图控制器来显示单个用户的时间线。 Fabric 上的文档很差,并没有解释所有必要的应用程序委托/视图控制器。

【问题讨论】:

  • 听起来你在找教程……

标签: xcode swift twitter twitter-fabric


【解决方案1】:

这是在您的应用中显示时间线所需的主要步骤的小 GIF。

【讨论】:

    【解决方案2】:

    将 Fabric 添加到您的项目 https://docs.fabric.io/apple/fabric/overview.html 非常简单。

    import TwitterKit
    

    斯威夫特 3

        // Create an API client and data source to fetch Tweets for the timeline
        let client = TWTRAPIClient()
        //TODO: Replace with your collection id or a different data source
        let dataSource = TWTRCollectionTimelineDataSource(collectionID: "539487832448843776", apiClient: client)
        // Create the timeline view controller
        let timelineViewControlller = TWTRTimelineViewController(dataSource: dataSource)
        // Create done button to dismiss the view controller
        let button = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(dismissTimeline))
        timelineViewControlller.navigationItem.leftBarButtonItem = button
        // Create a navigation controller to hold the
        let navigationController = UINavigationController(rootViewController: timelineViewControlller)
        showDetailViewController(navigationController, sender: self)
    

    【讨论】:

      猜你喜欢
      • 2016-03-17
      • 1970-01-01
      • 1970-01-01
      • 2013-05-13
      • 2017-02-19
      • 1970-01-01
      • 2018-06-05
      • 1970-01-01
      • 2016-07-20
      相关资源
      最近更新 更多