• Stars
    star
    289
  • Rank 143,419 (Top 3 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An emoji-liked rating view for iOS, implemented in Swift3.

TTGEmojiRate

An emoji-liked rating view for iOS, implemented in Swift3.

Android version: PeterSmileRate by SilicorniO. Great work ! :)

Build Status Version License Platform Swift3

Apps Using Total Download

Screenshot

Inspired by Rating Version A - Hoang Nguyen

Rating Version A - Hoang Nguyen

Blog
土土哥的技术Blog - Swift开源项目: TTGEmojiRate的实现

Features

  • More interactive with Emoji and drag gesture.
  • Highly customizable.
  • Can be used in Interface Builder.

IB example

What

TTGEmojiRate is an emoji-liked rating view for iOS which is implemented in Swift.
You can drop up and down on the Emoji face to change the rate, which is more interactive.
TTGEmojiRate is also highly customizable that many features of it can be configure, like the emoji line width and the mouth width.

Usage

Use TTGEmojiRate

  1. Create an instance of EmojiRateView and add it to the parent view.
let rateView = EmojiRateView.init(frame: CGRectMake(0, 0, 200, 200))
rateView.center = self.view.center
self.view.addSubview(rateView)
  1. Drop a view in the Interface builder and set the Custom Class to EmojiRateView

Run example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Swift3.
Xcode8.
iOS 8 and later.

Installation

CocoaPods

You can use CocoaPods to install TTGEmojiRate by adding it to your Podfile:

pod "TTGEmojiRate"

Carthage

You can use Carthage to install TTGEmojiRate by adding it to your Cartfile:

github "zekunyan/TTGEmojiRate"

Customization

Customization

rateValueChangeCallback

rateValueChangeCallback: ((newRateValue: Float) -> Void)? defines the callback closure when rateValue changes.

emojiRateView.rateValueChangeCallback = {(rateValue: Float) -> Void in
    NSLog("The new rate value is: \(rateValue)")
}

rateColorRange

rateColorRange: (from: UIColor, to: UIColor)
When rateValue changes from 0 to 5, the rateColor will change from the from: UIColor to to: UIColor.

emojiRateView.rateColorRange = (
    UIColor.redColor(), 
    UIColor.greenColor()
)

rateDragSensitivity

rateDragSensitivity: CGFloat defines the sensitivity when drag to change rateValue.

Author

zekunyan, [email protected]

License

TTGEmojiRate is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

TTGTagCollectionView

Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time. It is highly customizable that most features of the text tag can be configured. 标签流显示控件,同时支持文字或自定义View
Objective-C
1,822
star
2

AutolayoutExampleWithMasonry

Different Autolayout examples with Masonry. 用Masonry写的Autolayout案例,持续更新中。详细解答请看tutuge.me
Objective-C
707
star
3

TTGSnackbar

TTGSnackbar shows simple message and action button on the bottom or top of the screen with multi kinds of animation, which is written in Swift3 and inspired by Snackbar in Android. It also support showing custom view, icon image or multi action button.
Swift
634
star
4

TTGPuzzleVerify

By completing image puzzle game, TTGPuzzleVerify is a more user-friendly verification tool on iOS, which is highly customizable and easy to use. 体验更友好的拼图验证控件
Objective-C
353
star
5

TTGBingWallPaper

Mac menubar app. Automate download daily picture from Microsoft Bing website and set it as your wallpaper. Written in Swift3.
Swift
183
star
6

UITextViewDIYEmojiExample

Example of insert custom emoji image in to UITextView. And get the represent string back after editing.
Objective-C
149
star
7

HttpProxyExample

HttpProxyExample-Example of using NSProxy
Objective-C
47
star
8

iOS-Tasks

ITEC学习iOS同学的Github聚集地=。=
Objective-C
43
star
9

AutoReleasePoolTestExample

An example to figure out the benefit to use @autoreleasepool in ARC iOS program.
Objective-C
30
star
10

TTGDeallocTaskHelper

NSObject Category to add callback tasks when object dealloc.
Shell
29
star
11

LinkTextView

An Android TextView to add highly customizable and colorful link.
Java
29
star
12

ThriftDemo_PHP_CPP

Demo for Thrift RPC framework. PHP client call CPP server.
PHP
29
star
13

QuartzCodeExample-StarAimation

QuartzCode star-style animation demo.
Objective-C
27
star
14

TTGNotificationGuard

Auto remove the observer from NSNotificationCenter after the oberser dealloc
Shell
13
star
15

TTGRemakeMethodSignatureForSelector

Remake methodSignatureForSelector. Just for research. :)
Objective-C
10
star
16

OutParameterPointerCrashOnXcode8

Example code for out parameter pointer EXC_BAD_ACCESS crash on Xcode 8
C++
4
star
17

TTGKVOGuard

Auto remove KVO observer from object after it dealloc.
Objective-C
2
star
18

zekunyan.github.io

tutuge blog
HTML
1
star