iostwitter-bootstrapswift3fhs-twitter-engine

After convert my code to swift 3 Twitter not get the users profile image


I'm using FHSTwitter Engine. In that, I can get Username by using FHSTwitterEngine.shared().authenticatedUsername this. But FHSTwitterEngine.shared().getProfileImageURLString(forUsername: username as String, andSize: FHSTwitterEngineImageSizeOriginal in this I got error like Error Domain=FHSErrorDomain Code=204 "The request did not return any content. How to I get profile image? But It's work fine for swift 2.0. How to solve this Issue.


Solution

  • This error occurs when the user name is incorrect. This should work.

    let profilepic = FHSTwitterEngine.shared().getProfileImageURLString(forUsername: FHSTwitterEngine.shared().authenticatedUsername, andSize: FHSTwitterEngineImageSizeOriginal)
    print("profile pic is \(profilepic)")