All Projects → scaraux → Hashtags

scaraux / Hashtags

Licence: MIT license
#️⃣ A Swift library to display and manipulate Hashtags as a list

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Hashtags

hashtag.io
Hashtag.io is a PHP based social networking website, which supports exclusive multimedia content, sharing and private or group messaging service.
Stars: ✭ 64 (+68.42%)
Mutual labels:  hashtag
react-native-element-textinput
A react-native TextInput, TagsInput and AutoComplete component easy to customize for both iOS and Android.
Stars: ✭ 28 (-26.32%)
Mutual labels:  hashtag
Socially
Socially is a textView which is able to create separate clickable views according to your requirements.
Stars: ✭ 28 (-26.32%)
Mutual labels:  hashtag
Brutegram
Instagram multi-bruteforce Platfrom
Stars: ✭ 183 (+381.58%)
Mutual labels:  hashtag
instagram-hashtag-scraper
NodeJS application for scraping recent top posts from Instagram by hashtag without API access.
Stars: ✭ 17 (-55.26%)
Mutual labels:  hashtag
Mentions
An easy way to add mentions and hashtags
Stars: ✭ 24 (-36.84%)
Mutual labels:  hashtag
OrangeLabel
OrangeLabel is extensions of UILabel linkable, available line background and placeholder text
Stars: ✭ 19 (-50%)
Mutual labels:  hashtag
hashflags-function
⚡ A collection of Azure functions related to Twitter hashflags
Stars: ✭ 15 (-60.53%)
Mutual labels:  hashtag
mention-hashtag
Extract mentions (@mention) or hashtags (#hashtag) from any text
Stars: ✭ 16 (-57.89%)
Mutual labels:  hashtag
textmatcher
A simple text watcher that matches specific targets like mention or hashtag in a string by defining rules
Stars: ✭ 67 (+76.32%)
Mutual labels:  hashtag
wink-sentiment
Accurate and fast sentiment scoring of phrases with #hashtags, emoticons :) & emojis 🎉
Stars: ✭ 51 (+34.21%)
Mutual labels:  hashtag
Twitter-bot
Twitter bot which waits for #hashTag and sends weather update of city via tweets
Stars: ✭ 20 (-47.37%)
Mutual labels:  hashtag
instastory.js
This is a jQuery plugin to make it easy to get a feed from instagram. No need of access tokens and other stuff, Only thing needed is jQuery.
Stars: ✭ 36 (-5.26%)
Mutual labels:  hashtag

Hashtags

CIStatus Version License Platform Swift 4.2 support

Hashtags Logo

Hashtags is an iOS library for displaying, customizing and interacting with a list of #hashtags, written in Swift

Features

  • Simplistic and easy to use
  • Fully customizable
  • Dynamic height

📲 Example

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

📋 Requirements

Hashtags requires iOS 9.0+

📦 Installation

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

pod 'Hashtags'

😏 Usage

Basics

1) Create a Hashtag

let tag = HashTag(word: "hashtag")
let tag = HashTag(word: "hashtag", withHashSymbol: false)
let tag = HashTag(word: "hashtag", withHashSymbol: true, isRemovable: true)

The boolean isRemovable defines if the hashtag can be removed from the list, by displaying a button next to it. The boolean withHashSymbol allows to automatically display a '#' symbol before the word.

NOTE: By default, the hashtag will display the hash symbol and won't be removable.

2) Create the view

You can use the Hashtags view either directly from the code, or through your Interface Builder.

With code:
var hashtags = HashtagView(frame: ...)

hashtags.backgroundColor = UIColor.lightGray
hashtags.tagBackgroundColor = UIColor.blue
hashtags.cornerRadius = 5.0
hashtags.tagCornerRadius = 5.0
hashtags.tagPadding = 5.0
hashtags.horizontalTagSpacing = 7.0
hashtags.verticalTagSpacing = 5.0

self.view.addSubview(hashtags)
With Interface Builder:

Simply define a UIView and set its class to HashtagsView. You're all set.

Example Interface Builder

3) Add hashtags to the view

let hashtag = ...
hashtagsView.addTag(tag: tag)

You can add one, or multiples hashtags at the time. Same if you want to remove them.

func addTag(tag: HashTag)
func addTags(tags: [HashTag])
func removeTag(tag: HashTag)
func removeTags()

Dynamic height

You may want to expand the size of your HashtagView when the hashtags exceed the actual size of the view.

To do so, implement HashtagsViewDelegate :

UIViewController: HashtagsViewDelegate {

    func hashtagRemoved(hashtag: HashTag) {
        // Your code here
    }
    func viewShouldResizeTo(size: CGSize) {
        // Your code here
    }
}

Example:

One simple way to expand the height of your HashtagsView when needed is to set a height constraint on it (from the code or interface builder). Then you can modify the constant property of the constraint when the view needs to be expanded. Add an animation and you got it !

Example dynamic height

UIViewController: HashtagsViewDelegate {
    func viewShouldResizeTo(size: CGSize) {
        guard let constraint = self.heightConstraint else {
            return
        }
        constraint.constant = size.height
        UIView.animate(withDuration: 0.4) {
            self.view.layoutIfNeeded()
        }
    }
}

NOTE: If you are using interface builder, you might want to link your height constraint to your parent view with an @IBOutlet�. Check our example project for more details.

🎨 Customization

Appearance

You can change style attributes of the view and the design of the hashtags themselves.

Padding inside the whole view:
  • containerPaddingLeft

  • containerPaddingRight

  • containerPaddingTop

  • containerPaddingBottom

Padding inside each hashtag:
  • tagPaddingLeft

  • tagPaddingRight

  • tagPaddingTop

  • tagPaddingBottom

Spacing between hashtags:
  • horizontalTagSpacing

  • verticalTagSpacing

Hashtags appearance:
  • tagCornerRadius

  • tagBackgroundColor

  • tagTextColor

  • removeButtonSize

  • removeButtonSpacing

If you decided to define the view from Interface Builder, you have access to those values too.

Example Interface Builder

👱 Author

Oscar Gotting (@Scaraux)

😍 Credits

AlignedCollectionViewFlowLayout by Mischa Hildebrand

🚔 License

Hashtags is available under the MIT license. See the LICENSE file for more info.

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].