TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2017 |
Maintained by Stephen Goodman.
To run the example project, clone the repo, and run pod install
from the Example directory first.
SGReviewTableView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SGReviewTableView"
http://cocoadocs.org/docsets/SGReviewTableView/
@import SGReviewTableView;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//create a review
SGReview *review = [[SGReview alloc] initWithRating:5.0 content:@"Excellent!" andDate:[NSDate new]];
SGReviewTableViewController *reviewTableView = [[SGReviewTableViewController alloc] initWithReviews:@[review]];
reviewTableView.graphBarColor = [UIColor redColor];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:reviewTableView];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = nav;
[self.window makeKeyAndVisible];
return YES;
}
@end
import UIKit
import SGReviewTableView
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let r = SGReview(rating:4.5, content:"Awesome!", andDate:Date())
let reviewTableView = SGReviewTableViewController(reviews: [r!])
reviewTableView?.graphBarColor = UIColor.red;
let nav = UINavigationController(rootViewController: reviewTableView!)
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = nav
self.window?.makeKeyAndVisible()
return true
}
}
The SGReviewTableViewController accepts an array of SGReview objects. Currently only ratings of 0.0-5.0 are valid ratings.
SGReview *review = [[SGReview alloc] initWithRating:5.0 content:@"Excellent!" andDate:[NSDate new]];
let review = SGReview(rating:4.5, content:"Awesome!", andDate:Date())
Currently customization is limited. The following properties can be customized on SGReviewTableViewController:
Stephen Goodman, [email protected]
SGReviewTableView is available under the MIT license. See the LICENSE file for more info.