Whole, half or floating point ratings control written in Swift

Related tags

UI FloatRatingView
Overview

FloatRatingView

A simple rating view for iOS written in Swift! Supports whole, half or floating point values. I couldn't find anything that easily set floating point ratings, so I made this control based on a Ray Wenderlich tutorial. Some of the best iOS tutorials that I've come across.

Check out the post on medium for a full write-up.
https://medium.com/@glenyi/float-rating-view-in-swift-e740b6b9404d

FloatRatingView Demo

Usage

Initialize from a nib/xib or programmatically. Set the empty and full image, then you're pretty much good to go! Check out the demo app to see how it can be used.

Release v4.0 is updated for Swift 5.0 while v1.0.3 is on Swift 2.3.

Usage in an Objective-C Project

  1. Import the Swift File
  2. Ensure the build settings in your project are set to enable Swift usage (see here and here)
  3. import "YOUR_PROJECT_NAME-Swift.h" in your Objective-C files where you want to use FloatRatingView

Pod Installation

For Swift 2.3 projects just add the following to your podfile:

pod 'FloatRatingView', '~> 1.0.3'

For Swift 5.0 projects:

pod 'FloatRatingView', '~> 4'

How it works

The concept is a little different from the source tutorial. The float rating view lays the full image views on top of the empty image views then sets the CALayer mask property to partially hide full images. The full image view mask frame is calculated whenever needed for half or floating point values.

