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.
 
 
 
 

43 lines
1018 B

//
// 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<Bool?> = Box(nil)
var anotherLogin: Box<Bool?> = 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 ?? ""
}
}