All Projects → DynamicSignal → Ios Twitter Text Counter

DynamicSignal / Ios Twitter Text Counter

Licence: mit
This custom UIControl resembles Twitter's new progress based web UI that represents the number of characters left. It also handles highlighting any extra characters in your UITextView.

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Ios Twitter Text Counter

Holehe
holehe allows you to check if the mail is used on different sites like twitter, instagram and will retrieve information on sites with the forgotten password function.
Stars: ✭ 568 (+3241.18%)
Mutual labels:  twitter
Integrations
Connect your App to Multiple Messaging Channels with the W3C Open standard.
Stars: ✭ 721 (+4141.18%)
Mutual labels:  twitter
Tweetinvi
Tweetinvi, an intuitive Twitter C# library for the REST and Stream API. It supports .NET, .NETCore, UAP (Xamarin)...
Stars: ✭ 812 (+4676.47%)
Mutual labels:  twitter
Clone Wars
100+ open-source clones of popular sites like Airbnb, Amazon, Instagram, Netflix, Tiktok, Spotify, Whatsapp, Youtube etc. See source code, demo links, tech stack, github stars.
Stars: ✭ 12,604 (+74041.18%)
Mutual labels:  twitter
Tweetscraper
TweetScraper is a simple crawler/spider for Twitter Search without using API
Stars: ✭ 694 (+3982.35%)
Mutual labels:  twitter
Notify
A dead simple Go library for sending notifications to various messaging services.
Stars: ✭ 727 (+4176.47%)
Mutual labels:  twitter
Hate Speech And Offensive Language
Repository for the paper "Automated Hate Speech Detection and the Problem of Offensive Language", ICWSM 2017
Stars: ✭ 543 (+3094.12%)
Mutual labels:  twitter
Um Twitteremojianalysis
Twitter Emoji Analysis
Stars: ✭ 6 (-64.71%)
Mutual labels:  twitter
Trump2cash
A stock trading bot powered by Trump tweets
Stars: ✭ 6,054 (+35511.76%)
Mutual labels:  twitter
Twitter Kit Android
Twitter Kit for Android
Stars: ✭ 808 (+4652.94%)
Mutual labels:  twitter
Blog
blog of sivagao,每天一篇好文章~
Stars: ✭ 616 (+3523.53%)
Mutual labels:  twitter
Social Amnesia
Forget the past. Social Amnesia makes sure your social media accounts only show your posts from recent history, not from "that phase" 5 years ago.
Stars: ✭ 656 (+3758.82%)
Mutual labels:  twitter
Twitter
Twitter API for Laravel 5.5+, 6.x, 7.x & 8.x
Stars: ✭ 755 (+4341.18%)
Mutual labels:  twitter
Twitter Lite
A tiny, full-featured, flexible client / server library for the Twitter API
Stars: ✭ 611 (+3494.12%)
Mutual labels:  twitter
Social Network Harvester V1.0
Stars: ✭ 5 (-70.59%)
Mutual labels:  twitter
Bettertweetdeck
A browser extension to improve TweetDeck with a lot of features
Stars: ✭ 558 (+3182.35%)
Mutual labels:  twitter
Twitterapi
Minimal python wrapper for Twitter's REST and Streaming APIs
Stars: ✭ 724 (+4158.82%)
Mutual labels:  twitter
Twitter Post Fetcher
Fetch your twitter posts without using the new Twitter 1.1 API. Pure JavaScript! By Jason Mayes
Stars: ✭ 886 (+5111.76%)
Mutual labels:  twitter
Twittervideouploader
Upload Short vido to Twitter
Stars: ✭ 5 (-70.59%)
Mutual labels:  twitter
Stocktalk
Data collection tool for social media analytics
Stars: ✭ 765 (+4400%)
Mutual labels:  twitter

iOS Twitter Text Counter

Version License Platform

This custom UIControl resembles Twitter's new progress based web UI that represents the number of characters left. It also handles highlighting any extra characters in your UITextView.

Screenshot

Here's an animated screenshot to show you an idea of how it works.

ScreenShot

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

You should install twitter-text and use it to parse your string then pass your weightedLength to the control.

Installation

Cocoapods: VSTwitterTextCounter is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'VSTwitterTextCounter'

Manual:

  1. In your Xcode Project, take VSTwitterCounter.swift from VSTwitterTextCounter folder and drag them into your project.

  2. Start using this new UIControl Subclass!

Supported Swift Versions:

Library Version Supported Swift Version
0.1.3 and above Swift 5
0.1.2 Swift 3

SDK Support

It supports iOS 8.0 to iOS 12.2 Live rendering in Interface builder will require Xcode 6.x

Usage

Creating your filter

By Code

Somewhere, for example in your viewDidLoad, alloc and init the filter UIControl:

let twitterTextCounter = VSTwitterTextCounter()

This initializes our Twitter Text Counter using default size and max characters count to 280.

Note that the size of the control is predefined and should not be changed. Use CONTROL_SIZE static property for reference.

Adding to your UIView:

view.addSubview(twitterTextCounter)

Then, after your text gets updated, most probably in:-

func textViewDidChange(_ textView: UITextView)

You will need to parse the text using Twitter's TwitterTextParser SDK, which should look like that:-

let weightedLength = TwitterTextParser.defaultParser().parseTweet(textView.text).weightedLength

You will need to update your text length by calling:-

twitterTextCounter.update(with: textView, textWeightedLength: weightedLength)

Note: textView will be needed in order for the control to update the highlighted state of any overflowing text.

Via Interface builder

Add a new UIView to your xib, and update its class to VSTwitterTextCounter. Enjoy ;)

Configuration

Counter

Property Effect Default value
Max Count Sets the max value for weightedLength DEFAULT_MAX_COUNT / 280
Weighted Length Current text weight 0

Author

Shady Elyaski, [email protected]

License

This Code is released under the MIT License by Dynamic Signal

PS. We are hiring, check out our hiring page.

http://dynamicsignal.com

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].