Since Facebook introduced reactions in 2016, it became a standard in several applications as a way for users to interact with content. ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.

Overview


Since Facebook introduced reactions in 2016, it became a standard in several applications as a way for users to interact with content. ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.

Features

  • Support of Dark Mode
  • Customizable layout using ReactionButtonDelegateLayout
  • Extensible DataSource for the control
  • Layout support for scrolling interfaces (UICollectionView/UITableView)
  • Codable initializer for usage on storyboards
  • Events

Requirements

  • iOS 13.0+
  • Swift 5.0+

Installation

Usage

1. Basic Instance

There are multiple ways to instantiate a ReactionButton, using a frame, storyboards, or an empty convenience initializer.

Example Code

let buttonSample = ReactionButton(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
buttonSample.dataSource = self
view.addSubview(buttonSample)

Basic usage

Images from Trump reactionpacks style.

2. Delegate

The ReactionButton has a delegate to communicate events of option selection, option focus, and cancel of actions. To use it, set the ReactionButtonDelegate conform as a delegate.

let buttonSample = ReactionButton(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
buttonSample.delegate = self
view.addSubview(buttonSample)

Delegate example

Images from Trump reactionpacks style.

3. Custom layout instance

ReactionButton allows customization of the layout with the help of ReactionButtonDelegateLayout. To use it, please conform to that protocol and set it as delegate (Same pattern as UICollectionView).

func ReactionSelectorConfiguration(_ selector: ReactionButton) -> ReactionButton.Config {
  ReactionButton.Config(spacing: 2,
                        size: 30,
                        minSize: 34,
                        maxSize: 45,
                        spaceBetweenComponents: 30)
}

You can custom your selector with the following variables, used in the

New

sizes

Author

Jorge Ovalle, [email protected]

Comments
  • selectedOption never get called

    selectedOption never get called

    Hi, I am trying your example however, I see that the selectedOption here never gets called so I don't get chance to check if user select something. Overtime, its showing "User cancelled".

    opened by satyamub 15
  • Inconsistent with familiar user experience

    Inconsistent with familiar user experience

    Of course this is a familiar user experience on Facebook: While the difference is small - it is important in this control user has to:

    • click once to activate view
    • click a second time to pick emoji While on FB user (long presses) once and immediately the toolbar is activated and shown I believe as an alternative implementation a long press event is more familiar.
    wontfix 
    opened by emouawad 2
  • iOS 7

    iOS 7

    Can you please change JOTextField.podspec

    s.platform = :ios, '7.0'

    It seems to work perfectly on iOS 7 but I can't use it via cocoapods until that line is changed.

    opened by pjebs 1
  • Add features for V4.0.0

    Add features for V4.0.0

    This PR adds:

    • Support to Swift 5
    • Increase target to iOS 13
    • Add support to Tableview and CollectionView usage
    • Improve interface
    • New DataSource and layout protocols
    • Update CocoaPod version
    • Support for DarkMode and multiple traits
    opened by lojals 0
  • Can we select emojis with out moving finger?

    Can we select emojis with out moving finger?

    We want to hold the emoji view on the screen and then select without dragging a finger. Like Facebook and LinkedIn do.

    Your support would be appreciated.

    Thanks!!

    opened by vish0289 2
  • Reactions does not show up in presented view controller

    Reactions does not show up in presented view controller

    Here is the reproducible example.

    https://user-images.githubusercontent.com/2767152/104798871-191a8980-57ec-11eb-87d6-839cba92fb41.mov

    ReactionButton.zip

    opened by mzeeshanid 3
Releases(4.0.0)
  • 4.0.0(Nov 1, 2020)

    • Support to Swift 5
    • Increase target to iOS 13
    • Add support to Tableview and CollectionView usage
    • Improve interface
    • New DataSource and layout protocols
    • Update CocoaPod version
    • Support for DarkMode and multiple traits
    • Add support for Swift Package Manager
    Source code(tar.gz)
    Source code(zip)
Owner
Jorge Ovalle
∆ Sr. iOS Engineer @ Uber  ∆ | he/him | My commits are my own | Oppa
Jorge Ovalle
Added functionality that system buttons are not easy to implement

LLCustomButton Added functionality that system buttons are not easy to implement What are the functions ? Sets the position and spacing of text and im

coder 18 Jul 28, 2022
Added functionality that system buttons are not easy to implement

LLCustomButton Added functionality that system buttons are not easy to implement What are the functions ? Sets the position and spacing of text and im

coder 18 Jul 28, 2022
Flat design pressable button for iOS developers.

HTPressableButton HTPressableButton is designed for iOS developers to be able to spend time developing ideas, not building basic buttons. These stylis

Famolus 859 Dec 12, 2022
Interactive and fully animated Material Design button for iOS developers.

WYMaterialButton Inspired by Google Material Design, written purely in Swift 3. WYMaterialButton implemented Material Design on iOS and add more dynam

Yu Wang 76 Oct 7, 2022
A SwiftUI button that expands to reveal more content.

CUIExpandableButton A SwiftUI button that expands to reveal more content. CUIExpandableButton is part of the Crystal UI framework (under developement)

Robert Cole 6 Dec 10, 2022
Animated Social share buttons control for iOS written in Swift

SwiftShareBubbles Animated Social share buttons control for iOS written in Swift. This library is inspired AAShareBubbles. I tried AAShareBubbles with

Takeshi Fujiki 175 Jun 11, 2022
A high-performance button control with rounded corners for iOS.

TORoundedButton TORoundedButton is an open source UI control of a standard user button. Its design consists of displaying text on top of a solid recta

Tim Oliver 480 Dec 26, 2022
IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.

Introduction Have you ever seen UI like instagram story, haven't you? Actually, features like instagram story have been implemented in many applicatio

mutation 34 Nov 8, 2022
An easy way to create beautiful social authentication buttons

EasySocialButton An easy way to create beautiful social authentication buttons Screenshots Installation Cocoa Pods pod 'EasySocialButton' Manual Drag

Antonio Zaitoun 162 Dec 11, 2022
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.

A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code. Preview You'll be

Lorenzo Greco 2.3k Dec 31, 2022
An open-source library to use with SwiftUI, It allows you to create Floating menu action button.

Floating Menu Action Button Example Overview This is an open-source library to use with SwiftUI. It allows you to create Floating menu action button. Ins

ugo 3 Aug 19, 2022
A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code.

JSButton Demo $ pod try JSButton ...or clone this repo and build and run/test the JSButton project in Xcode to see JSButton in action. If you don't ha

Jogendra 12 May 9, 2022
Customizable and easy to use expandable button in Swift.

ExpandableButton Requirements iOS 9.0+ Installation CocoaPods: Add the following line to your Podfile: pod 'ExpandableButton' #for swift less than 4.

Dmytro Mishchenko 98 Dec 5, 2022
ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.

Since Facebook introduced reactions in 2016, it became a standard in several applications as a way for users to interact with content. ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.

Jorge Ovalle 305 Oct 11, 2022
Fully customizable Facebook reactions like control

Reactions is a fully customizable control to give people more ways to share their reaction in a quick and easy way. Requirements • Usage • Installatio

Yannick Loriot 585 Dec 28, 2022
Several synchronization primitives and task synchronization mechanisms introduced to aid in modern swift concurrency.

AsyncObjects Several synchronization primitives and task synchronization mechanisms introduced to aid in modern swift concurrency. Overview While Swif

SwiftyLab 20 Jan 3, 2023
Allows users to pull in new song releases from their favorite artists and provides users with important metrics like their top tracks, top artists, and recently played tracks, queryable by time range.

Spotify Radar Spotify Radar is an iOS application that allows users to pull in new song releases from their favorite artists and provides users with i

Kevin Li 630 Dec 13, 2022
InstagramLogin allows iOS developers to authenticate users by their Instagram accounts.

InstagramLogin handles all the Instagram authentication process by showing a custom UIViewController with the login page and returning an access token that can be used to request data from Instagram.

Ander Goig 67 Aug 20, 2022
UI framework that allows developers to integrate an amazing selection interface into their applications

UI framework that allows developers to integrate an amazing selection interface into their applications! Each bubble has a set of parameters, which could be configured individually.

AJIJIi 5 Jul 12, 2022
Virgil Core SDK allows developers to get up and running with Virgil Cards Service API quickly and add end-to-end security to their new or existing digital solutions to become HIPAA and GDPR compliant and more.

Virgil Core SDK Objective-C/Swift Introduction | SDK Features | Installation | Configure SDK | Usage Examples | Docs | Support Introduction Virgil Sec

Virgil Security, Inc. 27 Jul 26, 2022