I have successfully displayed in my app Timelines from a single user with:
let client = TWTRAPIClient()
self.dataSource = TWTRUserTimelineDataSource(screenName: “fabric”, APIClient: client)
My app already has Login in with Twitter and I have multiple users. I want to be able to show the user that is logged in their
Twitter Profile Timeline based on their session. In my current ViewController I’m using
let store = Twitter.sharedInstance().sessionStore
let lastSession = store.session
let sessions = store.existingUserSessions()
lass TimelineViewController: TWTRTimelineViewController {
override func viewDidLoad() {
super.viewDidLoad()
let client = TWTRAPIClient()
self.dataSource = TWTRUserTimelineDataSource(screenName: "session!.userID", APIClient: client)
Twitter.sharedInstance().logInWithCompletion {(session, error) in
if let s = session {
print("logged in user with id \(session!.userID)")
} else {
// log error
}
}
}
}
It is currently printing the correct user’s ID that’s logged in I want to make this view show the current logged in user’s timeline.