{"id":15038971,"url":"https://github.com/luispadron/lpintegratedrating","last_synced_at":"2025-04-10T00:02:31.068Z","repository":{"id":56918932,"uuid":"95616426","full_name":"luispadron/LPIntegratedRating","owner":"luispadron","description":"Integrated rating view for iOS","archived":false,"fork":false,"pushed_at":"2017-07-06T16:50:26.000Z","size":599,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T01:53:51.984Z","etag":null,"topics":["ios","library","rating","swift-4","ui-components","uiview","view"],"latest_commit_sha":null,"homepage":null,"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/luispadron.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-28T01:36:18.000Z","updated_at":"2019-11-20T02:46:42.000Z","dependencies_parsed_at":"2022-08-21T04:50:31.588Z","dependency_job_id":null,"html_url":"https://github.com/luispadron/LPIntegratedRating","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispadron%2FLPIntegratedRating","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispadron%2FLPIntegratedRating/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispadron%2FLPIntegratedRating/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luispadron%2FLPIntegratedRating/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luispadron","download_url":"https://codeload.github.com/luispadron/LPIntegratedRating/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233837043,"owners_count":18737906,"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":["ios","library","rating","swift-4","ui-components","uiview","view"],"created_at":"2024-09-24T20:41:01.172Z","updated_at":"2025-01-14T02:58:56.149Z","avatar_url":"https://github.com/luispadron.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"## LPIntegratedRating\n\n\n##### Warning: According to [this](https://www.macrumors.com/2017/06/09/ios-11-in-app-ratings/) and some other sources, when iOS 11 and the new app store releases, no custom rating screens will be allowed. Use this library at your own risk since you may be rejected. \n\n\u003ch3 align=\"center\"\u003eAn integrated rating view for iOS built with Swift 4\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/luispadron/LPIntegratedRating/master/.github/Demo.png\" width=\"500\"/\u003e  \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/luispadron/LPIntegratedRating/master/.github/ViewFlow.png\" width=\"500\"/\u003e  \n\u003c/p\u003e\n\n## Features\n\n- Stops users feeling annoyed from pop ups asking for ratings.\n- Customizable for your app needs.\n- Easy to use with `UITableView`'s and `UICollectionViews`'s.\n\n## Installation\n\n### Cocoapods (recommended)\n\n1. Install [CocoaPods](https://cocoapods.org)\n2. Add this pod to your `Podfile`\n\n\t```ruby\n\ttarget 'Example' do\n\t\tuse_frameworks!\n\n\t\tpod 'LPIntegratedRating'\n\tend\n\t```\n3. Run `pod install`\n4. Open up the `.xcworkspace` that CocoaPods created\n5. Import `LPIntegratedRating` into any source file where it's needed\n\n### From Source\n\n1. Simply download the source from [here](https://github.com/luispadron/LPIntegratedRating/tree/master/LPIntegratedRating) and add it to your Xcode project\n\n## Usage\n\nTo learn how to properly ask users to rate your app, read the wonderful article which inspired this library [here.](https://medium.com/circa/the-right-way-to-ask-users-to-review-your-app-9a32fd604fca)\n\n### Delegate conformance\n\nYou must conform to the delegate in order to customize the view.\n\nHere is an example:\n\n```swift\nextension ViewController: LPRatingViewDelegate {\n    \n    func ratingViewDidFinish(with status: LPRatingViewCompletionStatus) {\n        switch status {\n        case .ratingApproved:\n            print(\"Rating approved\")\n        case .ratingDenied:\n            print(\"Rating denied\")\n        case .feedbackApproved:\n            print(\"Feedback approved\")\n        case .feedbackDenied:\n            print(\"Feedback denied\")\n        }\n    }\n    \n    func ratingViewConfiguration(for state: LPRatingViewState) -\u003e LPRatingViewConfiguration? {\n        switch state {\n        case .initial:\n            let title = NSAttributedString(string: \"Enjoying this app?\",\n                                           attributes: [.foregroundColor: UIColor.white])\n            let title2 = NSAttributedString(string: \"Yes!\",\n                                            attributes: [.foregroundColor: UIColor(red: 0.376, green: 0.788, blue: 0.773, alpha: 1.00)])\n            let title3 = NSAttributedString(string: \"Not really\",\n                                            attributes: [.foregroundColor: UIColor.white])\n            return LPRatingViewConfiguration(title: title,\n                                             approvalButtonTitle: title2,\n                                             rejectionButtonTitle: title3)\n            \n        case .approval:\n            let title = NSAttributedString(string: \"How about rating, then?\",\n                                           attributes: [.foregroundColor: UIColor.white])\n            let title2 = NSAttributedString(string: \"Ok, sure\",\n                                            attributes: [.foregroundColor: UIColor(red: 0.376, green: 0.788, blue: 0.773, alpha: 1.00)])\n            let title3 = NSAttributedString(string: \"No, thanks\",\n                                            attributes: [.foregroundColor: UIColor.white])\n            return LPRatingViewConfiguration(title: title,\n                                             approvalButtonTitle: title2,\n                                             rejectionButtonTitle: title3)\n        case .rejection:\n            let title = NSAttributedString(string: \"Would you mind giving us some feedback\",\n                                           attributes: [.foregroundColor: UIColor.white])\n            let title2 = NSAttributedString(string: \"Ok, sure\",\n                                            attributes: [.foregroundColor: UIColor(red: 0.376, green: 0.788, blue: 0.773, alpha: 1.00)])\n            let title3 = NSAttributedString(string: \"No, thanks\",\n                                            attributes: [.foregroundColor: UIColor.white])\n            return LPRatingViewConfiguration(title: title,\n                                             approvalButtonTitle: title2,\n                                             rejectionButtonTitle: title3)\n        }\n    }\n}\n\n```\n\n\n\n### UITableView\n\nSimply create an instance of `LPRatingTableViewCell`, assign the delegate and return it!\n\n```swift\noverride func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -\u003e UITableViewCell {\n\tlet cell = LPRatingTableViewCell(style: .default, reuseIdentifier: nil)\n\tcell.delegate = self\n        \n\treturn cell\n}\n```\n\n### UICollectionView\n\nFirst register the class\n\n```swift\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    // Register class\n    collectionView?.register(LPRatingCollectionViewCell.self, forCellWithReuseIdentifier: \"testCell\")\n}\n```\nThen simply create an instance of `LPRatingCollectionViewCell`, assign the delegate and return it\n\n```swift\noverride func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -\u003e UICollectionViewCell {\n    let cell = collectionView.dequeueReusableCell(withReuseIdentifier: \"testCell\", for: indexPath) as! LPRatingCollectionViewCell\n    cell.delegate = self\n    \n    return cell\n}\n```\n\n## View Flow\n\nHere is the flow of the view, and the types of cases that will be passed to the delegate along the way.\n\n![doc-flow](https://raw.githubusercontent.com/luispadron/LPIntegratedRating/master/.github/DocumentationFlow.png)\n\n## Documentation\n\nRead the full documentation [here](https://htmlpreview.github.io/?https://raw.githubusercontent.com/luispadron/LPIntegratedRating/master/docs/index.html)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluispadron%2Flpintegratedrating","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluispadron%2Flpintegratedrating","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluispadron%2Flpintegratedrating/lists"}