[ios][ugc] review fixes

This commit is contained in:
Arsentiy Milchakov 2019-02-21 14:49:35 +03:00 committed by Aleksey Belousov
parent 7fd799f742
commit cd27ed3b6b
2 changed files with 8 additions and 8 deletions

View file

@ -76,7 +76,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page:
@interface MWMPlacePageManager ()<MWMFrameworkStorageObserver, MWMPlacePageLayoutDelegate,
MWMPlacePageLayoutDataSource, MWMLocationObserver,
MWMBookmarksObserver, MWMUGCAddReviewControllerDelegate>
MWMBookmarksObserver, MWMGCReviewSaver>
@property(nonatomic) MWMPlacePageLayout * layout;
@property(nonatomic) MWMPlacePageData * data;
@ -597,7 +597,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page:
}];
auto ugcReviewModel =
[[MWMUGCReviewModel alloc] initWithReviewValue:value ratings:ratings title:title text:@""];
auto ugcVC = [MWMUGCAddReviewController instanceWithModel:ugcReviewModel delegate: self];
auto ugcVC = [MWMUGCAddReviewController instanceWithModel:ugcReviewModel saver: self];
[[MapViewController sharedController].navigationController pushViewController:ugcVC animated:YES];
}

View file

@ -1,5 +1,5 @@
@objc(MWMUGCAddReviewControllerDelegate)
protocol UGCAddReviewControllerDelegate {
@objc(MWMGCReviewSaver)
protocol UGCReviewSaver {
typealias onSaveHandler = (Bool) -> Void
func saveUgc(model: UGCAddReviewController.Model, resultHandler: @escaping onSaveHandler)
}
@ -16,10 +16,10 @@ final class UGCAddReviewController: MWMTableViewController {
case text
}
@objc static func instance(model: Model, delegate: UGCAddReviewControllerDelegate) -> UGCAddReviewController {
@objc static func instance(model: Model, saver: UGCReviewSaver) -> UGCAddReviewController {
let vc = UGCAddReviewController(nibName: toString(self), bundle: nil)
vc.model = model
vc.delegate = delegate
vc.saver = saver
return vc
}
@ -33,7 +33,7 @@ final class UGCAddReviewController: MWMTableViewController {
}
private var sections: [Sections] = []
private var delegate: UGCAddReviewControllerDelegate!
private var saver: UGCReviewSaver!
override func viewDidLoad() {
super.viewDidLoad()
@ -70,7 +70,7 @@ final class UGCAddReviewController: MWMTableViewController {
reviewPosted = true
model.text = text
delegate.saveUgc(model: model, resultHandler: { (saveResult) in
saver.saveUgc(model: model, resultHandler: { (saveResult) in
guard let nc = self.navigationController else { return }
if !saveResult {