From c1357f4e5da7f240780b91a012efeeecaaae5a11 Mon Sep 17 00:00:00 2001 From: elizasapir Date: Wed, 15 Jul 2020 09:47:46 +0300 Subject: [PATCH 01/10] update podfile --- BasicSample/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BasicSample/Podfile b/BasicSample/Podfile index fb3f047..25b16f1 100755 --- a/BasicSample/Podfile +++ b/BasicSample/Podfile @@ -19,7 +19,7 @@ install! 'cocoapods', # Dev #source 'https://github.com/nanorepsdk/NRSDK-Dev-specs.git' # Production -source 'https://github.com/nanorepsdk/NRSDK-specs.git' +#source 'https://github.com/nanorepsdk/NRSDK-specs.git' source 'https://github.com/CocoaPods/Specs' From b78e865e975b866c67bb920640e2c8a22672976c Mon Sep 17 00:00:00 2001 From: Omer Rahmany Date: Tue, 28 Jul 2020 14:53:45 +0300 Subject: [PATCH 02/10] Dispatching alert on the main thread --- .../ChatViewControllers/BotDemoViewController.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift index 8eac9d4..00de97c 100644 --- a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift +++ b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift @@ -87,12 +87,13 @@ extension BotDemoViewController: ChatControllerDelegate { break } - let alert = UIAlertController(title: "Error!", message: errorMsg, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: { (action) in - self.navigationController?.popToRootViewController(animated: true) - })) - - self.navigationController?.present(alert, animated: true, completion: nil) + DispatchQueue.main.async { + let alert = UIAlertController(title: "Error!", message: errorMsg, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: { (action) in + self.navigationController?.popToRootViewController(animated: true) + })) + self.navigationController?.present(alert, animated: true, completion: nil) + } } func didUpdateState(_ event: ChatStateEvent!) { From a17653f72c8b5158fcc3c899719fb805ce8f91cd Mon Sep 17 00:00:00 2001 From: elizasapir Date: Wed, 29 Jul 2020 18:00:47 +0300 Subject: [PATCH 03/10] add file upload failure alert --- .../BasicSample.xcodeproj/project.pbxproj | 72 +++++++++---------- .../xcschemes/BasicSample.xcscheme | 2 +- .../BotDemoViewController.swift | 10 +-- .../FileUploadDemoViewController.swift | 14 ++++ 4 files changed, 56 insertions(+), 42 deletions(-) diff --git a/BasicSample/BasicSample.xcodeproj/project.pbxproj b/BasicSample/BasicSample.xcodeproj/project.pbxproj index 4caacd0..419c987 100644 --- a/BasicSample/BasicSample.xcodeproj/project.pbxproj +++ b/BasicSample/BasicSample.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 3A5E9F966C2655E79C14253C /* Pods_BasicSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57F1EE6DDCA1E56951F4C12B /* Pods_BasicSample.framework */; }; 483EA67C2369CA7100B9BBE1 /* HandOverHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 483EA67B2369CA7000B9BBE1 /* HandOverHandler.swift */; }; 4848892022EEF871000CF01E /* EmbedDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4848891F22EEF871000CF01E /* EmbedDemoViewController.swift */; }; 484F087023D5AFE30013046C /* LiveAccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 484F086F23D5AFE30013046C /* LiveAccountViewController.swift */; }; @@ -42,7 +43,6 @@ 48A5A19A22761DCB0073F57B /* MainTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48A5A19922761DCB0073F57B /* MainTableViewController.swift */; }; 48A5A19C227635FD0073F57B /* DemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48A5A19B227635FD0073F57B /* DemoTableViewCell.swift */; }; 48F6DBA2230C4220008EA1A0 /* AutoCompleteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F6DBA1230C4220008EA1A0 /* AutoCompleteViewController.swift */; }; - 70C202F694A74F6E9395CD9F /* Pods_BasicSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 716BEB2BF8B887A84DE4858E /* Pods_BasicSample.framework */; }; AF12C8A321D22C90007450EF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF12C8A221D22C90007450EF /* AppDelegate.swift */; }; AF12C8A821D22C90007450EF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AF12C8A621D22C90007450EF /* Main.storyboard */; }; AF12C8AA21D22C91007450EF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AF12C8A921D22C91007450EF /* Assets.xcassets */; }; @@ -89,9 +89,7 @@ 48A5A19922761DCB0073F57B /* MainTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTableViewController.swift; sourceTree = ""; }; 48A5A19B227635FD0073F57B /* DemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoTableViewCell.swift; sourceTree = ""; }; 48F6DBA1230C4220008EA1A0 /* AutoCompleteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoCompleteViewController.swift; sourceTree = ""; }; - 567A596874F0DFCA554E587C /* Pods-BasicSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.debug.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.debug.xcconfig"; sourceTree = ""; }; - 716BEB2BF8B887A84DE4858E /* Pods_BasicSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BasicSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A94C83895BEB749345637473 /* Pods-BasicSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.release.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.release.xcconfig"; sourceTree = ""; }; + 57F1EE6DDCA1E56951F4C12B /* Pods_BasicSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BasicSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AF12C89F21D22C90007450EF /* BasicSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BasicSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; AF12C8A221D22C90007450EF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; AF12C8A721D22C90007450EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -102,7 +100,9 @@ AF91186B238D1583007F5D3A /* CustomFileUploadDemoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomFileUploadDemoVC.swift; sourceTree = ""; }; AF911887239000DB007F5D3A /* FileUploadDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileUploadDemoViewController.swift; sourceTree = ""; }; AFF9BCAA22E86CC60078DD8A /* AvailibilityViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvailibilityViewController.swift; sourceTree = ""; }; + B58F964592AE2B3E9A13C59E /* Pods-BasicSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.release.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.release.xcconfig"; sourceTree = ""; }; ECE12750231BB34700A362C7 /* ContinuityDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinuityDemoViewController.swift; sourceTree = ""; }; + F954F755342D6690877F2795 /* Pods-BasicSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.debug.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -110,7 +110,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 70C202F694A74F6E9395CD9F /* Pods_BasicSample.framework in Frameworks */, + 3A5E9F966C2655E79C14253C /* Pods_BasicSample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -185,21 +185,13 @@ path = RestoreChat; sourceTree = ""; }; - 66BA36762FAFD6F85F90A58C /* Frameworks */ = { - isa = PBXGroup; - children = ( - 716BEB2BF8B887A84DE4858E /* Pods_BasicSample.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; AF12C89621D22C90007450EF = { isa = PBXGroup; children = ( AF12C8A121D22C90007450EF /* BasicSample */, AF12C8A021D22C90007450EF /* Products */, B7C6AE904CE1881071FF9D83 /* Pods */, - 66BA36762FAFD6F85F90A58C /* Frameworks */, + F54F23B650406DB234A7E351 /* Frameworks */, ); sourceTree = ""; }; @@ -246,12 +238,20 @@ B7C6AE904CE1881071FF9D83 /* Pods */ = { isa = PBXGroup; children = ( - 567A596874F0DFCA554E587C /* Pods-BasicSample.debug.xcconfig */, - A94C83895BEB749345637473 /* Pods-BasicSample.release.xcconfig */, + F954F755342D6690877F2795 /* Pods-BasicSample.debug.xcconfig */, + B58F964592AE2B3E9A13C59E /* Pods-BasicSample.release.xcconfig */, ); path = Pods; sourceTree = ""; }; + F54F23B650406DB234A7E351 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 57F1EE6DDCA1E56951F4C12B /* Pods_BasicSample.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -259,11 +259,11 @@ isa = PBXNativeTarget; buildConfigurationList = AF12C8B121D22C91007450EF /* Build configuration list for PBXNativeTarget "BasicSample" */; buildPhases = ( - C61500C395C2E54F8C60C0CC /* [CP] Check Pods Manifest.lock */, + 82D83E10CD763B3907299E33 /* [CP] Check Pods Manifest.lock */, AF12C89B21D22C90007450EF /* Sources */, AF12C89C21D22C90007450EF /* Frameworks */, AF12C89D21D22C90007450EF /* Resources */, - 6F16FEBC99C7BE7BB0F2E34D /* [CP] Embed Pods Frameworks */, + F40403E1F26E14C309C113F4 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -281,7 +281,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0940; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1150; ORGANIZATIONNAME = bold360ai; TargetAttributes = { AF12C89E21D22C90007450EF = { @@ -334,43 +334,43 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 6F16FEBC99C7BE7BB0F2E34D /* [CP] Embed Pods Frameworks */ = { + 82D83E10CD763B3907299E33 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-BasicSample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C61500C395C2E54F8C60C0CC /* [CP] Check Pods Manifest.lock */ = { + F40403E1F26E14C309C113F4 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-BasicSample-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -553,7 +553,7 @@ }; AF12C8B221D22C91007450EF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 567A596874F0DFCA554E587C /* Pods-BasicSample.debug.xcconfig */; + baseConfigurationReference = F954F755342D6690877F2795 /* Pods-BasicSample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; @@ -573,7 +573,7 @@ }; AF12C8B321D22C91007450EF /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A94C83895BEB749345637473 /* Pods-BasicSample.release.xcconfig */; + baseConfigurationReference = B58F964592AE2B3E9A13C59E /* Pods-BasicSample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; diff --git a/BasicSample/BasicSample.xcodeproj/xcshareddata/xcschemes/BasicSample.xcscheme b/BasicSample/BasicSample.xcodeproj/xcshareddata/xcschemes/BasicSample.xcscheme index 86864ed..492ca6f 100644 --- a/BasicSample/BasicSample.xcodeproj/xcshareddata/xcschemes/BasicSample.xcscheme +++ b/BasicSample/BasicSample.xcodeproj/xcshareddata/xcschemes/BasicSample.xcscheme @@ -1,6 +1,6 @@ ") }) { (info) in + if((info.error) != nil) { + print(info.error.localizedDescription) + + let alert = UIAlertController(title: "Error", message:info.error.localizedDescription, preferredStyle: UIAlertController.Style.alert) + + // add an action (button) + alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil)) + + // show the alert + self.navigationController?.presentedViewController?.present(alert, animated: true, completion: nil) + } self.chatController.handle(BoldEvent.fileUploaded(info)) } } @@ -134,6 +145,9 @@ extension FileUploadDemoViewController: UIImagePickerControllerDelegate, UINavig self.chatController.uploadFile(request, progress: { (progress) in print("application file upload progress ->") }) { (info) in + if((info.error) != nil) { + + } self.chatController.handle(BoldEvent.fileUploaded(info)) } } From 955fc7b72edc5978d5a89e8b07be7b4f7207ae44 Mon Sep 17 00:00:00 2001 From: Omer Rahmany Date: Mon, 24 Aug 2020 16:04:21 +0300 Subject: [PATCH 04/10] [BLD-38223] Adding ChatConfigurationHandler --- BasicSample/BasicSample.xcodeproj/project.pbxproj | 4 ++++ .../ChatViewControllers/BotDemoViewController.swift | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/BasicSample/BasicSample.xcodeproj/project.pbxproj b/BasicSample/BasicSample.xcodeproj/project.pbxproj index 419c987..4c888a0 100644 --- a/BasicSample/BasicSample.xcodeproj/project.pbxproj +++ b/BasicSample/BasicSample.xcodeproj/project.pbxproj @@ -50,6 +50,7 @@ AF91186C238D1583007F5D3A /* CustomFileUploadDemoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF91186B238D1583007F5D3A /* CustomFileUploadDemoVC.swift */; }; AF911888239000DB007F5D3A /* FileUploadDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF911887239000DB007F5D3A /* FileUploadDemoViewController.swift */; }; AFF9BCAB22E86CC60078DD8A /* AvailibilityViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFF9BCAA22E86CC60078DD8A /* AvailibilityViewController.swift */; }; + ECDE8DF924EC749F00BC3152 /* ChatConfigurationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDE8DF824EC749E00BC3152 /* ChatConfigurationHandler.swift */; }; ECE12751231BB34700A362C7 /* ContinuityDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECE12750231BB34700A362C7 /* ContinuityDemoViewController.swift */; }; /* End PBXBuildFile section */ @@ -101,6 +102,7 @@ AF911887239000DB007F5D3A /* FileUploadDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileUploadDemoViewController.swift; sourceTree = ""; }; AFF9BCAA22E86CC60078DD8A /* AvailibilityViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvailibilityViewController.swift; sourceTree = ""; }; B58F964592AE2B3E9A13C59E /* Pods-BasicSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.release.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.release.xcconfig"; sourceTree = ""; }; + ECDE8DF824EC749E00BC3152 /* ChatConfigurationHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatConfigurationHandler.swift; sourceTree = ""; }; ECE12750231BB34700A362C7 /* ContinuityDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinuityDemoViewController.swift; sourceTree = ""; }; F954F755342D6690877F2795 /* Pods-BasicSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.debug.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -157,6 +159,7 @@ 487351CA22784A260029F295 /* ChatViewControllers */ = { isa = PBXGroup; children = ( + ECDE8DF824EC749E00BC3152 /* ChatConfigurationHandler.swift */, 4899613F22763AD500D86590 /* BotDemoViewController.swift */, 4899614122763B1800D86590 /* AgentViewController.swift */, 487351CB22784A7F0029F295 /* HistoryDemoViewController.swift */, @@ -393,6 +396,7 @@ ECE12751231BB34700A362C7 /* ContinuityDemoViewController.swift in Sources */, AFF9BCAB22E86CC60078DD8A /* AvailibilityViewController.swift in Sources */, 483EA67C2369CA7100B9BBE1 /* HandOverHandler.swift in Sources */, + ECDE8DF924EC749F00BC3152 /* ChatConfigurationHandler.swift in Sources */, 487351CC22784A7F0029F295 /* HistoryDemoViewController.swift in Sources */, 486C0B2823D4624700544AAE /* AddContextTableViewCell.swift in Sources */, 4899614822773FD300D86590 /* RestoredChatDemo.xcdatamodeld in Sources */, diff --git a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift index 1eb116b..36ceb0a 100644 --- a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift +++ b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift @@ -12,7 +12,8 @@ class BotDemoViewController: UIViewController { var chatController: ChatController! var handOver = HandOverHandler() var account: Account! - + var chatConfigurationHandler = ChatConfigurationHandler() + override func viewDidLoad() { super.viewDidLoad() ChatController.clearCache(withInvalidDays:0) @@ -24,6 +25,7 @@ class BotDemoViewController: UIViewController { chatController.speechReconitionDelegate = self chatController.delegate = self chatController.viewConfiguration.voiceToVoiceConfiguration.type = .default + chatController.viewConfiguration = chatConfigurationHandler.defaultConfig } @objc func dismissChat(_ sender: UIBarButtonItem?) { From cf1e01ba5391dce88f708457ee9843b76d60cbef Mon Sep 17 00:00:00 2001 From: Omer Rahmany Date: Thu, 17 Sep 2020 17:44:09 +0300 Subject: [PATCH 05/10] [BLD-38223] Adding chatConfigurationHandler support to BotDemoViewController --- .../robot.imageset/Contents.json | 12 +- .../BotDemoViewController.swift | 6 +- .../ChatConfigurationHandler.swift | 223 ++++++++++++++++++ 3 files changed, 233 insertions(+), 8 deletions(-) create mode 100644 BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift diff --git a/BasicSample/BasicSample/Assets.xcassets/robot.imageset/Contents.json b/BasicSample/BasicSample/Assets.xcassets/robot.imageset/Contents.json index cc4b86d..78f6954 100644 --- a/BasicSample/BasicSample/Assets.xcassets/robot.imageset/Contents.json +++ b/BasicSample/BasicSample/Assets.xcassets/robot.imageset/Contents.json @@ -1,26 +1,26 @@ { "images" : [ { - "idiom" : "universal", "filename" : "outline_adb_black_36pt_1x.png", + "idiom" : "universal", "scale" : "1x" }, { - "idiom" : "universal", "filename" : "outline_adb_black_36pt_2x.png", + "idiom" : "universal", "scale" : "2x" }, { - "idiom" : "universal", "filename" : "outline_adb_black_36pt_3x.png", + "idiom" : "universal", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 }, "properties" : { "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift index 36ceb0a..3528332 100644 --- a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift +++ b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift @@ -18,12 +18,12 @@ class BotDemoViewController: UIViewController { super.viewDidLoad() ChatController.clearCache(withInvalidDays:0) // Do any additional setup after loading the view. - self.view.backgroundColor = .white chatController = ChatController(account: account) chatController.handOver = self.handOver chatController.continuityProvider = self chatController.speechReconitionDelegate = self chatController.delegate = self + chatController.viewConfiguration.voiceToVoiceConfiguration.type = .default chatController.viewConfiguration = chatConfigurationHandler.defaultConfig } @@ -151,7 +151,9 @@ extension BotDemoViewController: ContinuityProvider { if (key == "UserID") { handler("112233443322154534") } else { - handler(UserDefaults.standard.value(forKey: key) as? String) +// handler(UserDefaults.standard.value(forKey: key) as? String) + handler("112233443322154534") + } } } diff --git a/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift new file mode 100644 index 0000000..b61d920 --- /dev/null +++ b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift @@ -0,0 +1,223 @@ +// +// ChatConfigurationHandler.swift +// BasicSample +// +// Created by Omer Rahmany on 16/08/2020. +// Copyright © 2020 bold360ai. All rights reserved. +// + +import UIKit +import Bold360AI + +class ChatConfigurationHandler: NSObject { + + private var customFont:CustomFont + + override init() { + customFont = CustomFont() + customFont.font = UIFont.systemFont(ofSize: 12) + // TODO:: understand how to set fontFileName + // customFont.fontFileName = "" } + } + + var defaultConfig: Bold360AI.ChatConfiguration { + get { + return Bold360AI.ChatConfiguration() + } + } + + + var test:Bold360AI.ChatConfiguration { + get { + let config = Bold360AI.ChatConfiguration() +// config.chatViewConfig.backgroundColor = UIColor.gray +// config.chatViewConfig.backgroundImage = UIImage(named: "bold") +// config.chatViewConfig.dateStampColor = UIColor.red +// config.chatViewConfig.customFont = customFont +// // TODO:: make sure it works +// config.chatViewConfig.maxLength = 5 + + // Nisso +// config.chatViewConfig.avatarImageSize = .large + // Viktor +// config.chatViewConfig.avatarImageWidthSize = 30.0 +// config.chatViewConfig.avatarImageHightSize = 30.0 + +// config.incomingBotConfig.quickOptionConfig.avatarPosition = AvatarPosition.topLeft +// +// config.incomingBotConfig.quickOptionConfig.avatar = UIImage(named: "robot") +// +// +// config.incomingBotConfig.quickOptionConfig.textColor = UIColor.red +// let dateFormatterGet = DateFormatter() +// dateFormatterGet.dateFormat = "yyyy-MM-dd HH:mm:ss" +// config.incomingBotConfig.quickOptionConfig.dateFormatter = dateFormatterGet +// let timeFormatterGet = DateFormatter() +// timeFormatterGet.dateFormat = "HH:mm:ss" +// config.incomingBotConfig.quickOptionConfig.timeFormatter = timeFormatterGet +// +// // IncomingBotConfiguration +// +// // IncomingBotConfiguration : ChatElementConfiguration + config.incomingBotConfig.backgroundColor = UIColor.systemYellow +// config.incomingBotConfig.backgroundImage = UIImage(named: "bold") + config.incomingBotConfig.dateStampColor = UIColor.green + config.incomingBotConfig.dateStampFont = UIFont(name: "Times New Roman", size: 19.0) +// config.incomingBotConfig.customFont = customFont +// config.incomingBotConfig.maxLength = 3 + +// config.incomingBotConfig.avatarPosition = AvatarPosition.bottomRight +// config.incomingBotConfig.avatar = UIImage(named: "agent") + config.incomingBotConfig.textColor = UIColor.red +// config.incomingBotConfig.dateFormatter = dateFormatterGet +// config.incomingBotConfig.timeFormatter = timeFormatterGet + +// +// // IncomingBotConfiguration - QuickOptionConfiguration *quickOptionConfig +// // QuickOptionConfiguration : ChatElementConfiguration +// config.incomingBotConfig.quickOptionConfig.backgroundColor = UIColor.purple +// config.incomingBotConfig.quickOptionConfig.backgroundImage = UIImage(named: "bold") +// config.incomingBotConfig.quickOptionConfig.dateStampColor = UIColor.brown +// config.incomingBotConfig.quickOptionConfig.customFont = customFont +// config.incomingBotConfig.quickOptionConfig.maxLength = 2 +// +// // IncomingBotConfiguration - PersistentOptionConfiguration *persistentOptionConfig +// // PersistentOptionConfiguration : ChatElementConfiguration +// config.incomingBotConfig.persistentOptionConfig.backgroundColor = UIColor.purple +// config.incomingBotConfig.persistentOptionConfig.backgroundImage = UIImage(named: "bold") +// config.incomingBotConfig.persistentOptionConfig.dateStampColor = UIColor.brown +// config.incomingBotConfig.persistentOptionConfig.customFont = customFont +// config.incomingBotConfig.persistentOptionConfig.maxLength = 2 +// +// // IncomingBotConfiguration - InstantFeedbackConfiguration *instantFeedbackConfig +// // IncomingBotTitleConfiguration : ChatElementConfiguration +// // TODO:: check if the inheritence is wrong +// config.incomingBotConfig.titleConfig.backgroundColor = UIColor.blue +// config.incomingBotConfig.titleConfig.backgroundImage = UIImage(named: "bold") +// config.incomingBotConfig.titleConfig.dateStampColor = UIColor.darkGray +// config.incomingBotConfig.titleConfig.customFont = customFont +// config.incomingBotConfig.titleConfig.maxLength = 3 +// +// // IncomingBotConfiguration - CarouselConfiguration *carouselConfig +// // CarouselConfiguration : ChatElementConfiguration +// config.incomingBotConfig.carouselConfig.backgroundColor = UIColor.yellow +// config.incomingBotConfig.carouselConfig.backgroundImage = UIImage(named: "bold") +// config.incomingBotConfig.carouselConfig.dateStampColor = UIColor.black +// config.incomingBotConfig.carouselConfig.customFont = customFont +// config.incomingBotConfig.carouselConfig.maxLength = 4 +// +// // CarouselButtonConfiguration : ChatElementConfiguration +// config.incomingBotConfig.carouselConfig.button.backgroundColor = UIColor.blue +// config.incomingBotConfig.carouselConfig.button.backgroundImage = UIImage(named: "bold") +// config.incomingBotConfig.carouselConfig.button.dateStampColor = UIColor.darkGray +// config.incomingBotConfig.carouselConfig.button.customFont = customFont +// config.incomingBotConfig.carouselConfig.button.maxLength = 3 +// +// // OutgoingConfiguration +// config.outgoingConfig.sentSuccessfullyIcon = UIImage(named: "bold") +// config.outgoingConfig.sentFailureIcon = UIImage(named: "bold") +// config.outgoingConfig.pendingIcon = UIImage(named: "bold") +// +// // OutgoingConfiguration : ChatElementConfiguration + config.outgoingConfig.backgroundColor = UIColor.blue +// config.outgoingConfig.backgroundImage = UIImage(named: "bold") + config.outgoingConfig.dateStampColor = UIColor.red + config.outgoingConfig.dateStampFont = UIFont(name: "Times New Roman", size: 13.0)// config.outgoingConfig.customFont = customFont +// config.outgoingConfig.maxLength = 3 +// +// config.outgoingConfig.avatarPosition = AvatarPosition.bottomRight +// config.outgoingConfig.avatar = UIImage(named: "agent") + config.outgoingConfig.textColor = UIColor.green +// config.outgoingConfig.dateFormatter = dateFormatterGet +// config.outgoingConfig.timeFormatter = timeFormatterGet + +// +// // SystemMessageConfiguration +// // SystemMessageConfiguration : ChatElementConfiguration +// config.systemMessageConfig.backgroundColor = UIColor.blue +// config.systemMessageConfig.backgroundImage = UIImage(named: "bold") +// config.systemMessageConfig.dateStampColor = UIColor.darkGray +// config.systemMessageConfig.customFont = customFont +// config.systemMessageConfig.maxLength = 3 +// +// // InfoViewConfiguration +// config.queueViewConfig.textColor = UIColor.blue +// config.queueViewConfig.backgroundColor = UIColor.blue +// config.queueViewConfig.font = UIFont.systemFont(ofSize: 12) +// +// // SearchViewConfiguration +// config.searchViewConfig.speechOnIcon = UIImage(named: "bold") +// config.searchViewConfig.speechOffIcon = UIImage(named: "bold") +// config.searchViewConfig.readoutIcon = UIImage(named: "bold") +// config.searchViewConfig.sendIcon = UIImage(named: "bold") +// config.searchViewConfig.uploadIcon = UIImage(named: "bold") +// config.searchViewConfig.voiceEnabled = false +// config.searchViewConfig.languageCode = "heb" +// // AutoCompleteConfiguration * autoCompleteConfiguration +// config.searchViewConfig.autoCompleteConfiguration?.isEnabled = true +// // AutoCompleteConfiguration : TextConfiguration +// config.searchViewConfig.autoCompleteConfiguration?.text = "Hey" +// config.searchViewConfig.autoCompleteConfiguration?.font = UIFont.systemFont(ofSize: 20) +// config.searchViewConfig.autoCompleteConfiguration?.backgroundColor = UIColor.red +// config.searchViewConfig.autoCompleteConfiguration?.textColor = UIColor.blue +// // PlaceholderConfiguration * placeholderConfiguration +// config.searchViewConfig.placeholderConfiguration?.recordText = "Recording Now.." +// config.searchViewConfig.placeholderConfiguration?.readoutext = "Readingout Now.." +// // PlaceholderConfiguration : TextConfiguration +// config.searchViewConfig.placeholderConfiguration?.text = "Placeholder text" +// config.searchViewConfig.placeholderConfiguration?.font = UIFont.systemFont(ofSize: 20) +// config.searchViewConfig.placeholderConfiguration?.backgroundColor = UIColor.red +// config.searchViewConfig.placeholderConfiguration?.textColor = UIColor.blue +// // SearchViewConfiguration : TextConfiguration +// config.searchViewConfig.text = "hey" +// config.searchViewConfig.font = customFont.font +// config.searchViewConfig.textColor = UIColor.green +// config.searchViewConfig.backgroundColor = UIColor.purple +// +// // ReadMoreViewConfiguration +// // ReadMoreTitleConfiguration *title +// // ReadMoreTitleConfiguration : AutoCompleteConfiguration +// config.readMoreViewConfig.title.isEnabled = false +// config.readMoreViewConfig.title.text = "hey" +// config.readMoreViewConfig.title.font = customFont.font +// config.readMoreViewConfig.title.textColor = UIColor.green +// config.readMoreViewConfig.title.backgroundColor = UIColor.purple +// +// // ChatBarConfiguration +// config.chatBarConfiguration.image = UIImage(named: "bold")! +// config.chatBarConfiguration.agentName = "agent name" +// config.chatBarConfiguration.endChatBtnTitle = "endChatBtnTitle" +// config.chatBarConfiguration.endChatBtnTextColor = UIColor.green +// config.chatBarConfiguration.endChatButtonEnabled = true +// config.chatBarConfiguration.enabled = true +// +// // ChatBarConfiguration : InfoViewConfiguration +// config.chatBarConfiguration.textColor = UIColor.green +// config.chatBarConfiguration.backgroundColor = UIColor.brown +// config.chatBarConfiguration.font = customFont.font +// +// // VoiceToVoiceConfiguration +// config.voiceToVoiceConfiguration.type = .default +// config.voiceToVoiceConfiguration.silenceTimeBeforeMessageSent = 3.0 +// // SynthesizerConfiguration *synthesizerConfiguration +// config.voiceToVoiceConfiguration.synthesizerConfiguration.currentLanguageCode = "en-GB" +// config.voiceToVoiceConfiguration.synthesizerConfiguration.pitchMultiplier = 2.0 +// config.voiceToVoiceConfiguration.synthesizerConfiguration.preUtteranceDelay = 2.0 +// config.voiceToVoiceConfiguration.synthesizerConfiguration.rate = 2.0 +// config.voiceToVoiceConfiguration.synthesizerConfiguration.volume = 0.5 +// +// // BoldFormConfiguration +// // BoldFormElementConfiguration *titleConfig +// // BoldFormElementConfiguration +// config.formConfiguration.titleConfig.font = customFont.font +// config.formConfiguration.titleConfig.textColor = UIColor.green +// config.formConfiguration.titleConfig.backgroundColor = UIColor.blue +// +// config.formConfiguration.multiSelectElementConfig.font = customFont.font +// config.formConfiguration.multiSelectElementConfig.textColor = UIColor.green +// config.formConfiguration.multiSelectElementConfig.backgroundColor = UIColor.blue + + return config + } + } +} From 2f1053abf8bcec7bdcf7407a75cdf70753427544 Mon Sep 17 00:00:00 2001 From: elizasapir Date: Mon, 12 Oct 2020 16:00:20 +0300 Subject: [PATCH 06/10] update podfile to iOS 10 --- .../BasicSample.xcodeproj/project.pbxproj | 62 ------------------- .../ChatConfigurationHandler.swift | 6 +- BasicSample/Podfile | 2 +- 3 files changed, 4 insertions(+), 66 deletions(-) diff --git a/BasicSample/BasicSample.xcodeproj/project.pbxproj b/BasicSample/BasicSample.xcodeproj/project.pbxproj index 4c888a0..a6704c6 100644 --- a/BasicSample/BasicSample.xcodeproj/project.pbxproj +++ b/BasicSample/BasicSample.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 3A5E9F966C2655E79C14253C /* Pods_BasicSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57F1EE6DDCA1E56951F4C12B /* Pods_BasicSample.framework */; }; 483EA67C2369CA7100B9BBE1 /* HandOverHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 483EA67B2369CA7000B9BBE1 /* HandOverHandler.swift */; }; 4848892022EEF871000CF01E /* EmbedDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4848891F22EEF871000CF01E /* EmbedDemoViewController.swift */; }; 484F087023D5AFE30013046C /* LiveAccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 484F086F23D5AFE30013046C /* LiveAccountViewController.swift */; }; @@ -90,7 +89,6 @@ 48A5A19922761DCB0073F57B /* MainTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTableViewController.swift; sourceTree = ""; }; 48A5A19B227635FD0073F57B /* DemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoTableViewCell.swift; sourceTree = ""; }; 48F6DBA1230C4220008EA1A0 /* AutoCompleteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoCompleteViewController.swift; sourceTree = ""; }; - 57F1EE6DDCA1E56951F4C12B /* Pods_BasicSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BasicSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AF12C89F21D22C90007450EF /* BasicSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BasicSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; AF12C8A221D22C90007450EF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; AF12C8A721D22C90007450EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -101,10 +99,8 @@ AF91186B238D1583007F5D3A /* CustomFileUploadDemoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomFileUploadDemoVC.swift; sourceTree = ""; }; AF911887239000DB007F5D3A /* FileUploadDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileUploadDemoViewController.swift; sourceTree = ""; }; AFF9BCAA22E86CC60078DD8A /* AvailibilityViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvailibilityViewController.swift; sourceTree = ""; }; - B58F964592AE2B3E9A13C59E /* Pods-BasicSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.release.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.release.xcconfig"; sourceTree = ""; }; ECDE8DF824EC749E00BC3152 /* ChatConfigurationHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatConfigurationHandler.swift; sourceTree = ""; }; ECE12750231BB34700A362C7 /* ContinuityDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinuityDemoViewController.swift; sourceTree = ""; }; - F954F755342D6690877F2795 /* Pods-BasicSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.debug.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -112,7 +108,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3A5E9F966C2655E79C14253C /* Pods_BasicSample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -194,7 +189,6 @@ AF12C8A121D22C90007450EF /* BasicSample */, AF12C8A021D22C90007450EF /* Products */, B7C6AE904CE1881071FF9D83 /* Pods */, - F54F23B650406DB234A7E351 /* Frameworks */, ); sourceTree = ""; }; @@ -241,20 +235,10 @@ B7C6AE904CE1881071FF9D83 /* Pods */ = { isa = PBXGroup; children = ( - F954F755342D6690877F2795 /* Pods-BasicSample.debug.xcconfig */, - B58F964592AE2B3E9A13C59E /* Pods-BasicSample.release.xcconfig */, ); path = Pods; sourceTree = ""; }; - F54F23B650406DB234A7E351 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 57F1EE6DDCA1E56951F4C12B /* Pods_BasicSample.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -262,11 +246,9 @@ isa = PBXNativeTarget; buildConfigurationList = AF12C8B121D22C91007450EF /* Build configuration list for PBXNativeTarget "BasicSample" */; buildPhases = ( - 82D83E10CD763B3907299E33 /* [CP] Check Pods Manifest.lock */, AF12C89B21D22C90007450EF /* Sources */, AF12C89C21D22C90007450EF /* Frameworks */, AF12C89D21D22C90007450EF /* Resources */, - F40403E1F26E14C309C113F4 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -336,48 +318,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 82D83E10CD763B3907299E33 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-BasicSample-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - F40403E1F26E14C309C113F4 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ AF12C89B21D22C90007450EF /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -557,7 +497,6 @@ }; AF12C8B221D22C91007450EF /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F954F755342D6690877F2795 /* Pods-BasicSample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; @@ -577,7 +516,6 @@ }; AF12C8B321D22C91007450EF /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B58F964592AE2B3E9A13C59E /* Pods-BasicSample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; diff --git a/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift index b61d920..03c70b1 100644 --- a/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift +++ b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift @@ -179,9 +179,9 @@ class ChatConfigurationHandler: NSObject { // // ReadMoreTitleConfiguration : AutoCompleteConfiguration // config.readMoreViewConfig.title.isEnabled = false // config.readMoreViewConfig.title.text = "hey" -// config.readMoreViewConfig.title.font = customFont.font -// config.readMoreViewConfig.title.textColor = UIColor.green -// config.readMoreViewConfig.title.backgroundColor = UIColor.purple + config.readMoreViewConfig.title.font = customFont.font + config.readMoreViewConfig.title.textColor = UIColor.green + config.readMoreViewConfig.title.backgroundColor = UIColor.purple // // // ChatBarConfiguration // config.chatBarConfiguration.image = UIImage(named: "bold")! diff --git a/BasicSample/Podfile b/BasicSample/Podfile index 25b16f1..331d330 100755 --- a/BasicSample/Podfile +++ b/BasicSample/Podfile @@ -4,7 +4,7 @@ # All rights reserved. #=================================================================================================== -platform :ios, "9.0" +platform :ios, "10.0" use_frameworks! install! 'cocoapods', From c7519fc82b188d0999f9bfc53a1cec01cb7c613e Mon Sep 17 00:00:00 2001 From: Omer Rahmany Date: Mon, 9 Nov 2020 17:03:22 +0200 Subject: [PATCH 07/10] [BLD-41686] Adding BoldForm implementation example --- .../BasicSample.xcodeproj/project.pbxproj | 70 ++++++++++++++++- .../BoldFormViewController.swift | 57 ++++++++++++++ .../BotDemoViewController.swift | 16 ++++ .../HandOver/Base.lproj/Main.storyboard | 78 +++++++++++++++---- 4 files changed, 203 insertions(+), 18 deletions(-) create mode 100644 BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift diff --git a/BasicSample/BasicSample.xcodeproj/project.pbxproj b/BasicSample/BasicSample.xcodeproj/project.pbxproj index a6704c6..0f1d3c5 100644 --- a/BasicSample/BasicSample.xcodeproj/project.pbxproj +++ b/BasicSample/BasicSample.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 117F9628027092819701291C /* Pods_BasicSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86E2E9C5B0AFCDBBF1BC6751 /* Pods_BasicSample.framework */; }; 483EA67C2369CA7100B9BBE1 /* HandOverHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 483EA67B2369CA7000B9BBE1 /* HandOverHandler.swift */; }; 4848892022EEF871000CF01E /* EmbedDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4848891F22EEF871000CF01E /* EmbedDemoViewController.swift */; }; 484F087023D5AFE30013046C /* LiveAccountViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 484F086F23D5AFE30013046C /* LiveAccountViewController.swift */; }; @@ -49,11 +50,13 @@ AF91186C238D1583007F5D3A /* CustomFileUploadDemoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF91186B238D1583007F5D3A /* CustomFileUploadDemoVC.swift */; }; AF911888239000DB007F5D3A /* FileUploadDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF911887239000DB007F5D3A /* FileUploadDemoViewController.swift */; }; AFF9BCAB22E86CC60078DD8A /* AvailibilityViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFF9BCAA22E86CC60078DD8A /* AvailibilityViewController.swift */; }; + EC4BF4DF2554602F00AF438D /* BoldFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC4BF4DE2554602F00AF438D /* BoldFormViewController.swift */; }; ECDE8DF924EC749F00BC3152 /* ChatConfigurationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECDE8DF824EC749E00BC3152 /* ChatConfigurationHandler.swift */; }; ECE12751231BB34700A362C7 /* ContinuityDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECE12750231BB34700A362C7 /* ContinuityDemoViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 460F34D57B754A571CF96822 /* Pods-BasicSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.release.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.release.xcconfig"; sourceTree = ""; }; 483EA67B2369CA7000B9BBE1 /* HandOverHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HandOverHandler.swift; sourceTree = ""; }; 4848891F22EEF871000CF01E /* EmbedDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmbedDemoViewController.swift; sourceTree = ""; }; 484F086F23D5AFE30013046C /* LiveAccountViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveAccountViewController.swift; sourceTree = ""; }; @@ -89,6 +92,7 @@ 48A5A19922761DCB0073F57B /* MainTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTableViewController.swift; sourceTree = ""; }; 48A5A19B227635FD0073F57B /* DemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoTableViewCell.swift; sourceTree = ""; }; 48F6DBA1230C4220008EA1A0 /* AutoCompleteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoCompleteViewController.swift; sourceTree = ""; }; + 86E2E9C5B0AFCDBBF1BC6751 /* Pods_BasicSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BasicSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AF12C89F21D22C90007450EF /* BasicSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BasicSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; AF12C8A221D22C90007450EF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; AF12C8A721D22C90007450EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -99,6 +103,8 @@ AF91186B238D1583007F5D3A /* CustomFileUploadDemoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomFileUploadDemoVC.swift; sourceTree = ""; }; AF911887239000DB007F5D3A /* FileUploadDemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileUploadDemoViewController.swift; sourceTree = ""; }; AFF9BCAA22E86CC60078DD8A /* AvailibilityViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvailibilityViewController.swift; sourceTree = ""; }; + C10093AD161A26F8875E4BC3 /* Pods-BasicSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicSample.debug.xcconfig"; path = "Target Support Files/Pods-BasicSample/Pods-BasicSample.debug.xcconfig"; sourceTree = ""; }; + EC4BF4DE2554602F00AF438D /* BoldFormViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoldFormViewController.swift; sourceTree = ""; }; ECDE8DF824EC749E00BC3152 /* ChatConfigurationHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatConfigurationHandler.swift; sourceTree = ""; }; ECE12750231BB34700A362C7 /* ContinuityDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinuityDemoViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -108,12 +114,21 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 117F9628027092819701291C /* Pods_BasicSample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2FA818ECA61C16220CBC0169 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 86E2E9C5B0AFCDBBF1BC6751 /* Pods_BasicSample.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 483EA67A2369CA5000B9BBE1 /* HandOver */ = { isa = PBXGroup; children = ( @@ -164,6 +179,7 @@ 48F6DBA1230C4220008EA1A0 /* AutoCompleteViewController.swift */, AFF9BCAA22E86CC60078DD8A /* AvailibilityViewController.swift */, ECE12750231BB34700A362C7 /* ContinuityDemoViewController.swift */, + EC4BF4DE2554602F00AF438D /* BoldFormViewController.swift */, ); path = ChatViewControllers; sourceTree = ""; @@ -189,6 +205,7 @@ AF12C8A121D22C90007450EF /* BasicSample */, AF12C8A021D22C90007450EF /* Products */, B7C6AE904CE1881071FF9D83 /* Pods */, + 2FA818ECA61C16220CBC0169 /* Frameworks */, ); sourceTree = ""; }; @@ -235,6 +252,8 @@ B7C6AE904CE1881071FF9D83 /* Pods */ = { isa = PBXGroup; children = ( + C10093AD161A26F8875E4BC3 /* Pods-BasicSample.debug.xcconfig */, + 460F34D57B754A571CF96822 /* Pods-BasicSample.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -246,9 +265,11 @@ isa = PBXNativeTarget; buildConfigurationList = AF12C8B121D22C91007450EF /* Build configuration list for PBXNativeTarget "BasicSample" */; buildPhases = ( + ECB204F3E623BF23101324C5 /* [CP] Check Pods Manifest.lock */, AF12C89B21D22C90007450EF /* Sources */, AF12C89C21D22C90007450EF /* Frameworks */, AF12C89D21D22C90007450EF /* Resources */, + BBCD852A61BA3C7CED430E91 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -266,7 +287,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0940; - LastUpgradeCheck = 1150; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = bold360ai; TargetAttributes = { AF12C89E21D22C90007450EF = { @@ -318,6 +339,48 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + BBCD852A61BA3C7CED430E91 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicSample/Pods-BasicSample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + ECB204F3E623BF23101324C5 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-BasicSample-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ AF12C89B21D22C90007450EF /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -328,6 +391,7 @@ 48996152227741B300D86590 /* RestoreChat.swift in Sources */, 48A5A19C227635FD0073F57B /* DemoTableViewCell.swift in Sources */, 48A5A19A22761DCB0073F57B /* MainTableViewController.swift in Sources */, + EC4BF4DF2554602F00AF438D /* BoldFormViewController.swift in Sources */, 486C0B2723D4624700544AAE /* SwitchTableViewCell.swift in Sources */, 486C0B2423D4624700544AAE /* InputTableViewCell.swift in Sources */, 486C0B3823D46C9100544AAE /* OptionButton.swift in Sources */, @@ -407,6 +471,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -467,6 +532,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -497,6 +563,7 @@ }; AF12C8B221D22C91007450EF /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C10093AD161A26F8875E4BC3 /* Pods-BasicSample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; @@ -516,6 +583,7 @@ }; AF12C8B321D22C91007450EF /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 460F34D57B754A571CF96822 /* Pods-BasicSample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; diff --git a/BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift b/BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift new file mode 100644 index 0000000..29f65e5 --- /dev/null +++ b/BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift @@ -0,0 +1,57 @@ +// =================================================================================================== +// Copyright © 2020 bold360ai(LogMeIn). +// Bold360AI SDK. +// All rights reserved. +// =================================================================================================== + + +import UIKit +import Bold360AI + +class BoldFormViewController: UIViewController { + var chatController: ChatController! + var formInfo: BrandedForm! + var formDelegate: BoldFormDelegate! + + @IBOutlet weak var formTitle: UITextField! + + override func viewDidLoad() { + super.viewDidLoad() + + if let formField = self.formInfo.form.formFields[0] as? BCFormField{ + self.formTitle.text = formField.label + } + } + + @IBAction func submitTapped(_ sender: Any) { + (self.formInfo.form.formFields[0] as? BCFormField)?.label = self.formTitle.text + self.delegate.submitForm(self.form) + } + + override func viewDidDisappear(_ animated: Bool) { + self.delegate.submitForm(nil) + super.viewDidDisappear(animated); + } +} + + + +extension BoldFormViewController: BoldForm { + var form: BrandedForm! { + get { + return formInfo + } + set(form) { + formInfo = form + } + } + + var delegate: BoldFormDelegate! { + get { + return formDelegate + } + set(delegate) { + formDelegate = delegate + } + } +} diff --git a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift index 3528332..7029ace 100644 --- a/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift +++ b/BasicSample/BasicSample/ChatViewControllers/BotDemoViewController.swift @@ -57,6 +57,22 @@ extension BotDemoViewController: ChatControllerDelegate { } } + + func shouldPresent(_ form: BrandedForm!, handler completionHandler: (((UIViewController & BoldForm)?) -> Void)!) { + if (completionHandler != nil) { + DispatchQueue.main.async { + if form.form?.type == BCFormTypePostChat { + let mainStoryboard = UIStoryboard(name: "Main", bundle: nil) + let postVC = mainStoryboard.instantiateViewController(withIdentifier: "boldForm") as! BoldFormViewController + postVC.form = form + completionHandler(postVC) + } else { + completionHandler(nil) + } + } + } + } + func didFailWithError(_ error: BLDError!) { var errorMsg = String() switch error.type { diff --git a/BasicSample/BasicSample/HandOver/Base.lproj/Main.storyboard b/BasicSample/BasicSample/HandOver/Base.lproj/Main.storyboard index c423987..70b6f6e 100644 --- a/BasicSample/BasicSample/HandOver/Base.lproj/Main.storyboard +++ b/BasicSample/BasicSample/HandOver/Base.lproj/Main.storyboard @@ -1,10 +1,11 @@ - + - + + @@ -42,13 +43,13 @@ + - @@ -97,6 +98,7 @@ + @@ -106,7 +108,6 @@ - @@ -123,8 +124,8 @@ - + @@ -138,8 +139,8 @@ - + @@ -177,6 +178,7 @@ + @@ -187,7 +189,6 @@ - @@ -209,15 +210,15 @@ - + + + + + + + + + + + + @@ -313,7 +348,7 @@ - + @@ -333,12 +368,12 @@ - + - - + + @@ -354,7 +390,6 @@ - @@ -367,5 +402,14 @@ + + + + + + + + + From 8e47fe38c117727ff633e10ae6aa3a144e2f8117 Mon Sep 17 00:00:00 2001 From: Omer Rahmany Date: Tue, 10 Nov 2020 12:03:26 +0200 Subject: [PATCH 08/10] [BLD-41686] Fixed customFont compilation error --- .../ChatViewControllers/ChatConfigurationHandler.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift index 03c70b1..8d4137f 100644 --- a/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift +++ b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift @@ -14,10 +14,7 @@ class ChatConfigurationHandler: NSObject { private var customFont:CustomFont override init() { - customFont = CustomFont() - customFont.font = UIFont.systemFont(ofSize: 12) - // TODO:: understand how to set fontFileName - // customFont.fontFileName = "" } + customFont = CustomFont(font: .systemFont(ofSize: 12)) } var defaultConfig: Bold360AI.ChatConfiguration { @@ -179,7 +176,7 @@ class ChatConfigurationHandler: NSObject { // // ReadMoreTitleConfiguration : AutoCompleteConfiguration // config.readMoreViewConfig.title.isEnabled = false // config.readMoreViewConfig.title.text = "hey" - config.readMoreViewConfig.title.font = customFont.font + config.readMoreViewConfig.title.font = UIFont.systemFont(ofSize: 20) config.readMoreViewConfig.title.textColor = UIColor.green config.readMoreViewConfig.title.backgroundColor = UIColor.purple // From 514919d45f32480cbf8fe313c581b01d01802119 Mon Sep 17 00:00:00 2001 From: Omer Rahmany Date: Wed, 11 Nov 2020 12:08:38 +0200 Subject: [PATCH 09/10] [BLD-41686] Using first instead of [0] on NSArray to avoid crashes --- .../ChatViewControllers/BoldFormViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift b/BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift index 29f65e5..1175f12 100644 --- a/BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift +++ b/BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift @@ -18,13 +18,13 @@ class BoldFormViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - if let formField = self.formInfo.form.formFields[0] as? BCFormField{ + if let formField = self.formInfo.form.formFields.first as? BCFormField{ self.formTitle.text = formField.label } } @IBAction func submitTapped(_ sender: Any) { - (self.formInfo.form.formFields[0] as? BCFormField)?.label = self.formTitle.text + (self.formInfo.form.formFields.first as? BCFormField)?.label = self.formTitle.text self.delegate.submitForm(self.form) } From 333f042ab317d62bcc8bc432ff509d77af1a24a3 Mon Sep 17 00:00:00 2001 From: Omer Rahmany Date: Wed, 11 Nov 2020 16:40:43 +0200 Subject: [PATCH 10/10] [BLD-41686] Updated to CustomFont initialization --- .../ChatViewControllers/ChatConfigurationHandler.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift index 8d4137f..140e930 100644 --- a/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift +++ b/BasicSample/BasicSample/ChatViewControllers/ChatConfigurationHandler.swift @@ -14,7 +14,7 @@ class ChatConfigurationHandler: NSObject { private var customFont:CustomFont override init() { - customFont = CustomFont(font: .systemFont(ofSize: 12)) + customFont = CustomFont() } var defaultConfig: Bold360AI.ChatConfiguration { @@ -176,7 +176,7 @@ class ChatConfigurationHandler: NSObject { // // ReadMoreTitleConfiguration : AutoCompleteConfiguration // config.readMoreViewConfig.title.isEnabled = false // config.readMoreViewConfig.title.text = "hey" - config.readMoreViewConfig.title.font = UIFont.systemFont(ofSize: 20) + config.readMoreViewConfig.title.customFont = customFont config.readMoreViewConfig.title.textColor = UIColor.green config.readMoreViewConfig.title.backgroundColor = UIColor.purple //