[iOS] Twitter Timeline


#1

So I have been out of the mobile app programing arena for a while and am trying to get back into it. The app I am currently working on needs to be able to show a timeline from a Twitter account without requiring the user to login, as this is partially so people who don’t have Twitter can stay up to date as well. When I saw all that Fabric brings I was greatly excited. I was successful in getting a single Tweet to show using the documentation and examples that Fabric provides, however, have not had any luck with getting a timeline to show.

I tried looking over this post: [iOS] TWTRTimelineViewController tweets not displaying

It is for a specific login though so I was unable to figure out how to correct this for a guess login. I will admit that the fact that I am also transitioning to Swift from Objective C does not help I am sure as well.


#2

Hey there,

Take a look at this modified LoginViewController from the other thread:

import UIKit
import TwitterKit

class LoginViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        Twitter.sharedInstance().logInGuestWithCompletion { guestSession, error in
            if (guestSession != nil) {
                let vc = ViewController()
                self.presentViewController(vc, animated: true, completion: nil)
            } else {
                println("error: \(error.localizedDescription)");
            }
        }
    }
}

V


#3

The program is still crashing. The error has to do with a lack of UITableView when it is expecting one. I clearly don’t have as much of an understanding of what the Timeline view is trying to do as I thought I did. Thank you for your help.


#4

Ok, after further examination and study I figured out why the TableView error was happening. Now if I could get the pesky navigation bar to work properly I would be set. Thank you again for your help.


#5

What issue are you running into with the nav bar?

V


#6

The TableView and the Nav bar were overlapping. I managed to get that resolved though.

Now I can’t get the timeline that was working to show up at all. I got a notification that there was an update to Fabric, so I installed it. It immediately caused an error with this code:

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

It says that the method is now not accessible anymore so I just commented it out. Error goes away, program compiles and runs. When I go to where the Timeline used to be in the app now I just get a blank TableView


#7