Skip to content

caiobzen/Reactions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Reactions

A simple widget to simulate a component used by most of the social network apps to allow users to react to something. You can find the sample app Here

Maintainability


โš™๏ธ The Widget

This widget demonstrates how easy it is to build something to allow users to react to posts, pictures, etc. It is build to use SF Symbols along with Colors.

To create your custom widget, all you need to do is to provide an array of Reaction as the input:

    let reactions = [
        Reaction(name: "hand.thumbsup.fill", color: Color(red: 0, green: 0.8, blue: 1)),
        Reaction(name: "smiley.fill", color: .yellow),
        Reaction(name: "flame.fill", color: .red),
        Reaction(name: "star.fill", color: .yellow),
        Reaction(name: "heart.fill", color: Color(red: 1, green: 0.4, blue: 0.3)),
    ]
    
    Reactions(reactions) { reaction in 
        print("this was the selected reaction: \(reaction)")
    }

๐Ÿš‚ Motivation

I just wanted to play around with SwiftUI, but this time, I was specially looking on how to interact with gestures like DragGesture.

๐Ÿ’ป Requirements

  • iOS 13+
  • XCode 11

๐Ÿค“ How to run

Since this project has zero dependencies on external frameworks, all you need is:

  1. Add https://github.com/caiobzen/Reactions.git to your XCode Project as a Package Dependency
  2. Done! :D

About

A simple widget for picking reactions

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages