Swiftpack.co - caiobzen/Reactions as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by caiobzen.
caiobzen/Reactions 1.1.2
A simple widget for picking reactions
⭐️ 0
🕓 4 years ago
iOS
.package(url: "https://github.com/caiobzen/Reactions.git", from: "1.1.2")

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

GitHub

link
Stars: 0
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics