Browse Source

change reward ui

pull/1/head
InKwon James Kim 5 years ago
parent
commit
c78e8ffa1e
  1. 35
      GMERemittance/Module/RewardModules/Redeem/User Interface/View/Redeem.storyboard
  2. 16
      GMERemittance/Module/RewardModules/Redeem/User Interface/View/RedeemViewController.swift
  3. 32
      GMERemittance/Module/RewardModules/Reward/User Interface/View/Reward.storyboard

35
GMERemittance/Module/RewardModules/Redeem/User Interface/View/Redeem.storyboard

@ -30,25 +30,28 @@
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<subviews>
<view contentMode="scaleToFill" placeholderIntrinsicWidth="414" placeholderIntrinsicHeight="603" translatesAutoresizingMaskIntoConstraints="NO" id="EFX-6u-NSo">
<rect key="frame" x="0.0" y="0.0" width="375" height="656.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="670"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="LRW-jF-Fzf">
<rect key="frame" x="10" y="10" width="355" height="626.5"/>
<rect key="frame" x="10" y="10" width="355" height="640"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GON-ZE-a1z" userLabel="selectedItemView">
<rect key="frame" x="0.0" y="0.0" width="355" height="170"/>
<rect key="frame" x="0.0" y="0.0" width="355" height="183.5"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="starredBackground" translatesAutoresizingMaskIntoConstraints="NO" id="9N3-FF-Z9b">
<rect key="frame" x="0.0" y="0.0" width="355" height="170"/>
<rect key="frame" x="0.0" y="0.0" width="355" height="183.5"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="तपाईंको रिवार्ड अंक बाट xxx रिडिम गर्नुहोस्,000 अंक हरु तपाईंको रिवार्ड अंक बाट कटौटी हुनेछ " textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJc-f0-ose">
<rect key="frame" x="10" y="127" width="335" height="33"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Redeem xxx, ooo Points will be deducted from your reward point" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJc-f0-ose">
<rect key="frame" x="10" y="140" width="335" height="33.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mT2-re-Yo2">
<rect key="frame" x="10" y="10" width="335" height="107"/>
<rect key="frame" x="10" y="10" width="335" height="120"/>
<constraints>
<constraint firstAttribute="height" constant="120" id="RE8-H1-M1o"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
@ -67,7 +70,7 @@
</constraints>
</view>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Who will receive the rewards?" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ug2-xv-jYl">
<rect key="frame" x="87" y="177" width="181" height="30"/>
<rect key="frame" x="87" y="190.5" width="181" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="vaH-SG-WyG"/>
</constraints>
@ -76,7 +79,7 @@
<nil key="highlightedColor"/>
</label>
<segmentedControl hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" translatesAutoresizingMaskIntoConstraints="NO" id="O3s-cM-BFw">
<rect key="frame" x="20" y="177" width="315" height="31"/>
<rect key="frame" x="20" y="190.5" width="315" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="dqx-wU-lGs"/>
</constraints>
@ -87,7 +90,7 @@
<color key="tintColor" red="0.92941176469999998" green="0.1058823529" blue="0.14117647059999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</segmentedControl>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Diw-ue-AMa">
<rect key="frame" x="20" y="184" width="315" height="109"/>
<rect key="frame" x="20" y="197.5" width="315" height="109"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="EkU-Me-Zae">
<rect key="frame" x="0.0" y="0.0" width="315" height="52"/>
@ -126,7 +129,7 @@
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Select branch for redeem your reward." textAlignment="center" lineBreakMode="wordWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="djo-b7-Gp6">
<rect key="frame" x="60.5" y="307" width="234.5" height="30"/>
<rect key="frame" x="60.5" y="320.5" width="234.5" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Lmw-z8-GeG"/>
</constraints>
@ -135,7 +138,7 @@
<nil key="highlightedColor"/>
</label>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Mlk-Xa-OMy" userLabel="segmentView">
<rect key="frame" x="20" y="344" width="315" height="30"/>
<rect key="frame" x="20" y="357.5" width="315" height="30"/>
<subviews>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" translatesAutoresizingMaskIntoConstraints="NO" id="0ge-iG-7cr">
<rect key="frame" x="0.0" y="0.0" width="315" height="31"/>
@ -160,7 +163,7 @@
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="9" translatesAutoresizingMaskIntoConstraints="NO" id="Tn8-n9-tLQ" userLabel="inputView">
<rect key="frame" x="20" y="351" width="315" height="147.5"/>
<rect key="frame" x="20" y="364.5" width="315" height="147.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="jEL-pw-zU1" userLabel="branchView">
<rect key="frame" x="0.0" y="0.0" width="315" height="147.5"/>
@ -263,10 +266,10 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="18" translatesAutoresizingMaskIntoConstraints="NO" id="uVb-7Z-Fk8" userLabel="blank">
<rect key="frame" x="0.0" y="512.5" width="355" height="50"/>
<rect key="frame" x="0.0" y="526" width="355" height="50"/>
</stackView>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Eqf-wL-rV9">
<rect key="frame" x="77.5" y="576.5" width="200" height="50"/>
<rect key="frame" x="77.5" y="590" width="200" height="50"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="200" id="6mZ-e8-LuH"/>

