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.

594 lines
29 KiB

6 years ago
6 years ago
6 years ago
  1. //
  2. // GeneralInfoPopUp.swift
  3. // GMERemittance
  4. //
  5. // Created by Sujal on 2/12/18.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class PopUpGeneralInfo: UIViewController {
  10. var indexValue: Int = -1
  11. var titleInfo: String?
  12. var message: String?
  13. @IBOutlet weak var iconTopConstraint: NSLayoutConstraint!
  14. @IBOutlet weak var labelPopUpTitle: UILabel!
  15. @IBOutlet weak var labelPopUpMessage: UILabel!
  16. @IBOutlet weak var buttonOk: UIButton!
  17. @IBOutlet weak var imageViewIcon: UIImageView!
  18. @IBOutlet weak var imageViewBackground: UIImageView!
  19. @IBOutlet weak var bgImageConstraint: NSLayoutConstraint!
  20. var inviteeName: String!
  21. override func viewDidLoad() {
  22. super.viewDidLoad()
  23. self.view.backgroundColor = UIColor.black.withAlphaComponent(0.7)
  24. self.showAnimate()
  25. switch indexValue {
  26. case 0: //KYC
  27. labelPopUpTitle.text = "Thank you for registering with GME!"
  28. labelPopUpTitle.textColor = UIColor.white//(hex:0xEC1C24)
  29. labelPopUpMessage.text = "Few more steps to experience the amazing world with GME. Please fill the kyc form."
  30. buttonOk.setTitle("Get Started", for: .normal)
  31. case 1: //Amendment
  32. labelPopUpTitle.text = "Thank you for contacting us."
  33. labelPopUpMessage.text = "We will assess your requirements and be in touch with you shortly."
  34. buttonOk.setTitle("Ok", for: .normal)
  35. case 2: //Feedback
  36. labelPopUpTitle.text = "Thank you for suggestions/ feedback."
  37. //labelPopUpTitle.textColor = UIColor(hex:0xEC1C24)
  38. labelPopUpMessage.text = "We are always seeking to make things better for our customers."
  39. buttonOk.setTitle("Ok", for: .normal)
  40. case 3: //Withdraw
  41. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  42. imageViewIcon.image = UIImage(named: "ic_wallet")
  43. labelPopUpTitle.text = "Withdraw Request"
  44. labelPopUpMessage.text = "We will assess your request and be in touch with you shortly."
  45. buttonOk.setTitle("Ok", for: .normal)
  46. case 4: //Track phase 1
  47. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  48. imageViewIcon.image = UIImage(named: "trackPopup0")
  49. labelPopUpTitle.text = "Send Money"
  50. labelPopUpMessage.text = "Your money transfer has been sent successfully and is under review."
  51. buttonOk.setTitle("Got it", for: .normal)
  52. buttonOk.setTitleColor(UIColor(hex:0xEC1C24), for: .normal)
  53. case 5: //Track phase 2
  54. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  55. imageViewIcon.image = UIImage(named: "trackPopup1")
  56. labelPopUpTitle.text = "In Progress"
  57. labelPopUpMessage.text = "Your money transfer is pending for verification."
  58. buttonOk.setTitle("Got it", for: .normal)
  59. buttonOk.setTitleColor(UIColor(hex:0xEC1C24), for: .normal)
  60. case 6: //Track phase 3
  61. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  62. imageViewIcon.image = UIImage(named: "trackPopup2")
  63. labelPopUpTitle.text = "Available"
  64. labelPopUpMessage.text = "Your money transfer is ready to be picked up at any GME agent location."
  65. buttonOk.setTitle("Got it", for: .normal)
  66. buttonOk.setTitleColor(UIColor(hex:0xEC1C24), for: .normal)
  67. case 7: //Track phase 4
  68. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  69. imageViewIcon.image = UIImage(named: "trackPopup3")
  70. labelPopUpTitle.text = "Received"
  71. labelPopUpMessage.text = "Your money transfer has been successfully received."
  72. buttonOk.setTitle("Got it", for: .normal)
  73. buttonOk.setTitleColor(UIColor(hex:0xEC1C24), for: .normal)
  74. case 8: // first transaction fee is free for home page
  75. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  76. imageViewIcon.image = UIImage(named: "ic_gift")
  77. labelPopUpTitle.text = "Your First Transfer Fees is Free"
  78. labelPopUpMessage.text = "Send Money to your loved ones without any hidden charge."
  79. buttonOk.setTitle("Got it", for: .normal)
  80. case 9: // first transaction fee is free for recipient form
  81. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  82. imageViewIcon.image = UIImage(named: "ic_gift")
  83. labelPopUpTitle.text = "Your First Transfer Fees is Free"
  84. labelPopUpMessage.text = "Send Money to your loved ones without any hidden charge."
  85. buttonOk.setTitle("Got it", for: .normal)
  86. case 10 : // Error message
  87. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  88. imageViewIcon.image = UIImage(named: "ic_error")
  89. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  90. labelPopUpTitle.text = "Error"
  91. labelPopUpMessage.text = message
  92. imageViewBackground.image = nil
  93. buttonOk.setTitle("Ok", for: .normal)
  94. case 11 : // Alert message
  95. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  96. imageViewIcon.image = UIImage(named: "ic_alert")
  97. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  98. labelPopUpTitle.text = "Validation error"
  99. labelPopUpMessage.text = message
  100. imageViewBackground.image = nil
  101. buttonOk.setTitle("Ok", for: .normal)
  102. case 12 : // Invitation
  103. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  104. bgImageConstraint.constant = 300
  105. imageViewIcon.image = UIImage(named: "ic_inviteGMELogo")
  106. labelPopUpTitle.text = "Invitation Successfully Send"
  107. labelPopUpMessage.text = "Your invitation has been successfully send to \(inviteeName!). You will receive GME bonus of 7000KRW in your GME wallet once the invitee perform the money transfer."
  108. buttonOk.setTitle("Ok", for: .normal)
  109. case 13 : // Verified Account
  110. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  111. imageViewIcon.image = UIImage(named: "ic_alert")
  112. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  113. labelPopUpTitle.text = "Alert!"
  114. labelPopUpMessage.text = "Your verification is still in progress."
  115. imageViewBackground.image = nil
  116. buttonOk.setTitle("Ok", for: .normal)
  117. case 14 : // Verified Account
  118. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  119. imageViewIcon.image = UIImage(named: "ic_alert")
  120. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  121. labelPopUpTitle.text = "Alert!"
  122. labelPopUpMessage.text = "Your verification is still in progress."
  123. imageViewBackground.image = nil
  124. buttonOk.setTitle("Ok", for: .normal)
  125. case 15 : // No internet
  126. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  127. imageViewIcon.image = UIImage(named: "ic_no-internet")
  128. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  129. labelPopUpTitle.text = "Whoops!"
  130. labelPopUpMessage.text = "No Internet connection found. 
Check your connection."
  131. imageViewBackground.image = nil
  132. buttonOk.setTitle("Ok", for: .normal)
  133. case 16 : // Alert message for information
  134. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  135. imageViewIcon.image = UIImage(named: "ic_alert")
  136. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  137. labelPopUpTitle.text = titleInfo
  138. labelPopUpMessage.text = message
  139. imageViewBackground.image = nil
  140. buttonOk.setTitle("Ok", for: .normal)
  141. case 17: //Redeem reward
  142. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  143. imageViewIcon.image = UIImage(named: "reward_congrats")
  144. labelPopUpTitle.text = "Congratulations"
  145. labelPopUpMessage.text = "We will contact you soon and visit you to deliver your reward."
  146. buttonOk.setTitle("Ok", for: .normal)
  147. buttonOk.setTitleColor(UIColor(hex: 0xec1c24), for: .normal)
  148. case 18:// general inquiry
  149. labelPopUpTitle.text = "Thank you for contacting us."
  150. labelPopUpMessage.text = "We will assess your requirements and be in touch with you shortly."
  151. buttonOk.setTitle("Ok", for: .normal)
  152. case 19 : // Error message
  153. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  154. imageViewIcon.image = UIImage(named: "ic_error")
  155. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  156. labelPopUpTitle.text = "Error"
  157. labelPopUpMessage.text = message
  158. imageViewBackground.image = nil
  159. buttonOk.setTitle("Ok", for: .normal)
  160. case 20 : //ConnectionTimeOut
  161. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  162. imageViewIcon.image = UIImage(named: "ic_error")
  163. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  164. labelPopUpTitle.text = "Alert"
  165. labelPopUpMessage.text = "Connection timeout. Please try again."
  166. imageViewBackground.image = nil
  167. buttonOk.setTitle("Ok", for: .normal)
  168. case 21:
  169. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  170. imageViewIcon.image = UIImage(named: "ic_no-internet")
  171. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  172. labelPopUpTitle.text = "Whoops!"
  173. labelPopUpMessage.text = "No Internet connection found. 
Check your connection."
  174. imageViewBackground.image = nil
  175. buttonOk.setTitle("Ok", for: .normal)
  176. case 22:
  177. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  178. imageViewIcon.image = UIImage(named: "ic_error")
  179. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  180. labelPopUpTitle.text = "Alert"
  181. labelPopUpMessage.text = "Connection timeout. Please try again."
  182. imageViewBackground.image = nil
  183. buttonOk.setTitle("Ok", for: .normal)
  184. case 23:
  185. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  186. imageViewIcon.image = UIImage(named: "ic_error")
  187. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  188. labelPopUpTitle.text = "Error"
  189. labelPopUpMessage.text = message
  190. imageViewBackground.image = nil
  191. buttonOk.setTitle("Ok", for: .normal)
  192. case 24:
  193. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  194. imageViewIcon.image = UIImage(named: "ic_error")
  195. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  196. labelPopUpTitle.text = "Alert"
  197. labelPopUpMessage.text = "Connection timeout. Please try again."
  198. imageViewBackground.image = nil
  199. buttonOk.setTitle("Ok", for: .normal)
  200. case 25:
  201. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  202. imageViewIcon.image = UIImage(named: "ic_error")
  203. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  204. labelPopUpTitle.text = "Alert"
  205. labelPopUpMessage.text = "Connection timeout. Please try again."
  206. imageViewBackground.image = nil
  207. buttonOk.setTitle("Ok", for: .normal)
  208. case 26:
  209. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  210. imageViewIcon.image = UIImage(named: "ic_error")
  211. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  212. labelPopUpTitle.text = "Alert"
  213. labelPopUpMessage.text = "Connection timeout. Please try again."
  214. imageViewBackground.image = nil
  215. buttonOk.setTitle("Ok", for: .normal)
  216. case 27:
  217. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  218. imageViewIcon.image = UIImage(named: "ic_error")
  219. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  220. labelPopUpTitle.text = "Alert"
  221. labelPopUpMessage.text = "Connection timeout. Please try again."
  222. imageViewBackground.image = nil
  223. buttonOk.setTitle("Ok", for: .normal)
  224. case 28:
  225. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  226. imageViewIcon.image = UIImage(named: "ic_error")
  227. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  228. labelPopUpTitle.text = "Alert"
  229. labelPopUpMessage.text = "Connection timeout. Please try again."
  230. imageViewBackground.image = nil
  231. buttonOk.setTitle("Ok", for: .normal)
  232. case 29:
  233. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  234. imageViewIcon.image = UIImage(named: "ic_error")
  235. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  236. labelPopUpTitle.text = "Alert"
  237. labelPopUpMessage.text = "Connection timeout. Please try again."
  238. imageViewBackground.image = nil
  239. buttonOk.setTitle("Ok", for: .normal)
  240. case 30:
  241. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  242. imageViewIcon.image = UIImage(named: "ic_error")
  243. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  244. labelPopUpTitle.text = "Alert"
  245. labelPopUpMessage.text = "Connection timeout. Please try again."
  246. imageViewBackground.image = nil
  247. buttonOk.setTitle("Ok", for: .normal)
  248. case 31:
  249. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  250. imageViewIcon.image = UIImage(named: "ic_error")
  251. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  252. labelPopUpTitle.text = "Alert"
  253. labelPopUpMessage.text = "Connection timeout. Please try again."
  254. imageViewBackground.image = nil
  255. buttonOk.setTitle("Ok", for: .normal)
  256. case 32:
  257. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  258. imageViewIcon.image = UIImage(named: "ic_error")
  259. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  260. labelPopUpTitle.text = "Alert"
  261. labelPopUpMessage.text = "Connection timeout. Please try again."
  262. imageViewBackground.image = nil
  263. buttonOk.setTitle("Ok", for: .normal)
  264. case 33:
  265. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  266. imageViewIcon.image = UIImage(named: "ic_error")
  267. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  268. labelPopUpTitle.text = "Alert"
  269. labelPopUpMessage.text = "Connection timeout. Please try again."
  270. imageViewBackground.image = nil
  271. buttonOk.setTitle("Ok", for: .normal)
  272. case 34:
  273. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  274. imageViewIcon.image = UIImage(named: "ic_error")
  275. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  276. labelPopUpTitle.text = "Alert"
  277. labelPopUpMessage.text = "Connection timeout. Please try again."
  278. imageViewBackground.image = nil
  279. buttonOk.setTitle("Ok", for: .normal)
  280. case 35:
  281. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  282. imageViewIcon.image = UIImage(named: "ic_error")
  283. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  284. labelPopUpTitle.text = "Alert"
  285. labelPopUpMessage.text = "Connection timeout. Please try again."
  286. imageViewBackground.image = nil
  287. buttonOk.setTitle("Ok", for: .normal)
  288. case 36:
  289. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  290. imageViewIcon.image = UIImage(named: "ic_error")
  291. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  292. labelPopUpTitle.text = "Alert"
  293. labelPopUpMessage.text = "Connection timeout. Please try again."
  294. imageViewBackground.image = nil
  295. buttonOk.setTitle("Ok", for: .normal)
  296. case 37:
  297. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  298. imageViewIcon.image = UIImage(named: "ic_error")
  299. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  300. labelPopUpTitle.text = "Alert"
  301. labelPopUpMessage.text = "Connection timeout. Please try again."
  302. imageViewBackground.image = nil
  303. buttonOk.setTitle("Ok", for: .normal)
  304. case 38:
  305. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  306. imageViewIcon.image = UIImage(named: "ic_error")
  307. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  308. labelPopUpTitle.text = "Alert"
  309. labelPopUpMessage.text = "Connection timeout. Please try again."
  310. imageViewBackground.image = nil
  311. buttonOk.setTitle("Ok", for: .normal)
  312. case 39:
  313. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  314. imageViewIcon.image = UIImage(named: "ic_error")
  315. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  316. labelPopUpTitle.text = "Alert"
  317. labelPopUpMessage.text = "Connection timeout. Please try again."
  318. imageViewBackground.image = nil
  319. buttonOk.setTitle("Ok", for: .normal)
  320. case 40:
  321. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  322. imageViewIcon.image = UIImage(named: "ic_error")
  323. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  324. labelPopUpTitle.text = "Alert"
  325. labelPopUpMessage.text = "Connection timeout. Please try again."
  326. imageViewBackground.image = nil
  327. buttonOk.setTitle("Ok", for: .normal)
  328. case 41:
  329. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  330. imageViewIcon.image = UIImage(named: "ic_error")
  331. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  332. labelPopUpTitle.text = "Alert"
  333. labelPopUpMessage.text = "Connection timeout. Please try again."
  334. imageViewBackground.image = nil
  335. buttonOk.setTitle("Ok", for: .normal)
  336. case 42:
  337. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  338. imageViewIcon.image = UIImage(named: "ic_error")
  339. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  340. labelPopUpTitle.text = "Alert"
  341. labelPopUpMessage.text = "Connection timeout. Please try again."
  342. imageViewBackground.image = nil
  343. buttonOk.setTitle("Ok", for: .normal)
  344. case 43:
  345. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  346. imageViewIcon.image = UIImage(named: "ic_error")
  347. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  348. labelPopUpTitle.text = "Alert"
  349. labelPopUpMessage.text = "Connection timeout. Please try again."
  350. imageViewBackground.image = nil
  351. buttonOk.setTitle("Ok", for: .normal)
  352. case 44:
  353. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  354. imageViewIcon.image = UIImage(named: "ic_error")
  355. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  356. labelPopUpTitle.text = "Alert"
  357. labelPopUpMessage.text = "Connection timeout. Please try again."
  358. imageViewBackground.image = nil
  359. buttonOk.setTitle("Ok", for: .normal)
  360. case 45:
  361. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  362. imageViewIcon.image = UIImage(named: "ic_error")
  363. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  364. labelPopUpTitle.text = "Alert"
  365. labelPopUpMessage.text = "Connection timeout. Please try again."
  366. imageViewBackground.image = nil
  367. buttonOk.setTitle("Ok", for: .normal)
  368. case 46:
  369. iconTopConstraint.constant = iconTopConstraint.constant - 19.4
  370. imageViewIcon.image = UIImage(named: "ic_error")
  371. labelPopUpTitle.textColor = UIColor(red:0.93, green:0.11, blue:0.14, alpha:1.0)
  372. labelPopUpTitle.text = "Alert"
  373. labelPopUpMessage.text = "Connection timeout. Please try again."
  374. imageViewBackground.image = nil
  375. buttonOk.setTitle("Ok", for: .normal)
  376. default:
  377. return
  378. }
  379. }
  380. @IBAction func dismissPopUp(_ sender: Any) {
  381. let appDelegate = UIApplication.shared.delegate as! AppDelegate
  382. switch indexValue {
  383. case 0:
  384. self.navigationController?.navigationBar.isHidden = false
  385. self.removeAnimate()
  386. case 8:
  387. appDelegate.firstTranscationStatusForHome = false
  388. self.removeAnimate()
  389. self.removeFromParentViewController()
  390. case 9:
  391. appDelegate.firstTranscationStatusForProfileForm = false
  392. self.removeAnimate()
  393. self.removeFromParentViewController()
  394. case 1, 2, 3, 14, 17, 18, 19: //Support id = 1,2 & Withdraw id = 3
  395. self.removeAnimate()
  396. showHomeScreen()
  397. case 12:
  398. self.removeAnimate()
  399. self.removeFromParentViewController()
  400. // TODO: Pop to invite view create navigation issue in earned view
  401. // - task GMEA-1061
  402. // self.navigationController?.popToRootViewController(animated: true)
  403. /* self.dismiss(animated: true, completion: nil)
  404. let viewControllers: [UIViewController] = self.navigationController!.viewControllers as [UIViewController]
  405. self.navigationController!.popToViewController(viewControllers[viewControllers.count - 3], animated: true)*/
  406. case 4, 5, 6, 7, 10, 11, 13, 15, 16:
  407. self.removeAnimate()
  408. self.removeFromParentViewController()
  409. case 20:
  410. self.removeAnimate()
  411. self.removeFromParentViewController()
  412. PaymentMethodViewController.paymentMethodConnectionCheck = 0
  413. case 21:
  414. self.removeAnimate()
  415. self.removeFromParentViewController()
  416. KYCDocumentsUploadViewController.internetListener = 0
  417. case 22:
  418. self.removeAnimate()
  419. self.removeFromParentViewController()
  420. KYCDocumentsUploadViewController.timeOutListener = 0
  421. case 23:
  422. self.removeAnimate()
  423. self.removeFromParentViewController()
  424. KYCDocumentsUploadViewController.apiRequestListener = 0
  425. case 24:
  426. self.removeAnimate()
  427. self.removeFromParentViewController()
  428. PaymentMethodViewController.paymentMethodConnectionCheck = 0
  429. case 25:
  430. self.removeAnimate()
  431. self.removeFromParentViewController()
  432. RecipientTranscationViewController.recipientListViewControllerConnectionCheck = 0
  433. case 26:
  434. self.removeAnimate()
  435. self.removeFromParentViewController()
  436. ExchangeRateMultipleCountryViewController.exchangeRateAgentConnectionCheck = 0
  437. case 27:
  438. self.removeAnimate()
  439. self.removeFromParentViewController()
  440. // RecipientFormViewController.recipientConnectionTimeOutConnectionCheck = 0
  441. case 28:
  442. self.removeAnimate()
  443. self.removeFromParentViewController()
  444. MyStoryViewController.socialFeedConnectionTimeOutCheck = 0
  445. case 29:
  446. self.removeAnimate()
  447. self.removeFromParentViewController()
  448. NotificationViewController.notificationConnectionTimeOutCheck = 0
  449. case 30:
  450. self.removeAnimate()
  451. self.removeFromParentViewController()
  452. TranscationStatementViewController.transactionConnectionTimeOutCheck = 0
  453. case 31:
  454. self.removeAnimate()
  455. self.removeFromParentViewController()
  456. WalletViewController.walletConnectionTimeOutCheck = 0
  457. case 32:
  458. self.removeAnimate()
  459. self.removeFromParentViewController()
  460. WalletTransactionListViewController.walletListConnectionTimeOutCheck = 0
  461. case 33:
  462. self.removeAnimate()
  463. self.removeFromParentViewController()
  464. ProfileBankViewController.profileConnectionTimeOutCheck = 0
  465. case 34:
  466. self.removeAnimate()
  467. self.removeFromParentViewController()
  468. ProfileBankViewController.profileConnectionTimeOutCheck = 0
  469. case 35:
  470. self.removeAnimate()
  471. self.removeFromParentViewController()
  472. MoneyRequestViewController.moneyTransactionListConnectionTimeOut = 0
  473. case 36:
  474. self.removeAnimate()
  475. self.removeFromParentViewController()
  476. InviteViewController.inviteConnectionTimeOutCheck = 0
  477. case 37:
  478. self.removeAnimate()
  479. self.removeFromParentViewController()
  480. RewardViewController.rewardConnectionTimeOutCheck = 0
  481. case 38:
  482. self.removeAnimate()
  483. self.removeFromParentViewController()
  484. MobileRechargeViewController.mobileRechargeConnectionTimeOutCheck = 0
  485. case 39:
  486. self.removeAnimate()
  487. self.removeFromParentViewController()
  488. UserInfoViewController.profileEditConnectionTimeOutCheck = 0
  489. case 40:
  490. self.removeAnimate()
  491. self.removeFromParentViewController()
  492. AgentBankViewController.agentConnectionTimeOutCheck = 0
  493. case 41:
  494. self.removeAnimate()
  495. self.removeFromParentViewController()
  496. ProfileViewController.profileConnectionTimeOutCheck = 0
  497. case 42:
  498. self.removeAnimate()
  499. self.removeFromParentViewController()
  500. PayoutViewController.payoutConnectionTimeOutCheck = 0
  501. case 43:
  502. self.removeAnimate()
  503. self.removeFromParentViewController()
  504. RedeemViewController.redeemConnectionTimeOutCheck = 0
  505. case 44:
  506. self.removeAnimate()
  507. self.removeFromParentViewController()
  508. ReferralCodeViewController.referralCodeConnectionTimeOut = 0
  509. case 45:
  510. self.removeAnimate()
  511. self.removeFromParentViewController()
  512. PopUpAddUserProfileViewController.uploadImageConnectionTimeOutCheckDialog = 0
  513. case 46:
  514. self.removeAnimate()
  515. self.removeFromParentViewController()
  516. TrackTransactionViewController.checkTransactionListConnectionTimeOut = 0
  517. default:
  518. return
  519. }
  520. }
  521. func showAnimate()
  522. {
  523. self.view.transform = CGAffineTransform(scaleX: 1.3, y: 1.3)
  524. self.view.alpha = 0.0
  525. self.view.alpha = 1.0
  526. self.view.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
  527. UIView.animate(withDuration: 0.1, animations: {
  528. self.view.alpha = 1.0
  529. self.view.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
  530. });
  531. }
  532. func removeAnimate()
  533. {
  534. UIView.animate(withDuration: 0.0, animations: {
  535. self.view.transform = CGAffineTransform(scaleX: 1.3, y: 1.3)
  536. self.view.alpha = 0.0;
  537. }, completion:{(finished : Bool) in
  538. if (finished)
  539. {
  540. self.view.removeFromSuperview()
  541. }
  542. });
  543. }
  544. }