Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from bold360ai/BLD-41686
Bld 41686
- Loading branch information
Showing
9 changed files
with
427 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
BasicSample/BasicSample.xcodeproj/xcshareddata/xcschemes/BasicSample.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
BasicSample/BasicSample/Assets.xcassets/robot.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
BasicSample/BasicSample/ChatViewControllers/BoldFormViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.first as? BCFormField{ | ||
self.formTitle.text = formField.label | ||
} | ||
} | ||
|
||
@IBAction func submitTapped(_ sender: Any) { | ||
(self.formInfo.form.formFields.first 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 | ||
} | ||
} | ||
} |
Oops, something went wrong.