yannickl / reactions Goto Github PK
View Code? Open in Web Editor NEWFully customizable Facebook reactions like control
Home Page: http://cocoadocs.org/docsets/Reactions
License: MIT License
Fully customizable Facebook reactions like control
Home Page: http://cocoadocs.org/docsets/Reactions
License: MIT License
I was trying to use the framework through Carthage in my project which supports iOS 8.0 and got an error as the minimum deployment target version was set to 10.0
I've updated the project and it works fine now. You only need to lower the number for the Cocoa Framework target.
I'm trying to implement this into UITableviewCell so, it can work like Facebook. But unfortunately unable to get popup in cell. Whereas if I'm implementing it in UIViewController simply than it works fine.
Can anyone help-me out with this?
Great job, is there a way to disable the long press animation of the facebookReactionButton, I only want to enable the like and dislike, no the ReactionSummary when I pressed for a long time.
Great job with this, is there a way to load the ReactionButton already selected.
Is there a way to set the image edge insets for the reaction button? I'm trying to set an image for the reaction button with a 100 by 25 point frame. But, the image is not filling the button's entire frame, even though it has the same pixels when exported in Sketch as a PNG file.
Is there a way to change the reaction icons? In other words, how do I change "Like", "Love", "Haha", "Wow", or "Angry"?
We needs to improve the tests to check whether the localized strings are valid.
How do I know when the reaction changed on a button? Even if that's triggered from a selector?
My code:
private let button = ReactionButton()
button.reaction = Reaction.facebook.sad
But by default, it is still like
.
And there's one more problem. I want to set the time when ReactionSelector displays to 500ms, what should I do?
Help me, Please
For each and every ReactionButton there will be an "overlay" view and that overlay view is attached to UIApplication window whenever user started to react.
But there is no where you are removing the "overlay" view from window, so because of this if user reacting on 100 cells will lead to create 100 overlay views and it wont get removed from superview even after user came out from that controller.
Steps To Reproduce:
1)Run the example Project
2)Press "View inside Tableview cells"
3)Do reactions in cells
4)Come out from the screen
5)Run the view inspector from your xcode,
You will get similar to this,
I reacted four times, so four overlays + reaction selector got created.
Solution:
We can remove the "overlay" view whenever ReactionButton removed from it's superview
Below is the code to set my custom icon. But still, it is showing library provided icon icon.
var reactionButton: ReactionButton!{
didSet {
reactionButton.reactionSelector = ReactionSelector()
reactionButton.reactionSelector?.setReactions(self.createReactions())
}
func createReactions() -> [Reaction] {
var reactionArray = [Reaction]()
let like = Reaction(id: "1", title: "Like", color: .red, icon: UIImage(named: "myIcon.png")!)
reactionArray = [like]
return reactionArray
}
when i go to the rection view from tabbar it give me error (Fatal error: Unexpectedly found nil while unwrapping an Optional value)
and some warnings like ([framework] CUICatalog: Invalid asset name supplied:
[1771:665213] Could not load the "" image referenced from a nib in the bundle with identifier " ")
Type 'Reaction.facebook' has no member 'openhand'
I've added Reactions to a UIView and the animations do not change when I mouse hover or click, leading me to believe that it's receiving no input whatsoever. What could cause this?
var select = ReactionSelector()
select.reactions = Reaction.facebook.all
containerView.addSubview(select)
I have tried so many types to assign the reaction values in objective c , bridging the file and so on, can you please tell how to integrate into objective c finally we triggered only define the class for that uiview and getting outlet of that uiview (ReactionSummary, ReactionSelector, ReactionButton)
and we can not able to delegate the method of "ReactionFeedbackDelegate" ,,,
Please tell if you done this...!! and explain it..
Thank you! !!!!!
I am getting this error after updating library for swift 4.0.
Could you explain how or what you can do with the feedback delegate because currently, it's just sitting in the swift file empty and the description doesn't really explain anything?
Hey I was wondering if you would be able to add in a feature to this framework.
Introduce spectral emotions.
For the moment the ReactionSummary
icons are drawn with a white border. The white border is drawn inside the image so it crops it and thats not elegant. We should first draw a white circle and then the icon inside without border.
I have a Reactions Button that's added to a view controller's view. But, when the view has a UILongPressGestureRecognizer, also in the view, it seems to override the Reactions' selector methods where it shows the reactions. Is there a work around for this?
I want that title does not show on button after selection
I can't seem to be able to add the count of each reaction type in the reaction summary. For example, "1" in here:
https://cloud.githubusercontent.com/assets/798235/19440513/792e0b6c-9482-11e6-8410-c5522ca93fed.png
Type 'Reaction.facebook' has no member 'smilingface'
I found that below is code in your old version, and in the new version it is changed.
import UIKit
/// Default implementation of the facebook reactions.
extension Reaction {
/// Struct which defines the standard facebook reactions.
public struct facebook {
public static var count:Int = 0
/// The facebook's "like" reaction.
public static var like: Reaction {
return reactionWithId("1",name: "like",count:count)
}
/// The facebook's "love" reaction.
public static var handpressed: Reaction {
return reactionWithId("8",name: "handpressed",count:count)
}
/// The facebook's "haha" reaction.
public static var openhand: Reaction {
return reactionWithId("3",name: "openhand",count:count)
}
/// The facebook's "wow" reaction.
public static var okhand: Reaction {
return reactionWithId("4",name: "okhand",count:count)
}
/// The facebook's "sad" reaction.
public static var smilingface: Reaction {
return reactionWithId("2",name: "smiling-face",count:count)
}
/// The facebook's "sad" reaction.
public static var surprised: Reaction {
return reactionWithId("6",name: "surprised",count:count)
}
/// The facebook's "sad" reaction.
public static var grinningface: Reaction {
return reactionWithId("5",name: "grinning-face",count:count)
}
/// The facebook's "sad" reaction.
public static var crying: Reaction {
return reactionWithId("9",name: "crying",count:count)
}
/// The facebook's "angry" reaction.
public static var pouting: Reaction {
return reactionWithId("7",name: "pouting",count:count)
}
/// The facebook's "angry" reaction.
public static var usaflag: Reaction {
return reactionWithId("10",name: "usa-flag",count:count)
}
/// The list of standard facebook reactions in this order: `.like`, `.love`, `.haha`, `.wow`, `.sad`, `.angry`.
// public static let all: [Reaction] = [facebook.like, facebook.love, facebook.haha, facebook.wow,facebook.smilingface,facebook.surprised,facebook.angry,facebook.grinningface,facebook.sad,facebook.usaflag]
public static let all: [Reaction] = [facebook.like,facebook.smilingface,facebook.openhand,facebook.okhand,facebook.grinningface,facebook.surprised,facebook.pouting,facebook.handpressed,facebook.crying,facebook.usaflag]
// MARK: - Convenience Methods
private static func reactionWithId(_ id: String,name:String) -> Reaction {
var color: UIColor = .black
var alternativeIcon: UIImage? = nil
switch name {
case "like":
color = UIColor(red: 1/255.0, green:158/255.0, blue: 92/255.0, alpha: 1)
alternativeIcon = imageWithName("like-template").withRenderingMode(.alwaysTemplate)
case "love":
color = UIColor(red: 0.93, green: 0.23, blue: 0.33, alpha: 1)
case "angry":
color = UIColor(red: 0.96, green: 0.37, blue: 0.34, alpha: 1)
default:
color = UIColor(red: 0.99, green: 0.84, blue: 0.38, alpha: 1)
}
return Reaction(id: id, title: name.localized(from: "FacebookReactionLocalizable"), color: color, icon: imageWithName(name), alternativeIcon: alternativeIcon)
}
private static func reactionWithId(_ id: String,name:String,count:Int) -> Reaction {
var color: UIColor = .black
var alternativeIcon: UIImage? = nil
switch name {
case "like":
color = UIColor(red: 1/255.0, green:158/255.0, blue: 92/255.0, alpha: 1)
alternativeIcon = imageWithName("like-template").withRenderingMode(.alwaysTemplate)
case "love":
color = UIColor(red: 0.93, green: 0.23, blue: 0.33, alpha: 1)
case "angry":
color = UIColor(red: 0.96, green: 0.37, blue: 0.34, alpha: 1)
default:
color = UIColor(red: 0.99, green: 0.84, blue: 0.38, alpha: 1)
}
return Reaction(id: id, title: name.localized(from: "FacebookReactionLocalizable"), color: color, icon: imageWithName(name), alternativeIcon: alternativeIcon,count:count)
}
private static func imageWithName(_ name: String) -> UIImage {
return UIImage(named: name, in: .reactionsBundle(), compatibleWith: nil)!
}
}
}
But when I move to your old tag file version like 1.0.0 and 2.0.0. All have the same code in this file. It looks like you haven't maintained all the version. That's why you have same code in all the version.
Correct me if I'm wrong.
How to set unselected reaction once iboutlet did set?
i am using pod 'Reactions', '~> 1.1.1'
My first item selected reaction is a grey color. Just like its working on facebook reaction
@IBOutlet weak var reactionnButton: ReactionButton! {
didSet {
let select = ReactionSelector()
let reactionLike = Reaction(id: "id", title: "Like", color: .red, icon: #imageLiteral(resourceName: "like"))
let reactionAngry = Reaction(id: "id", title: "Angry", color: .red, icon: #imageLiteral(resourceName: "emoji_angry"))
let reactionEnvy = Reaction(id: "id", title: "Envy", color: .red, icon: #imageLiteral(resourceName: "emoji_envy"))
let reactionLove = Reaction(id: "id", title: "Love", color: .red, icon: #imageLiteral(resourceName: "emoji_love"))
let reactionSick = Reaction(id: "id", title: "Sick", color: .red, icon: #imageLiteral(resourceName: "emoji_sick"))
let reactionHappy = Reaction(id: "id", title: "Happy", color: .red, icon: #imageLiteral(resourceName: "emoji_happy"))
let reactionCrying = Reaction(id: "id", title: "Crying", color: .red, icon: #imageLiteral(resourceName: "emoji_crying"))
select.reactions = [
reactionLike,
reactionAngry,
reactionEnvy,
reactionLove,
reactionSick,
reactionHappy,
reactionCrying
]
//select.reactions = Reaction.facebook.all
//select.selectedReaction = Reaction(id: "id", title: "Angry", color: .red, icon: #imageLiteral(resourceName: "like-template"))
reactionnButton.reactionSelector = select
reactionnButton.config = ReactionButtonConfig() {
$0.iconMarging = 15
$0.spacing = 5
$0.font = UIFont(name: "ApexRounded-Book", size: 14)
$0.neutralTintColor = UIColor(red: 0.47, green: 0.47, blue: 0.47, alpha: 1)
$0.alignment = .centerLeft
}
reactionnButton.reactionSelector?.feedbackDelegate = self
// This one takes a value from ReactionSelector
reactionnButton.addTarget(self, action: #selector(reactionChanged), for: .valueChanged)
// And this one from ReactionButton
reactionnButton.addTarget(self, action: #selector(reactionChanged), for: .touchUpInside)
}
}
We have 'ReactionSelector' in a TableView cell. If the first-cell like button is nearby to the navigation bar (we are using one view as navigation bar), 'ReactionSelector' appears above the bar and dismiss won't work. So, the full app becomes unresponsive including the tableview. Please let me know is there anything we can do for this issue ? Can we show ReactionSelector on bottom ?
Possible solutions:
UIImageView. animationImages
propertyCALayer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.