Skip to content

swordray/JXReviewController

Repository files navigation

JXReviewController

Request rating by 1-5 stars.

CI Status Version License Platform

Requirements

  • iOS 13+

Installation

JXReviewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'JXReviewController'

Usage

  • Present a JXReviewController instance from your view controller.

    import JXReviewController
    
    class ViewController: UIViewController {
    
        func requestReview() {
            let reviewController = JXReviewController()
            reviewController.image = UIImage(systemName: "app.fill")
            reviewController.title = "Enjoy it?"
            reviewController.message = "Tap a star to rate it."
            reviewController.delegate = self
            present(reviewController, animated: true)
        }
    }
  • Receive feedbacks by implimenting JXReviewControllerDelegate.

    extension ViewController: JXReviewControllerDelegate {
    
        func reviewController(_ reviewController: JXReviewController, didSelectWith point: Int) {
            print("Did select with \(point) point(s).")
        }
    
        func reviewController(_ reviewController: JXReviewController, didCancelWith point: Int) {
            print("Did cancel with \(point) point(s).")
        }
    
        func reviewController(_ reviewController: JXReviewController, didSubmitWith point: Int) {
            print("Did submit with \(point) point(s).")
        }
    }

Author

Jianqiu Xiao, swordray@gmail.com

Sponsors

License

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