0

Could someone please explain how to use TwitterKit start to finish to setup and iOS/Swift view controller to display a single user's timeline. The documentation on Fabric is poor and doesn't explain all app delegate/view controllers necessary.

Ben Thomas
  • 105
  • 2
  • 12

2 Answers2

2

Here's a little GIF of the main steps required to show a timeline in your app.

Demo

Steven Hepting
  • 12,394
  • 8
  • 40
  • 50
0

Add Fabric to your project https://docs.fabric.io/apple/fabric/overview.html its very easy.

import TwitterKit

Swift 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)
user3711263
  • 69
  • 1
  • 9