[ios] review fix

This commit is contained in:
o.bolovintseva 2018-10-26 17:03:17 +03:00 committed by Aleksey Belousov
parent 503b8c6ac6
commit 29edb1a0b8
2 changed files with 34 additions and 24 deletions

View file

@ -13,7 +13,7 @@
<scene sceneID="U9B-V6-MqR">
<objects>
<tableViewController id="Yad-RH-i8M" customClass="BookmarksSharingViewController" customModule="maps_me" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="1pz-95-Ts3">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="1pz-95-Ts3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
@ -69,6 +69,9 @@
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="upload_and_publish_desc"/>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<constraints>
@ -159,10 +162,13 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Anyone this the link will see your list" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XQh-26-CNo">
<rect key="frame" x="56" y="20" width="303" height="16"/>
<rect key="frame" x="56" y="20" width="303" height="15.5"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="get_direct_link_desc"/>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<constraints>
@ -183,10 +189,8 @@
</tableView>
<connections>
<outlet property="getDirectLinkCell" destination="90b-ef-VUJ" id="L7h-0r-eSe"/>
<outlet property="getDirectLinkDescLabel" destination="XQh-26-CNo" id="0J9-NV-e70"/>
<outlet property="licenseAgreementTextView" destination="dsV-Vs-oCo" id="TtB-Uw-WGR"/>
<outlet property="uploadAndPublishCell" destination="YW0-jq-Isw" id="84h-vp-JdM"/>
<outlet property="uploadAndPublishDescLabel" destination="N3w-HY-3ac" id="swz-rU-GFi"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ylv-YU-ujs" userLabel="First Responder" sceneMemberID="firstResponder"/>

View file

@ -6,12 +6,6 @@ final class BookmarksSharingViewController: MWMTableViewController {
@IBOutlet weak var uploadAndPublishCell: UploadActionCell!
@IBOutlet weak var getDirectLinkCell: UploadActionCell!
@IBOutlet weak var uploadAndPublishDescLabel: UILabel! {
didSet {
uploadAndPublishDescLabel.text = L("upload_and_publish_desc")
}
}
@IBOutlet private weak var licenseAgreementTextView: UITextView! {
didSet {
let htmlString = String(coreFormat: L("ugc_routes_user_agreement"), arguments: [ViewModel.termsOfUseLink()])
@ -23,12 +17,6 @@ final class BookmarksSharingViewController: MWMTableViewController {
}
}
@IBOutlet weak var getDirectLinkDescLabel: UILabel! {
didSet {
getDirectLinkDescLabel.text = L("get_direct_link_desc")
}
}
override func viewDidLoad() {
super.viewDidLoad()
@ -55,14 +43,32 @@ final class BookmarksSharingViewController: MWMTableViewController {
tableView.deselectRow(at: indexPath, animated: true)
let cell = tableView.cellForRow(at: indexPath)
if (cell == self.uploadAndPublishCell || cell == self.getDirectLinkCell) {
MWMFrameworkHelper.checkConnectionAndPerformAction { [unowned self] in
self.signup(anchor: self.view, onComplete: { success in
if (success) {
//impl uploading
}
})
}
if (cell == self.uploadAndPublishCell) {
self.uploadAndPublish()
} else if (cell == self.getDirectLinkCell) {
self.getDirectLink()
}
}
func uploadAndPublish() {
self.performAfterValidation {
//implementation
}
}
func getDirectLink() {
self.performAfterValidation {
//implementation
}
}
func performAfterValidation(action: @escaping MWMVoidBlock) {
MWMFrameworkHelper.checkConnectionAndPerformAction { [unowned self] in
self.signup(anchor: self.view, onComplete: { success in
if (success) {
action()
}
})
}
}
}