To run the example project, clone the repo, and run pod install from the Example directory first.
JOEmojiableBtn is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "JOEmojiableBtn"This instance create a JOEmojiableBtn using default JOEmojiableBtnConfig.
Images from Trump reactionpacks style.
let optionsDataset = [
JOEmojiableOption(image: "img_1", name: "img1"),
JOEmojiableOption(image: "img_2", name: "img2"),
JOEmojiableOption(image: "img_3", name: "img3"),
JOEmojiableOption(image: "img_4", name: "img4"),
JOEmojiableOption(image: "img_5", name: "img5"),
JOEmojiableOption(image: "img_6", name: "img6")
]
let buttonSample1 = JOEmojiableBtn(frame: CGRect(origin: CGPoint(x: 40, y: 200), size: CGSize(width: 100, height: 50)))
buttonSample1.delegate = self
buttonSample1.backgroundColor = .green
buttonSample1.dataset = optionsDataset
view.addSubview(buttonSample1)With this instance you can fully custom your component. Following the JOEmojiableConfig variables.
You can custom your selector with the following variables, used in the
let config = JOEmojiableConfig(spacing: 2,
size: 30,
minSize: 34,
maxSize: 45,
spaceBetweenComponents: 30)
let buttonSample2 = JOEmojiableBtn(frame: CGRect(origin: CGPoint(x: 40, y: 300), size: CGSize(width: 100, height: 50)), config: config)
buttonSample2.delegate = self
buttonSample2.backgroundColor = .green
buttonSample2.dataset = optionsDataset
view.addSubview(buttonSample2)Jorge Ovalle, jroz9105@gmail.com
JOEmojiableBtn is available under the MIT license. See the LICENSE file for more info.