You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

384 lines
28 KiB

  1. splash screen recreated in module
  2. # Please enter the commit message for your changes. Lines starting
  3. # with '#' will be ignored, and an empty message aborts the commit.
  4. #
  5. # Date: Mon Sep 10 14:03:30 2018 +0900
  6. # Committer: gme_2 <gme_2@gme-2s-iMac.local>
  7. #
  8. # On branch login-revamp
  9. # Changes to be committed:
  10. # modified: GMERemittance/AppDelegate.swift
  11. # modified: GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard
  12. # modified: GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift
  13. #
  14. # ------------------------ >8 ------------------------
  15. # Do not modify or remove the line above.
  16. # Everything below it will be ignored.
  17. diff --git a/GMERemittance/AppDelegate.swift b/GMERemittance/AppDelegate.swift
  18. index 04a941a..e9fd1c5 100644
  19. --- a/GMERemittance/AppDelegate.swift
  20. +++ b/GMERemittance/AppDelegate.swift
  21. @@ -74,8 +74,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
  22. self.window?.rootViewController = mainWireFrame?.getMainView()
  23. }else {
  24. // go to splashscreen
  25. - let splasScreen = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "_SplashScreenViewController") as! _SplashScreenViewController
  26. - self.window?.rootViewController = splasScreen
  27. + let splashWireframe = SplashScreenWireframe()
  28. + self.window?.rootViewController = splashWireframe.getMainView()
  29. +// let splasScreen = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "_SplashScreenViewController") as! _SplashScreenViewController
  30. +// self.window?.rootViewController = splasScreen
  31. }
  32. }
  33. diff --git a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard
  34. index a6cae57..730ea50 100644
  35. --- a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard
  36. +++ b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard
  37. @@ -1,31 +1,191 @@
  38. <?xml version="1.0" encoding="UTF-8"?>
  39. -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
  40. +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
  41. <device id="retina4_7" orientation="portrait">
  42. <adaptation id="fullscreen"/>
  43. </device>
  44. <dependencies>
  45. - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
  46. + <deployment identifier="iOS"/>
  47. + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
  48. + <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
  49. + <capability name="Safe area layout guides" minToolsVersion="9.0"/>
  50. <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
  51. </dependencies>
  52. + <customFonts key="customFonts">
  53. + <array key="SanFranciscoDisplay-Regular.otf">
  54. + <string>SanFranciscoDisplay-Regular</string>
  55. + </array>
  56. + <array key="SanFranciscoDisplay-Semibold.otf">
  57. + <string>SanFranciscoDisplay-Semibold</string>
  58. + </array>
  59. + </customFonts>
  60. <scenes>
  61. <!--SplashScreen-->
  62. <scene sceneID="R60-Pu-Hpy">
  63. <objects>
  64. - <viewController storyboardIdentifier="SplashScreenViewController" title="SplashScreen" id="HSb-ou-7T5" customClass="SplashScreenViewController" sceneMemberID="viewController">
  65. - <layoutGuides>
  66. - <viewControllerLayoutGuide type="top" id="y1H-iV-BwG"/>
  67. - <viewControllerLayoutGuide type="bottom" id="PYB-Kq-ghm"/>
  68. - </layoutGuides>
  69. - <view key="view" contentMode="scaleToFill" id="9Uc-9s-KgO">
  70. + <viewController storyboardIdentifier="SplashScreenViewController" title="SplashScreen" id="HSb-ou-7T5" customClass="SplashScreenViewController" customModule="GMERemittance" customModuleProvider="target" sceneMemberID="viewController">
  71. + <view key="view" contentMode="scaleToFill" id="cZd-Ew-7KS">
  72. <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
  73. - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  74. - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
  75. + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  76. + <subviews>
  77. + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3AH-hs-RVn">
  78. + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
  79. + <subviews>
  80. + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rya-vW-oho">
  81. + <rect key="frame" x="0.0" y="0.0" width="375" height="689"/>
  82. + <subviews>
  83. + <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash_logo" translatesAutoresizingMaskIntoConstraints="NO" id="BNn-h6-EZr">
  84. + <rect key="frame" x="104.5" y="30" width="166" height="90"/>
  85. + <constraints>
  86. + <constraint firstAttribute="height" constant="90" id="lds-zl-5Da"/>
  87. + </constraints>
  88. + </imageView>
  89. + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DFQ-aB-MeN">
  90. + <rect key="frame" x="112.5" y="170" width="150" height="150"/>
  91. + <subviews>
  92. + <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_ovalBackground" translatesAutoresizingMaskIntoConstraints="NO" id="wTx-2C-aXn">
  93. + <rect key="frame" x="0.0" y="0.0" width="150" height="150"/>
  94. + <constraints>
  95. + <constraint firstAttribute="height" constant="150" id="5vb-62-RKH"/>
  96. + <constraint firstAttribute="width" constant="150" id="CS8-YS-v6q"/>
  97. + </constraints>
  98. + </imageView>
  99. + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_splashFirstScreen" translatesAutoresizingMaskIntoConstraints="NO" id="G8I-TB-kIW">
  100. + <rect key="frame" x="50" y="51" width="50" height="48"/>
  101. + </imageView>
  102. + </subviews>
  103. + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
  104. + <constraints>
  105. + <constraint firstAttribute="trailing" secondItem="wTx-2C-aXn" secondAttribute="trailing" id="4CJ-zc-qmG"/>
  106. + <constraint firstAttribute="bottom" secondItem="wTx-2C-aXn" secondAttribute="bottom" id="GvU-WE-WiZ"/>
  107. + <constraint firstItem="wTx-2C-aXn" firstAttribute="top" secondItem="DFQ-aB-MeN" secondAttribute="top" id="Hto-lb-6BK"/>
  108. + <constraint firstItem="G8I-TB-kIW" firstAttribute="centerX" secondItem="DFQ-aB-MeN" secondAttribute="centerX" id="QNB-iN-4Ic"/>
  109. + <constraint firstItem="wTx-2C-aXn" firstAttribute="leading" secondItem="DFQ-aB-MeN" secondAttribute="leading" id="Qq4-av-JOa"/>
  110. + <constraint firstAttribute="width" constant="150" id="SjN-Aa-LFz"/>
  111. + <constraint firstAttribute="width" secondItem="DFQ-aB-MeN" secondAttribute="height" multiplier="1:1" id="WOz-He-xLi"/>
  112. + <constraint firstItem="G8I-TB-kIW" firstAttribute="centerY" secondItem="DFQ-aB-MeN" secondAttribute="centerY" id="nqP-ld-CAD"/>
  113. + </constraints>
  114. + </view>
  115. + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hassle free money transfer to your loved ones" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xIR-gr-Rkn">
  116. + <rect key="frame" x="34" y="355" width="308" height="43"/>
  117. + <constraints>
  118. + <constraint firstAttribute="height" constant="43" id="6ZP-PP-o5T"/>
  119. + </constraints>
  120. + <fontDescription key="fontDescription" name="SanFranciscoDisplay-Semibold" family="San Francisco Display" pointSize="18"/>
  121. + <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
  122. + <nil key="highlightedColor"/>
  123. + </label>
  124. + <stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="196-Q3-KMs">
  125. + <rect key="frame" x="167" y="448" width="41" height="7"/>
  126. + <subviews>
  127. + <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dotUnselected" translatesAutoresizingMaskIntoConstraints="NO" id="XaM-Bb-cbb" userLabel="dotLeft">
  128. + <rect key="frame" x="0.0" y="0.0" width="7" height="7"/>
  129. + </imageView>
  130. + <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dotUnselected" translatesAutoresizingMaskIntoConstraints="NO" id="YH4-j7-ASu" userLabel="dotCenter">
  131. + <rect key="frame" x="17" y="0.0" width="7" height="7"/>
  132. + </imageView>
  133. + <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dotUnselected" translatesAutoresizingMaskIntoConstraints="NO" id="zwr-Vy-PYs" userLabel="dotRight">
  134. + <rect key="frame" x="34" y="0.0" width="7" height="7"/>
  135. + </imageView>
  136. + </subviews>
  137. + </stackView>
  138. + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G73-dq-xvs">
  139. + <rect key="frame" x="88" y="495" width="200" height="50"/>
  140. + <constraints>
  141. + <constraint firstAttribute="height" constant="50" id="32w-qb-i02"/>
  142. + </constraints>
  143. + <fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="18"/>
  144. + <state key="normal" title="Login"/>
  145. + <userDefinedRuntimeAttributes>
  146. + <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
  147. + <integer key="value" value="30"/>
  148. + </userDefinedRuntimeAttribute>
  149. + <userDefinedRuntimeAttribute type="color" keyPath="layer.borderColor">
  150. + <color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
  151. + </userDefinedRuntimeAttribute>
  152. + <userDefinedRuntimeAttribute type="number" keyPath="layer.borderWidth">
  153. + <integer key="value" value="5"/>
  154. + </userDefinedRuntimeAttribute>
  155. + </userDefinedRuntimeAttributes>
  156. + <connections>
  157. + <action selector="login:" destination="HSb-ou-7T5" eventType="touchUpInside" id="qm9-my-wwG"/>
  158. + </connections>
  159. + </button>
  160. + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xXT-1Y-c8Y">
  161. + <rect key="frame" x="88" y="559" width="200" height="50"/>
  162. + <color key="backgroundColor" red="0.80784313725490198" green="0.043137254901960784" blue="0.14117647058823529" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
  163. + <constraints>
  164. + <constraint firstAttribute="height" constant="50" id="uKY-N1-RoR"/>
  165. + </constraints>
  166. + <fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="18"/>
  167. + <state key="normal" title="New User"/>
  168. + <connections>
  169. + <action selector="register:" destination="HSb-ou-7T5" eventType="touchUpInside" id="FcL-4Z-y2u"/>
  170. + </connections>
  171. + </button>
  172. + </subviews>
  173. + <color key="backgroundColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
  174. + <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
  175. + <constraints>
  176. + <constraint firstItem="xXT-1Y-c8Y" firstAttribute="top" secondItem="G73-dq-xvs" secondAttribute="bottom" constant="14" id="05X-HH-zOg"/>
  177. + <constraint firstItem="xXT-1Y-c8Y" firstAttribute="leading" secondItem="rya-vW-oho" secondAttribute="leading" constant="88" id="3GM-N4-Yb1"/>
  178. + <constraint firstItem="BNn-h6-EZr" firstAttribute="centerX" secondItem="rya-vW-oho" secondAttribute="centerX" id="BD5-BN-O0S"/>
  179. + <constraint firstItem="196-Q3-KMs" firstAttribute="centerX" secondItem="rya-vW-oho" secondAttribute="centerX" id="H3c-u4-j6s"/>
  180. + <constraint firstItem="DFQ-aB-MeN" firstAttribute="top" secondItem="BNn-h6-EZr" secondAttribute="bottom" constant="50" id="IQq-bO-qSK"/>
  181. + <constraint firstAttribute="bottom" secondItem="xXT-1Y-c8Y" secondAttribute="bottom" constant="80" id="OHt-O2-fQE"/>
  182. + <constraint firstAttribute="trailing" secondItem="xIR-gr-Rkn" secondAttribute="trailing" constant="33" id="PwQ-gh-uD4"/>
  183. + <constraint firstItem="G73-dq-xvs" firstAttribute="top" secondItem="196-Q3-KMs" secondAttribute="bottom" constant="40" id="VS5-fH-uca"/>
  184. + <constraint firstItem="G73-dq-xvs" firstAttribute="leading" secondItem="rya-vW-oho" secondAttribute="leading" constant="88" id="Yeb-0M-kUj"/>
  185. + <constraint firstItem="xIR-gr-Rkn" firstAttribute="leading" secondItem="rya-vW-oho" secondAttribute="leading" constant="34" id="cDX-Tb-Zs2"/>
  186. + <constraint firstAttribute="trailing" secondItem="G73-dq-xvs" secondAttribute="trailing" constant="87" id="cgt-7L-nox"/>
  187. + <constraint firstItem="xIR-gr-Rkn" firstAttribute="top" secondItem="DFQ-aB-MeN" secondAttribute="bottom" constant="35" id="clM-cf-ScL"/>
  188. + <constraint firstItem="DFQ-aB-MeN" firstAttribute="centerX" secondItem="rya-vW-oho" secondAttribute="centerX" id="hqp-u1-2tp"/>
  189. + <constraint firstAttribute="trailing" secondItem="xXT-1Y-c8Y" secondAttribute="trailing" constant="87" id="mgM-K0-LCa"/>
  190. + <constraint firstItem="BNn-h6-EZr" firstAttribute="top" secondItem="rya-vW-oho" secondAttribute="top" constant="30" id="qME-Af-FLX"/>
  191. + <constraint firstItem="196-Q3-KMs" firstAttribute="top" secondItem="xIR-gr-Rkn" secondAttribute="bottom" constant="50" id="whr-N1-J6a"/>
  192. + </constraints>
  193. + </view>
  194. + </subviews>
  195. + <constraints>
  196. + <constraint firstAttribute="bottom" secondItem="rya-vW-oho" secondAttribute="bottom" id="8lk-xe-sbE"/>
  197. + <constraint firstAttribute="trailing" secondItem="rya-vW-oho" secondAttribute="trailing" id="HPk-by-347"/>
  198. + <constraint firstItem="rya-vW-oho" firstAttribute="width" secondItem="3AH-hs-RVn" secondAttribute="width" id="hhQ-i2-vMx"/>
  199. + <constraint firstItem="rya-vW-oho" firstAttribute="leading" secondItem="3AH-hs-RVn" secondAttribute="leading" id="m4M-ZS-n7J"/>
  200. + <constraint firstItem="rya-vW-oho" firstAttribute="top" secondItem="3AH-hs-RVn" secondAttribute="top" id="xIz-9X-FKh"/>
  201. + </constraints>
  202. + </scrollView>
  203. + </subviews>
  204. + <color key="backgroundColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
  205. + <constraints>
  206. + <constraint firstItem="3AH-hs-RVn" firstAttribute="leading" secondItem="nO4-c6-DCK" secondAttribute="leading" id="8bh-Xd-Rbc"/>
  207. + <constraint firstItem="3AH-hs-RVn" firstAttribute="top" secondItem="cZd-Ew-7KS" secondAttribute="top" id="B9t-2U-Zxd"/>
  208. + <constraint firstItem="nO4-c6-DCK" firstAttribute="trailing" secondItem="3AH-hs-RVn" secondAttribute="trailing" id="HqS-yB-j3n"/>
  209. + <constraint firstAttribute="bottom" secondItem="3AH-hs-RVn" secondAttribute="bottom" id="w1a-fo-IFG"/>
  210. + <constraint firstItem="3AH-hs-RVn" firstAttribute="width" secondItem="cZd-Ew-7KS" secondAttribute="width" id="xC7-kk-7dt"/>
  211. + </constraints>
  212. + <viewLayoutGuide key="safeArea" id="nO4-c6-DCK"/>
  213. </view>
  214. + <connections>
  215. + <outlet property="buttonLogin" destination="G73-dq-xvs" id="JbA-re-pVh"/>
  216. + <outlet property="buttonSignUp" destination="xXT-1Y-c8Y" id="699-2r-8l6"/>
  217. + <outlet property="constraintLeft" destination="cDX-Tb-Zs2" id="Uo2-4H-ALq"/>
  218. + <outlet property="constraintRight" destination="PwQ-gh-uD4" id="2i7-GS-Sxa"/>
  219. + <outlet property="imageViewDotCenter" destination="YH4-j7-ASu" id="zcu-n5-9q8"/>
  220. + <outlet property="imageViewDotLeft" destination="XaM-Bb-cbb" id="OZK-A6-a4p"/>
  221. + <outlet property="imageViewDotRight" destination="zwr-Vy-PYs" id="Snz-cG-hIV"/>
  222. + <outlet property="imageViewHomeLogo" destination="G8I-TB-kIW" id="p4M-lW-AhN"/>
  223. + <outlet property="labelHomeDescription" destination="xIR-gr-Rkn" id="aJM-YA-KBS"/>
  224. + </connections>
  225. </viewController>
  226. <placeholder placeholderIdentifier="IBFirstResponder" id="8je-5K-XuW" userLabel="First Responder" sceneMemberID="firstResponder"/>
  227. </objects>
  228. - <point key="canvasLocation" x="-91" y="233"/>
  229. + <point key="canvasLocation" x="-92" y="232.53373313343329"/>
  230. </scene>
  231. </scenes>
  232. + <resources>
  233. + <image name="dotUnselected" width="7" height="7"/>
  234. + <image name="ic_ovalBackground" width="150" height="150"/>
  235. + <image name="ic_splashFirstScreen" width="50" height="48"/>
  236. + <image name="splash_logo" width="166" height="47"/>
  237. + </resources>
  238. <color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
  239. </document>
  240. diff --git a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift
  241. index a2d7ca2..3500219 100644
  242. --- a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift
  243. +++ b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift
  244. @@ -11,10 +11,37 @@ import UIKit
  245. class SplashScreenViewController: UIViewController {
  246. // MARK: IBOutlets
  247. + @IBOutlet weak var imageViewDotCenter: UIImageView!
  248. + @IBOutlet weak var imageViewDotLeft: UIImageView!
  249. + @IBOutlet weak var imageViewDotRight: UIImageView!
  250. + @IBOutlet weak var imageViewHomeLogo: UIImageView!
  251. + @IBOutlet weak var labelHomeDescription: UILabel!
  252. +
  253. + @IBOutlet weak var constraintLeft: NSLayoutConstraint!
  254. + @IBOutlet weak var constraintRight: NSLayoutConstraint!
  255. +
  256. + @IBOutlet weak var buttonLogin: UIButton!
  257. + @IBOutlet weak var buttonSignUp: UIButton!
  258. // MARK: Properties
  259. +
  260. + var counter: Int = 0
  261. +
  262. + let imageDotSelected = UIImage(named: "dotSelected")
  263. + let imageDotUnselected = UIImage(named: "dotUnselected")
  264. +
  265. + let imageFirst = UIImage(named: "ic_splashFirstScreen")
  266. + let imageSecond = UIImage(named: "ic_splashSecondScreen")
  267. + let imageThird = UIImage(named: "ic_splashThirdScreen")
  268. +
  269. + let descriptionFirst = "Hassle free money transfer to your loved ones"
  270. + let descriptionSecond = "Connect to local community"
  271. + let descriptionThird = "Earn reward points and get surprise gifts"
  272. +
  273. +
  274. +
  275. var presenter: SplashScreenModuleInterface?
  276. @@ -27,11 +54,99 @@ class SplashScreenViewController: UIViewController {
  277. // MARK: IBActions
  278. + @IBAction func login(_ sender: UIButton) {
  279. + print("login")
  280. + }
  281. +
  282. +
  283. + @IBAction func register(_ sender: UIButton) {
  284. + print("register")
  285. + }
  286. +
  287. // MARK: Other Functions
  288. private func setup() {
  289. // all setup should be done here
  290. -
  291. + setUpButtons()
  292. +
  293. + imageViewDotLeft.image = UIImage(named: "dotSelected")
  294. + let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:)))
  295. + let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:)))
  296. +
  297. + leftSwipe.direction = .left
  298. + rightSwipe.direction = .right
  299. +
  300. + view.addGestureRecognizer(leftSwipe)
  301. + view.addGestureRecognizer(rightSwipe)
  302. +
  303. + Timer.scheduledTimer(timeInterval: 2, target: self, selector: #selector(_SplashScreenViewController.updateImage), userInfo: nil, repeats: true)
  304. + }
  305. +
  306. + @objc func handleSwipes(_ sender: UISwipeGestureRecognizer) {
  307. + if (sender.direction == .right) {
  308. + counter = counter - 1
  309. + if counter < 0 {
  310. + counter = 2
  311. + }
  312. + }
  313. +
  314. + if (sender.direction == .left) {
  315. + counter = counter + 1
  316. + if counter > 2 {
  317. + counter = 0
  318. + }
  319. + }
  320. + setImageandLabels()
  321. + }
  322. +
  323. + @objc func updateImage() {
  324. + counter += 1
  325. + if counter > 2 {
  326. + counter = 0
  327. + }
  328. + setImageandLabels()
  329. + }
  330. +
  331. + func setImageandLabels() {
  332. +
  333. + imageViewDotLeft.image = imageDotUnselected
  334. + imageViewDotCenter.image = imageDotUnselected
  335. + imageViewDotRight.image = imageDotUnselected
  336. +
  337. + switch counter {
  338. + case 0:
  339. + constraintLeft.constant = 34
  340. + constraintRight.constant = 33
  341. + imageViewDotLeft.image = imageDotSelected
  342. + imageViewHomeLogo.image = imageFirst
  343. + labelHomeDescription.text = descriptionFirst
  344. + case 1:
  345. + constraintLeft.constant = 34
  346. + constraintRight.constant = 33
  347. + imageViewDotCenter.image = imageDotSelected
  348. + imageViewHomeLogo.image = imageSecond
  349. + labelHomeDescription.text = descriptionSecond
  350. + case 2:
  351. + constraintLeft.constant = 61
  352. + constraintRight.constant = 60
  353. + imageViewDotRight.image = imageDotSelected
  354. + imageViewHomeLogo.image = imageThird
  355. + labelHomeDescription.text = descriptionThird
  356. + default:
  357. + return
  358. + }
  359. + }
  360. +
  361. + func setUpButtons() {
  362. + buttonSignUp.layer.cornerRadius = 25
  363. + buttonLogin.backgroundColor = .clear
  364. + buttonLogin.layer.cornerRadius = 25
  365. + buttonLogin.layer.borderWidth = 1
  366. + buttonLogin.layer.borderColor = UIColor.white.cgColor
  367. + }
  368. +
  369. + override func didReceiveMemoryWarning() {
  370. + super.didReceiveMemoryWarning()
  371. }
  372. }