iOS provides integrated support for social networks. Developers can use the Social framework allowing access social networks, post and share content in their apps. This post is focussed on using URL and images in Tweets.
The simplest one for composing Tweets is to implement the SLComposeViewController also known as “Tweet Sheet”. One of the advantages of using the Tweet Sheet is an automatic check of characters for a tweet. As long as you’re not adding URL or an image it’s going well.
In the images below you can see the difference in composing a tweet including an image using Twitter and the SLComposeViewController. SLComposeViewController is counting another 9 characters for the same image.
Include an URL in your tweet is as problematic as using images. And again SLComposeViewController is counting for another 9 characters . See the images below.
There are a more differences between Twitter and SLComposeViewController in handling an URL but not leading to wrong character count. For more information in the text processing routines Twitter is using for Tweets see https://github.com/twitter/twitter-text-js.
Back to URL and image counting in SLComposeViewController. Prior to the Social framework the Twitter framework provides the TWTweetComposeViewController. The framework was introduced in iOS 5 and deprecated in iOS 6. The solution for wrong character counting has to come from Apple but I don’t expect a quick solution for this because the TWTweetComposeViewController did also counted wrong.