16
GMERemittance/Module/RewardModules/Redeem/User Interface/View/RedeemViewController.swift

@ -16,10 +16,18 @@ class RedeemViewController: UIViewController {
private var model: RewardProduct? {
didSet {
if let imageData = model?.productImgPath,
let url = URL(string: imageData),
let data = try? Data(contentsOf: url){
selectedItemImageView.image = UIImage(data: data)
DispatchQueue.global().async {
if let imageData = self.model?.productImgPath,
let url = URL(string: imageData),
let data = try? Data(contentsOf: url) {
DispatchQueue.main.async {[weak self] in
guard let `self` = self else {
return
}
self.selectedItemImageView.image = UIImage(data: data)
}
}
}
guard

32
GMERemittance/Module/RewardModules/Reward/User Interface/View/Reward.storyboard

@ -27,29 +27,29 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mVq-cj-kN9">
<rect key="frame" x="10" y="30" width="355" height="16"/>
<rect key="frame" x="10" y="30" width="355" height="132"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="starredBackground" translatesAutoresizingMaskIntoConstraints="NO" id="OUC-GY-cfV">
<rect key="frame" x="0.0" y="0.0" width="355" height="16"/>
<rect key="frame" x="0.0" y="0.0" width="355" height="132"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Note: The reward point is valid for a year only." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zsW-Jn-5cx">
<rect key="frame" x="45" y="-2.5" width="265.5" height="15.5"/>
<rect key="frame" x="53.5" y="113" width="248.5" height="16"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="13"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_reward" translatesAutoresizingMaskIntoConstraints="NO" id="w0R-LI-YPR">
<rect key="frame" x="75.5" y="-33" width="80" height="80"/>
<rect key="frame" x="75.5" y="19.5" width="80" height="80"/>
<constraints>
<constraint firstAttribute="height" constant="80" id="0qu-ST-7fP"/>
<constraint firstAttribute="width" constant="80" id="LaH-ji-hpA"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="a1o-7y-Kgz">
<rect key="frame" x="184.5" y="-18" width="98" height="50"/>
<rect key="frame" x="187.5" y="34.5" width="92" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Reward Points" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vyv-ya-vvm">
<rect key="frame" x="0.0" y="0.0" width="98" height="17"/>
<rect key="frame" x="0.0" y="0.0" width="92" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="bs5-Ee-cbW"/>
</constraints>
@ -58,7 +58,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="999" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qUz-im-Ri9">
<rect key="frame" x="24" y="25" width="50.5" height="25"/>
<rect key="frame" x="21" y="25" width="50.5" height="25"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="30"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
@ -84,7 +84,7 @@
</constraints>
</view>
<collectionView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="vmj-sE-fUF">
<rect key="frame" x="10" y="76" width="355" height="581"/>
<rect key="frame" x="10" y="197" width="355" height="460"/>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="TUx-T5-4WL">
<size key="itemSize" width="320" height="260"/>
@ -104,7 +104,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="260"/>
<subviews>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gXS-zt-2Em" userLabel="Image">
<rect key="frame" x="10" y="10" width="300" height="138.5"/>
<rect key="frame" x="10" y="15" width="300" height="138.5"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yBC-h9-W9V">
<rect key="frame" x="0.0" y="0.0" width="300" height="138.5"/>
@ -120,16 +120,16 @@
</constraints>
</view>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yng-4K-S2l">
<rect key="frame" x="10" y="153.5" width="300" height="51.5"/>
<rect key="frame" x="10" y="158.5" width="300" height="46.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bose Portable Speaker" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BqF-5D-gKI">
<rect key="frame" x="10" y="7" width="280" height="19.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<rect key="frame" x="10" y="4.5" width="280" height="17"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="ZuI-S8-E7W" userLabel="Point">
<rect key="frame" x="10" y="31.5" width="280" height="20"/>
<rect key="frame" x="10" y="26.5" width="280" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="19800" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="45R-vr-kHD">
<rect key="frame" x="0.0" y="0.0" width="138.5" height="20"/>
@ -188,7 +188,7 @@
<constraint firstAttribute="trailing" secondItem="7p0-Ih-FE0" secondAttribute="trailing" id="USA-fy-xey"/>
<constraint firstItem="Qou-YC-598" firstAttribute="height" secondItem="BxP-VR-9pb" secondAttribute="height" multiplier="0.15:1" id="dyW-5n-uSE"/>
<constraint firstItem="Qou-YC-598" firstAttribute="width" secondItem="BxP-VR-9pb" secondAttribute="width" multiplier="0.5:1" id="kgK-g9-K5L"/>
<constraint firstItem="gXS-zt-2Em" firstAttribute="top" secondItem="BxP-VR-9pb" secondAttribute="top" constant="10" id="p0A-ak-GTK"/>
<constraint firstItem="gXS-zt-2Em" firstAttribute="top" secondItem="BxP-VR-9pb" secondAttribute="top" constant="15" id="p0A-ak-GTK"/>
<constraint firstItem="Yng-4K-S2l" firstAttribute="leading" secondItem="BxP-VR-9pb" secondAttribute="leading" constant="10" id="qwg-eV-eBK"/>
<constraint firstItem="Qou-YC-598" firstAttribute="top" secondItem="7p0-Ih-FE0" secondAttribute="bottom" constant="5" id="tKD-lC-dhX"/>
<constraint firstAttribute="trailing" secondItem="gXS-zt-2Em" secondAttribute="trailing" constant="10" id="usV-HI-31j"/>
@ -215,7 +215,7 @@
</cells>
</collectionView>
<segmentedControl opaque="NO" clipsSubviews="YES" contentMode="scaleAspectFit" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="pUS-5u-yiU">
<rect key="frame" x="320" y="51" width="45" height="21"/>
<rect key="frame" x="320" y="172" width="45" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="45" id="3Ig-8M-nEs"/>
<constraint firstAttribute="height" constant="20" id="Ohr-Rq-jxc"/>
@ -233,7 +233,7 @@
</subviews>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="pUS-5u-yiU" firstAttribute="top" secondItem="mVq-cj-kN9" secondAttribute="bottom" constant="5" id="33O-u2-VAn"/>
<constraint firstItem="pUS-5u-yiU" firstAttribute="top" secondItem="mVq-cj-kN9" secondAttribute="bottom" constant="10" id="33O-u2-VAn"/>
<constraint firstItem="mVq-cj-kN9" firstAttribute="top" secondItem="xzr-V8-PuC" secondAttribute="top" constant="10" id="ToK-9y-JLR"/>
<constraint firstItem="xzr-V8-PuC" firstAttribute="bottom" secondItem="vmj-sE-fUF" secondAttribute="bottom" constant="10" id="WAE-L4-8NY"/>
<constraint firstItem="vmj-sE-fUF" firstAttribute="leading" secondItem="xzr-V8-PuC" secondAttribute="leading" constant="10" id="ZPN-6Q-A6T"/>

Loading…
Cancel
Save