diff --git a/Core/UDStringExtension.swift b/Core/UDStringExtension.swift index bae15e6..70178b1 100644 --- a/Core/UDStringExtension.swift +++ b/Core/UDStringExtension.swift @@ -57,7 +57,7 @@ extension String { } func udIsValidEmail() -> Bool { - let emailRegex = "[A-Z0-9a-z]([A-Z0-9a-z._%+-]{0,30}[A-Z0-9a-z_])?" + "@" + "([A-Z0-9a-z]([A-Z0-9a-z-]{0,30}[A-Z0-9a-z])?\\.){1,5}" + "[A-Za-z]{2,8}" + let emailRegex = "[A-Z0-9a-z]([A-Z0-9a-z._%+-]{0,64}[A-Z0-9a-z_])?" + "@" + "([A-Z0-9a-z]([A-Z0-9a-z-]{0,255}[A-Z0-9a-z])?\\.){1,5}" + "[A-Za-z]{2,8}" let emailTest = NSPredicate(format:"SELF MATCHES[c] %@", emailRegex) return emailTest.evaluate(with: self) && !self.udIsHtml() } diff --git a/Core/UseDeskSDKHelp.swift b/Core/UseDeskSDKHelp.swift index 09e6d14..49d648d 100755 --- a/Core/UseDeskSDKHelp.swift +++ b/Core/UseDeskSDKHelp.swift @@ -10,7 +10,7 @@ class UseDeskSDKHelp { let payload: [String : Any] = [ "sdk" : "iOS", "type" : "sdk", - "version" : "3.4.11", + "version" : "3.4.12", "message_limit" : countMessagesOnInit, "userData" : getUserParameters() ] diff --git a/Example/UseDesk.xcodeproj/project.pbxproj b/Example/UseDesk.xcodeproj/project.pbxproj index cdf7f7f..19eb15f 100644 --- a/Example/UseDesk.xcodeproj/project.pbxproj +++ b/Example/UseDesk.xcodeproj/project.pbxproj @@ -589,7 +589,7 @@ INFOPLIST_FILE = "UseDesk/UseDesk-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 3.4.11; + MARKETING_VERSION = 3.4.12; MODULE_NAME = ExampleApp; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = UseDeskExampleSDK.ru; @@ -622,7 +622,7 @@ INFOPLIST_FILE = "UseDesk/UseDesk-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 3.4.11; + MARKETING_VERSION = 3.4.12; MODULE_NAME = ExampleApp; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = UseDeskExampleSDK.ru; diff --git a/Example/UseDesk/UDStartViewController/UDStartViewController.swift b/Example/UseDesk/UDStartViewController/UDStartViewController.swift index cf811cf..241328e 100755 --- a/Example/UseDesk/UDStartViewController/UDStartViewController.swift +++ b/Example/UseDesk/UDStartViewController/UDStartViewController.swift @@ -179,8 +179,8 @@ class UDStartViewController: UIViewController, UITextFieldDelegate, TabBarContro @IBAction func startChatButton(_ sender: Any) { guard isCanStartSDK else { return - } + IQKeyboardManager.shared.enable = false isCanStartSDK = false usedesk.presentationCompletionBlock = { [weak self] in self?.isCanStartSDK = true @@ -217,6 +217,7 @@ class UDStartViewController: UIViewController, UITextFieldDelegate, TabBarContro usedesk.presentationCompletionBlock = { print("close SDK") + IQKeyboardManager.shared.enable = true } } @@ -240,6 +241,7 @@ class UDStartViewController: UIViewController, UITextFieldDelegate, TabBarContro } self.isCanStartSDK = true }, errorStatus: { [weak self] _, error in + IQKeyboardManager.shared.enable = true self?.showError(error: error) self?.isCanStartSDK = true }) @@ -263,6 +265,7 @@ class UDStartViewController: UIViewController, UITextFieldDelegate, TabBarContro } self.isCanStartSDK = true }, errorStatus: { [weak self] _, error in + IQKeyboardManager.shared.enable = true self?.showError(error: error) self?.isCanStartSDK = true }) diff --git a/UseDesk/Classes/UDListBaseKnowledgeVC.swift b/UseDesk/Classes/UDListBaseKnowledgeVC.swift index 0d3ff29..88b01b8 100644 --- a/UseDesk/Classes/UDListBaseKnowledgeVC.swift +++ b/UseDesk/Classes/UDListBaseKnowledgeVC.swift @@ -292,7 +292,9 @@ class UDListBaseKnowledgeVC: UDBaseKnowledgeVC, UITableViewDelegate, UITableView self.searchViewTopC.isActive = true self.viewForTableTopCForSuperView.isActive = false self.viewForTableTopC.isActive = true - self.backButton.alpha = 1 + if (self.usedesk?.model.isPresentDefaultControllers ?? true) { + self.backButton.alpha = 1 + } self.viewForTable.alpha = 1 self.searchSeparatorView.alpha = 0 self.searchNotFoundLabel.alpha = 0 diff --git a/UseDesk/Classes/UDMessagesView.swift b/UseDesk/Classes/UDMessagesView.swift index c12b5e6..39acb8c 100755 --- a/UseDesk/Classes/UDMessagesView.swift +++ b/UseDesk/Classes/UDMessagesView.swift @@ -158,8 +158,11 @@ class UDMessagesView: UIViewController, UITextViewDelegate, UIImagePickerControl configurationStyle = usedesk?.configurationStyle ?? ConfigurationStyle() - loader.alpha = 1 - loader.startAnimating() + + loader.alpha = isFromBase ? 0 : 1 + if !isFromBase { + loader.startAnimating() + } tableNode.backgroundColor = configurationStyle.chatStyle.backgroundColor self.view.backgroundColor = tableNode.backgroundColor diff --git a/UseDesk/Classes/UDUIManager.swift b/UseDesk/Classes/UDUIManager.swift index 31957c1..c93cf93 100644 --- a/UseDesk/Classes/UDUIManager.swift +++ b/UseDesk/Classes/UDUIManager.swift @@ -219,6 +219,7 @@ class UDUIManager: UDUIProtocole { if dialogflowVC == nil { dialogflowVC = DialogflowView() dialogflowVC?.usedesk = usedesk + dialogflowVC?.updateChat() } dialogflowVC?.view.layoutSubviews() return dialogflowVC diff --git a/UseDesk_SDK_Swift.podspec b/UseDesk_SDK_Swift.podspec index e59436e..08a39a0 100755 --- a/UseDesk_SDK_Swift.podspec +++ b/UseDesk_SDK_Swift.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'UseDesk_SDK_Swift' - s.version = '3.4.11' + s.version = '3.4.12' s.summary = 'A short description of UseDesk.' s.homepage = 'https://github.com/usedesk/UseDeskSwift'