Comments
  • Submit Podspec to trunk

    Submit Podspec to trunk

    It'd be easier to people find out about (and use) FloatRatingView if the Podspec was pushed to CocoaPods Spec repo.

    More info: https://guides.cocoapods.org/making/getting-setup-with-trunk.html

    opened by marcelofabri 3
  • ... not key value coding-compliant for the key ...

    ... not key value coding-compliant for the key ...

    I am getting a bunch of warnings of the following type:

    Ignoring user defined runtime attribute for key path [variable name] of instance of UIView. Hit an exception when attempting to set its value ...setValue:forUndefinedKey: this class is not key value coding compliant for the key [variable name]

    I see this for editable, emptyImage, floatRatings, fullImage, halfRatings and so on.

    I have inserted a view controller to storyboard which has a view with custom class FloatRatingView.

    I believe that I started to see it after changing the deployment target to iOS7. I have already searched the web, but I did not find a fast solution. I am happy to help if I understand the issue.

    opened by sebbu 3
  • Added new Optional property `ibDelegate` of type `AnyObject` which se…

    Added new Optional property `ibDelegate` of type `AnyObject` which se…

    …rves as a workaround and addresses the fact that IB cannot reference protocol outlets in Swift files (still the case in Xcode 8.0). This property can be used to set the delegate of the view in a storyboard. See http://bit.ly/2eLvVoq for details.

    Made the delegate property an @IBOutlet. The example app sets the rating view delegate from the storyboard. Opened the storyboard of the example project in Xcode 8.0 and fixed resulting misplacements.

    opened by raginmari 2
  • Rendering issue

    Rendering issue

    I just got this error whenever i am enter in storyboard...after some time it disappears...but it gives slow performance error...how to get rid of this

        error: IB Designables: Failed to render instance of FloatRatingView: Rendering the view took longer than 200 ms. Your drawing code may suffer from slow performance.
    
    opened by BhavinBhadani 2
  • Version 4.0 released

    Version 4.0 released

    Version 4.0 🆕

    I've updated current project and forked to a new repository, because that repository is not maintained anymore 🙁 (great work, glenyi, thank you for creating that project).

    New version is located here: https://github.com/Sorix/RatingControl.

    Changelog

    UIControl

    FloatingRatingView renamed to RatingControl. Also now it is a subclass of UIControl instead of UIView, because that RatingView is closer to control type than view type.

    Now control supports default UIControl methods, like isEnabled, addAction, @IBAction outlets and so on. Please use it instead of delegate methods, because it's a more native way.

    Storyboard

    You can add storyboard's @IBAction outlets in Interface Builder without writing a code for delegate methods. Less code for you.

    Also I've added support for intrinsicContentSize, so view know about own's desired size (like labels or buttons) and you will need to define less constraints and it will be easier to configure it in Interface Builder.

    Haptic

    Support of haptic feedback was added, try that magic on devices with appropriate hardware.

    Compatibility

    RatingControl (4.0) is almost compatible with previous version of FloatingRatingView.

    1. You need to find and replace import statements because of library renaming:
    import FloatingRatingView // search that
    import RatingControl // replace to that
    
    1. Minimum required iOS version now is 10.0.

    Because of that 2 breaking changes, version was changed to 4.0.

    RatingControl is now a subclass of UIControl that's why a lot of old methods was deprecated, you still can use it. XCode will warn you about outdated methods with help messages with fix proposals.

    Other changes

    • Support Swift 4.2
    • Objective-C support
    • Update Example application
    • Tidy folder structure
    opened by Sorix 1
  • Adds Carthage support

    Adds Carthage support

    As mentioned in #15 I've added Carthage support. The process is fairly straightforward, you really only need a project with a configured scheme. I've tested and verified that it works by integrating it into a test project using github "VFUC/FloatRatingView" "carthage" in the Cartfile

    If you're interested, I'd be happy to add the Carthage compatible flag to the README as well, let me know if and where you'd prefer it. 🙂

    opened by VFUC 1
  • Not support in Swift 3.0

    Not support in Swift 3.0

    Hello ,

    I have tried to implement in my application which is in Swift 3.0 but unfortunately this is not work in my app. It gives me error like this "FloatRatingView is not a member class of FloatRatingView"

    Thanks.

    opened by Birju-Bhatt 1
  • Added tint to rating images, vertical / bottom-up rating orientation …

    Added tint to rating images, vertical / bottom-up rating orientation …

    …and updated demo layout

    Rating images are tinted based on parent FloatRatingView tintColor, added vertical orientation option for rating and updated constraints in storyboard.

    Additional changes to demo to reflect above changes with switch in view controller to enable and disable vertical orientation.

    opened by reedand 1
  • FloatRatingView not wroking properly when we add it on tableview cell

    FloatRatingView not wroking properly when we add it on tableview cell

    Hi, when i add it on Tableview cell then it not working as expected . i mean when we try to tap on any star it doesn't change the star values only working on floating .

    opened by Sahilberi 1
  • ISSUE With swift 1.2

    ISSUE With swift 1.2

    I have some issues with the interface builder. So XCODE tells me : /Main.storyboard: warning: IB Designables: Ignoring user defined runtime attribute for key path "rating" on instance of "UIView". Hit an exception when attempting to set its value: [<UIView 0x7fc0b9cab4d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key rating.

    opened by BilalReffas 1
  • Add tvOS to the podspec?

    Add tvOS to the podspec?

    I'm trying to fix up PopcornTimeTV/PopcornTimeTV, and apparently they've been using this pod in the tvOS target in the past. Not sure how since it appears your podpsec never declared it supported tvOS. It looks like they just created their own spec and manually added tvOS to the spec.

    This leads me to believe it actually works on tvOS. Could you add tvOS to the list of supported platforms, like the spec file linked above does? Worst case, it doesn't work and you can remove it. Best case, it does, and I'll let you know!

    opened by NSExceptional 0
  • No suitable image found

    No suitable image found

    Hi everybody.

    I have an error when I tried to start my app in an Iphone 7 plus with IOS 13.3.1, but in an others Iphone with a IOS oldest it is working fine, it is the error that I have obtain:

    dyld: Library not loaded: @rpath/FloatRatingView.framework/FloatRatingView Referenced from: /private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Kafuu Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView: code signature invalid for '/private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView'

    /private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView: code signature invalid for '/private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView'
    
    /private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView: stat() failed with errno=1
    /private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView: code signature invalid for '/private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView'
    
    /private/var/containers/Bundle/Application/C1FE3C2D-55F9-4A68-B182-26C43EDA4B98/Kafuu.app/Frameworks/FloatRatingView.framework/FloatRatingView: stat() failed with errno=1
    

    (lldb)

    Regards

    opened by kzp01 1
  • No shared framework scheme for Carthage

    No shared framework scheme for Carthage

    When trying to do a carthage update, receiving the following error:

    Dependency "FloatRatingView" has no shared framework schemes for any of the platforms: iOS

    opened by droobah 0
Releases(4.0)
SpriteKit Floating Bubble Picker (inspired by Apple Music) 🧲

Magnetic Magnetic is a customizable bubble picker like the Apple Music genre selection. Demo Video $ pod try Magnetic Features Adding/Removing Nodes

Lasha Efremidze 1.4k Jan 6, 2023
A custom reusable circular / progress slider control for iOS application.

HGCircularSlider Example To run the example project, clone the repo, and run pod install from the Example directory first. You also may like HGPlaceho

Hamza Ghazouani 2.4k Jan 6, 2023
iOS 11 Control Center Slider

SectionedSlider Control Center Slider Requirements Installation Usage License Requirements iOS 8.0+ Swift 3.0+ Xcode 8.0+ Installation CocoaPods Cocoa

Leonardo Cardoso 361 Dec 3, 2022
UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

Mohsan Khan 29 Sep 9, 2022
Fully customizable Facebook reactions like control

Reactions is a fully customizable control to give people more ways to share their reaction in a quick and easy way. Requirements • Usage • Installatio

Yannick Loriot 585 Dec 28, 2022
A page control similar to that used in Instagram

ISPageControl ISPageControl has a page control similar to that used in the Instagram Contents Requirements Installation Usage Communication Credits Li

Interactive 291 Dec 5, 2022
A message bar for iOS written in Swift.

Dodo, a message bar for iOS / Swift This is a UI widget for showing text messages in iOS apps. It is useful for showing short messages to the user, so

Evgenii Neumerzhitckii 874 Dec 13, 2022
Cool Animated music indicator view written in Swift

Cool Animated music indicator view written in Swift. ESTMusicIndicator is an implementation of NAKPlaybackIndicatorView in Swift for iOS 8. 本人著作的书籍《La

Aufree 465 Nov 28, 2022
An easy to use FAQ view for iOS written in Swift

FAQView An easy to use FAQ view for iOS written in Swift. This view is a subclass of UIView. Setup with CocoaPods If you are using CocoaPods add this

Mukesh Thawani 467 Dec 5, 2022
A UITextView subclass that adds support for multiline placeholder written in Swift.

KMPlaceholderTextView A UITextView subclass that adds support for multiline placeholder written in Swift. Usage You can set the value of the placehold

Zhouqi Mo 794 Jan 7, 2023
Material design components for iOS written in Swift

MaterialKit NOTE: This project is unmaintained. Material design components (inspired by Google Material Design) for iOS written in Swift Please feel f

Le Van Nghia 2.5k Jan 5, 2023
Highly customizable Action Sheet Controller with Assets Preview written in Swift

PPAssetsActionController Play with me ▶️ ?? If you want to play with me, just tap here and enjoy! ?? ?? Show me ?? Try me ?? The easiest way to try me

Pavel Pantus 72 Feb 4, 2022
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift

SKPhotoBrowser Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift features Display one or more images by providi

keishi suzuki 2.4k Jan 6, 2023
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction ?? Awesome search view, written in Swift 5.0, appears search view like Pinteres

Kyle Yi 1.2k Dec 17, 2022
A Powerful , Extensible CSS Parser written in pure Swift.

A Powerful , Extensible CSS Parser written in pure Swift. Basic Usage From CSS: #View { "width" : 118; "height" : 120.5; "color1" : "#888888"; "co

null 273 Sep 9, 2022
An easy to use FAQ view for iOS written in Swift

FAQView An easy to use FAQ view for iOS written in Swift. This view is a subclass of UIView. Setup with CocoaPods If you are using CocoaPods add this

Mukesh Thawani 466 Nov 9, 2021
MUDownloadButton - a Progressive Download button written in pure swift and inspired by AppStore download button

MUDownloadButton is a Progressive Download button written in pure swift and inspired by AppStore download button . feel free to contribute and pull requests

Mohammad ShahibZadeh 2 Feb 20, 2022
TSnackBarView is a simple and flexible UI component fully written in Swift

TSnackBarView is a simple and flexible UI component fully written in Swift. TSnackBarView helps you to show snackbar easily with 3 styles: normal, successful and error

Nguyen Duc Thinh 3 Aug 22, 2022
TDetailBoxView is a simple and flexible UI component fully written in Swift

TDetailBoxView is a simple and flexible UI component fully written in Swift. TDetailBoxView is developed to help users quickly display the detail screen without having to develop from scratch.

Nguyen Duc Thinh 2 Aug 18, 2022