@mark This method has always returned a
id <TWTRAuthSession>. The
TWTRSessionStore actually lives in the TwitterCore framework which is shared by a few of our kits which is why it returns the protocol instead of a class. There is a method on the
Twitter shared instance which returns a
TWTRSession which is just a concrete implementation of the
TWTRAuthSession protocol. So, if you call
Twitter.sharedInstance().session you will get the
TWTRSession class but we do not recommend this and have deprecated it. We introduced the
TWTRSessionStore in version 1.10 of TwitterKit because it is much safer to be explicit about which sessions you are referring to instead of relying on the global session object. You can still get the TWTRSession object safely by calling
let session = Twitter.sharedInstance().sessionStore.session as? TWTRSession to get back to the TWTRSession instance so you can have access to the username property. We realize that this is less than ideal and are still actively thinking about ways to make this simpler to use while keeping the safety that the session store provides.
We were hoping the deprecation warnings from September would’ve given developers enough advance notice and ease the transition a bit but please let us know how we could’ve done better. The old method still exist if you would like to use them but they will likely be removed in the 2.0 version of Twitter.