Commit c717eea6 authored by Bhavesh Sarwar's avatar Bhavesh Sarwar
Browse files

ApiAI integrated -- chat screen partial done

parent bef162b1
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:IBOT.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/ViewController.swift"
timestampString = "518441400.464255"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "17"
endingLineNumber = "17"
landmarkName = "viewDidLoad()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/TGChatViewController.swift"
timestampString = "518441813.832059"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "94"
endingLineNumber = "94"
landmarkName = "inputTextPanel(_:requestSendText:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/TGChatViewController.swift"
timestampString = "518441924.164986"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "112"
endingLineNumber = "112"
landmarkName = "inputTextPanel(_:requestSendText:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/TGChatViewController.swift"
timestampString = "518442075.209708"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "111"
endingLineNumber = "111"
landmarkName = "inputTextPanel(_:requestSendText:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/TGChatViewController.swift"
timestampString = "518442026.398338"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "123"
endingLineNumber = "123"
landmarkName = "inputTextPanel(_:requestSendText:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/TGChatViewController.swift"
timestampString = "518442176.607536"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "127"
endingLineNumber = "127"
landmarkName = "inputTextPanel(_:requestSendText:)"
landmarkType = "7">
<Locations>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "IBOT.TGChatViewController.inputTextPanel (IBOT.TGChatInputTextPanel, requestSendText : Swift.String) -&gt; ()"
moduleName = "IBOT"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/bhavesh/Documents/Swift%20Projects/IBOT/IBOT/IBOT/TGChatViewController.swift"
timestampString = "518442176.924503"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "134"
endingLineNumber = "134"
offsetFromSymbolStart = "2199">
</Location>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "IBOT.TGChatViewController.(inputTextPanel (IBOT.TGChatInputTextPanel, requestSendText : Swift.String) -&gt; ()).(closure #3)"
moduleName = "IBOT"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/bhavesh/Documents/Swift%20Projects/IBOT/IBOT/IBOT/TGChatViewController.swift"
timestampString = "518442176.92656"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "134"
endingLineNumber = "134"
offsetFromSymbolStart = "16">
</Location>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "IBOT.TGChatViewController.(inputTextPanel (IBOT.TGChatInputTextPanel, requestSendText : Swift.String) -&gt; ()).(closure #4)"
moduleName = "IBOT"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/bhavesh/Documents/Swift%20Projects/IBOT/IBOT/IBOT/TGChatViewController.swift"
timestampString = "518442176.929471"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "136"
endingLineNumber = "136"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/TGChatViewController.swift"
timestampString = "518443499.646371"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "137"
endingLineNumber = "137"
landmarkName = "inputTextPanel(_:requestSendText:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IBOT/TGChatViewController.swift"
timestampString = "518443499.646371"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "140"
endingLineNumber = "140"
landmarkName = "inputTextPanel(_:requestSendText:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -8,15 +8,68 @@
import UIKit
import CoreData
import SVProgressHUD
import AFNetworking
import ApiAI
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let apiai = ApiAI.shared()!
var window: UIWindow?
var isConnected : Bool?
var progressHUD : SVProgressHUD!
//MARK: HUD functions
open func hideHUD() {
if((progressHUD) != nil){
SVProgressHUD.dismiss()
progressHUD.removeFromSuperview()
}
}
open func showHUD() -> Void {
progressHUD = SVProgressHUD.init(frame:(window?.frame)!)
progressHUD.backgroundColor = UIColor.black
progressHUD.defaultStyle = .light
progressHUD.defaultAnimationType = .native
window?.addSubview(progressHUD)
SVProgressHUD.show()
}
// MARK: Connection check
func checkInternetConnection(_ status : AFNetworkReachabilityStatus) -> Void {
switch (status)
{
case .reachableViaWiFi , .reachableViaWWAN :
isConnected = true
break;
default :
isConnected = false
break;
}
}
func isConnectedToInternet() -> Bool {
isConnected = AFNetworkReachabilityManager.shared().isReachable
return isConnected!
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let configuration: AIConfiguration = AIDefaultConfiguration()
configuration.clientAccessToken = "33d0304796224e9c944db8f2bf1473b7"
apiai.configuration = configuration
return true
}
......
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
......@@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
......@@ -59,6 +79,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"scale" : "1x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 28,
"top" : 29,
"right" : 27,
"left" : 38
}
},
"idiom" : "iphone",
"filename" : "ModernBubbleIncomingFull@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"scale" : "3x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 14,
"top" : 14,
"right" : 14,
"left" : 20
}
},
"idiom" : "ipad",
"filename" : "ModernBubbleIncomingFullPad.png",
"scale" : "1x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 2
},
"cap-insets" : {
"bottom" : 26,
"top" : 29,
"right" : 28,
"left" : 40
}
},
"idiom" : "ipad",
"filename" : "ModernBubbleIncomingFullPad@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"scale" : "1x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 31,
"top" : 30,
"right" : 27,
"left" : 37
}
},
"idiom" : "iphone",
"filename" : "ModernBubbleIncomingFullHighlighted@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"scale" : "3x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 10,
"top" : 14,
"right" : 14,
"left" : 19
}
},
"idiom" : "ipad",
"filename" : "ModernBubbleIncomingFullHighlightedPad.png",
"scale" : "1x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 19,
"top" : 29,
"right" : 40,
"left" : 39
}
},
"idiom" : "ipad",
"filename" : "ModernBubbleIncomingFullHighlightedPad@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"scale" : "1x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 31,
"top" : 30,
"right" : 27,
"left" : 37
}
},
"idiom" : "iphone",
"filename" : "ModernBubbleIncomingPartial@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"scale" : "3x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 16,
"top" : 16,
"right" : 14,
"left" : 19
}
},
"idiom" : "ipad",
"filename" : "ModernBubbleIncomingPartialPad.png",
"scale" : "1x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 33,
"top" : 32,
"right" : 40,
"left" : 39
}
},
"idiom" : "ipad",
"filename" : "ModernBubbleIncomingPartialPad@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"scale" : "1x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 31,
"top" : 30,
"right" : 27,
"left" : 37
}
},
"idiom" : "iphone",