TwitterKit - 无法在控制台上显示用户时间线

时间:2016-03-17 12:42:35

标签: swift twitter-fabric

我试图使用带有结构框架的TwitterKit获取用户时间线,当我运行以下代码时,我得到的是输出而不是时间轴

output  <TWTRUserTimelineDataSource: 0x7ff8b9447950>
  let client = TWTRAPIClient()
        let dataSource = TWTRUserTimelineDataSource(screenName: "fabric", APIClient: client)
        print(dataSource)

1 个答案:

答案 0 :(得分:0)

试试这可能会对你有所帮助

    import UIKit
    import TwitterKit

    class ViewController: TWTRTimelineViewController {

        convenience init() {
            let client = Twitter.sharedInstance().APIClient
            let dataSource = TWTRUserTimelineDataSource(screenName: "fabric", APIClient: client)

            self.init(dataSource: dataSource)
        }

        override required init(dataSource: TWTRTimelineDataSource) {
            super.init(dataSource: dataSource)
        }

        required init(coder aDecoder: NSCoder) {
            fatalError("init(coder:) has not been implemented")
        }
    }