Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reaction selector background fill color #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/ReactionSelector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ public final class ReactionSelector: UIReactionControl {

backgroundLayer.add(pathAnimation, forKey: "morhingPath")

if config.backgroundFillColor != nil {
backgroundLayer.fillColor = config.backgroundFillColor
}

for index in 0 ..< reactionIconLayers.count {
updateReactionAtIndex(index, highlighted: stateHighlightedReactionIndex == index)
}
Expand Down
3 changes: 3 additions & 0 deletions Sources/ReactionSelectorConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public final class ReactionSelectorConfig: Configurable {

/// Boolean value to know whether the reactions needs to be sticked when they are selected.
public var stickyReaction: Bool = false

/// The fill color of the reaction selector.
public var backgroundFillColor: CGColor? = nil

// MARK: - Initializing a Reaction Selector

Expand Down