123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // Helper.swift
- // Learn Genie
- //
- // Created by Suraj Kumar Mandal on 31/08/21.
- //
- import Foundation
- import UIKit
- class Helper {
-
- static func showHudWithNoInteraction(show: Bool,view: UIView) {
- if show {
- NetworkIndicator.networkIndicator.showProgressView(view)
- }
- }
-
- static func dismissProgressHud() {
- NetworkIndicator.networkIndicator.hideProgressView()
- }
-
- static func translateText(inputText: String) -> String {
- let translateData = DBManager.sharedInstance.database.objects(TranslationModel.self)
- let id = UserDefaultsConstant.getIntValueFromUserDefults(for: "selectedLanguageId") as! Int
- print(translateData.count)
- var text = ""
- for item in translateData {
- if id == item.languageId && inputText.lowercased() == item.originalText.lowercased() {
- print(item.languageId, item.originalText, item.translatedText, item.id)
- print(item.originalText.lowercased())
- text = item.translatedText
- print(text)
- break
- } else {
- text = inputText
- }
- }
- return text
- }
-
- }
|