Fabric how to show timeline of logged in users?

ios
fabric
api

#1

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.


#2

It looks like you are trying to pass a user ID as a screenname. Twitter user 2857397298 has chosen a Twitter screen name of “fabric.” Try setting the userID instead.
https://docs.fabric.io/appledocs/Twitter/Classes/TWTRUserTimelineDataSource.html