{"id":20287029,"url":"https://github.com/magi82/mgstarratingview","last_synced_at":"2025-04-11T09:38:15.636Z","repository":{"id":54654024,"uuid":"92493345","full_name":"magi82/MGStarRatingView","owner":"magi82","description":"MGStarRatingView is a view for rating.","archived":false,"fork":false,"pushed_at":"2023-03-01T19:02:02.000Z","size":1240,"stargazers_count":78,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T06:40:35.449Z","etag":null,"topics":["rating","star","swift"],"latest_commit_sha":null,"homepage":"https://magi82.github.io","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magi82.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-05-26T09:11:57.000Z","updated_at":"2024-01-14T22:04:52.000Z","dependencies_parsed_at":"2022-08-13T23:00:30.298Z","dependency_job_id":"8f674b3d-7f3b-442d-ad26-a4d8f9a14554","html_url":"https://github.com/magi82/MGStarRatingView","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":0.02857142857142858,"last_synced_commit":"1acfc6e02b907a6217b73cb0436d0c31b020d629"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magi82%2FMGStarRatingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magi82%2FMGStarRatingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magi82%2FMGStarRatingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magi82%2FMGStarRatingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magi82","download_url":"https://codeload.github.com/magi82/MGStarRatingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248368767,"owners_count":21092452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rating","star","swift"],"created_at":"2024-11-14T14:37:54.433Z","updated_at":"2025-04-11T09:38:15.617Z","avatar_url":"https://github.com/magi82.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MGStarRatingView\n\n![Swift](https://img.shields.io/badge/Swift-4.2-orange.svg)\n[![Platform](https://img.shields.io/cocoapods/p/MGStarRatingView.svg?style=flat)](http://cocoapods.org/pods/MGStarRatingView)\n[![Version](https://img.shields.io/cocoapods/v/MGStarRatingView.svg?style=flat)](http://cocoapods.org/pods/MGStarRatingView)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CI Status](https://travis-ci.org/magi82/MGStarRatingView.svg?branch=master)](https://travis-ci.org/magi82/MGStarRatingView)\n[![License](https://img.shields.io/cocoapods/l/MGStarRatingView.svg?style=flat)](http://cocoapods.org/pods/MGStarRatingView)\n\nMGStarRatingView is a view for rating.\u003cbr\u003e\nSimple and easy to implement. :sunny:\n\nIt supports programmatically and xib.\u003cbr\u003e\nNo image is required. Just choose color.\n\n## Sample\n\n\u003cimg src=\"https://github.com/magi82/MGStarRatingView/blob/master/Resources/sample.gif?raw=true\" width=\"240\"\u003e\n\n\n## Usage (Programmatically)\n- Creating and Implementing a View\n\n```swift\nlet starView = StarRatingView()\nlet attribute = StarRatingAttribute(type: .rate,\n      point: 30,\n      spacing: 10,\n      emptyColor: .red,\n      fillColor: .blue,\n      emptyImage: nil,\n      fillImage: nil)\nstarView.configure(attribute, current: 0, max: 5)\nstarView.delegate = self\nself.view.addSubview(starView)\n```\n\n- Delegate implementation\n\n```swift\nfunc StarRatingValueChanged(view: StarRatingView, value: CGFloat) {\n  // use value\n}\n```\n\n## Usage (xib)\n\nFirst, add `UIView`.\u003cbr\u003e\nRegister Custom Class as `StarRatingView` and register Module as `MGStarRatingView`.\n\n*Please be careful.*\u003cbr\u003e\nIf you type the spelling of `Type String` wrongly, it will be applied as the default type.\u003cbr\u003e\nThe default type is `rate`.\n\n\u003cimg src=\"https://github.com/magi82/MGStarRatingView/blob/master/Resources/xib_01.png?raw=true\" width=\"200\"\u003e   \u003cimg src=\"https://github.com/magi82/MGStarRatingView/blob/master/Resources/xib_02.png?raw=true\" width=\"200\"\u003e   \u003cimg src=\"https://github.com/magi82/MGStarRatingView/blob/master/Resources/xib_03.png?raw=true\" width=\"200\"\u003e\n\n## API Reference\n\n```swift\n// A delegate for receiving values.\npublic weak var delegate: StarRatingDelegate?\n\n// A type that represents a value.\n// There are three kinds. (rate, half, fill)\npublic var type: StarRatingType\n\n// The current value.\npublic var current: CGFloat\n\n// The maximum number of stars.\npublic var max: Int\n\n// The spacing between stars.\npublic var spacing: CGFloat\n\n// The size of the star.\n// The horizontal and vertical sizes are the same.\npublic var point: CGFloat\n\n// The color value of the empty star.\npublic var emptyColor: UIColor\n\n// The color value of the full star.\npublic var fillColor: UIColor\n\n// The image object of the empty star.\nvar emptyImage: UIImage?\n\n// The image object of the full star.\nvar fillImage: UIImage?\n```\n\n## Aid\n\n- [taewan0530](https://github.com/taewan0530)\n\n## Requirements\n\n- Swift 4.0+\n- iOS 8.0+\n\n## Installation\n\n- **For iOS 8+ projects** with [CocoaPods](https://cocoapods.org):\n\n```ruby\npod 'MGStarRatingView', '~\u003e 1.0.0'\n```\n\n- **For iOS 8+ projects** with [Carthage](https://github.com/Carthage/Carthage):\n\n```ruby\ngithub \"magi82/MGStarRatingView\" ~\u003e 1.0.0\n```\n\n## Author\n\nmagi82, bkhwang82@gmail.com\n\n## License\n\n**MGStarRatingView** is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagi82%2Fmgstarratingview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagi82%2Fmgstarratingview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagi82%2Fmgstarratingview/lists"}