// // ModelExtension.swift // GMERemittance // // Created by Sujal on 12/26/17. // Copyright © 2017 Gobal Money Express Co. Ltd. All rights reserved. // import Foundation class ModelExtension { var errorMessage: String? var internetConnection: Box = Box(nil) var anotherLogin: Box = Box(nil) func setErrorMessage(message: String) { errorMessage = message } func getErrorMessage() -> String { if errorMessage != nil { return errorMessage! } else { return "Connection timeout. Please try again." } } func getUserId() -> String { if let userId = UserDefaults.standard.object(forKey: "com.gmeremit.username") as? String { return userId } else { return "" } } func getLoginPassword() -> String { let password = UserDefaults.standard.string(forKey: "com.gmeremit.password") return password ?? "" } }