diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..330d167
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,90 @@
+# Xcode
+#
+# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
+
+## User settings
+xcuserdata/
+
+## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
+*.xcscmblueprint
+*.xccheckout
+
+## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
+build/
+DerivedData/
+*.moved-aside
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+
+## Obj-C/Swift specific
+*.hmap
+
+## App packaging
+*.ipa
+*.dSYM.zip
+*.dSYM
+
+## Playgrounds
+timeline.xctimeline
+playground.xcworkspace
+
+# Swift Package Manager
+#
+# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
+# Packages/
+# Package.pins
+# Package.resolved
+# *.xcodeproj
+#
+# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
+# hence it is not needed unless you have added a package configuration file to your project
+# .swiftpm
+
+.build/
+
+# CocoaPods
+#
+# We recommend against adding the Pods directory to your .gitignore. However
+# you should judge for yourself, the pros and cons are mentioned at:
+# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
+#
+# Pods/
+#
+# Add this line if you want to avoid checking in source code from the Xcode workspace
+# *.xcworkspace
+
+# Carthage
+#
+# Add this line if you want to avoid checking in source code from Carthage dependencies.
+# Carthage/Checkouts
+
+Carthage/Build/
+
+# Accio dependency management
+Dependencies/
+.accio/
+
+# fastlane
+#
+# It is recommended to not store the screenshots in the git repo.
+# Instead, use fastlane to re-generate the screenshots whenever they are needed.
+# For more information about the recommended setup visit:
+# https://docs.fastlane.tools/best-practices/source-control/#source-control
+
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots/**/*.png
+fastlane/test_output
+
+# Code Injection
+#
+# After new code Injection tools there's a generated folder /iOSInjectionProject
+# https://github.com/johnno1962/injectionforxcode
+
+iOSInjectionProject/
diff --git a/LiveTex SDK.xcodeproj/project.pbxproj b/LiveTex SDK.xcodeproj/project.pbxproj
index 92c8efa..e81e8df 100644
--- a/LiveTex SDK.xcodeproj/project.pbxproj
+++ b/LiveTex SDK.xcodeproj/project.pbxproj
@@ -195,7 +195,7 @@
55F73AFA1A0A6EB800C28B0A = {
CreatedOnToolsVersion = 6.1;
DevelopmentTeam = FJE97HEJ7P;
- LastSwiftMigration = 0800;
+ LastSwiftMigration = 1030;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.Push = {
@@ -210,8 +210,10 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
+ English,
en,
Base,
+ ru,
);
mainGroup = 55F73AF21A0A6EB800C28B0A;
productRefGroup = 55F73AFC1A0A6EB800C28B0A /* Products */;
@@ -423,14 +425,14 @@
baseConfigurationReference = B30BC51FD66065288E264F80 /* Pods-LiveTex SDK.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "LaunchImage-2";
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODE_SIGN_ENTITLEMENTS = "LiveTex SDK.entitlements";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = FJE97HEJ7P;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -452,7 +454,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = LiveTex_SDK_Demo/LTObjcBridging.h;
"SWIFT_OBJC_BRIDGING_HEADER[arch=*]" = LiveTex_SDK_Demo/LTObjcBridging.h;
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
@@ -462,12 +464,12 @@
baseConfigurationReference = 7B9DE94EDD12C7070F2552CC /* Pods-LiveTex SDK.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "LaunchImage-2";
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODE_SIGN_ENTITLEMENTS = "LiveTex SDK.entitlements";
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = FJE97HEJ7P;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -488,7 +490,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = LiveTex_SDK_Demo/LTObjcBridging.h;
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
@@ -539,12 +541,12 @@
baseConfigurationReference = FCFDD0332147618047AEEF8B /* Pods-LiveTex SDK.distribution.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "LaunchImage-2";
+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODE_SIGN_ENTITLEMENTS = "LiveTex SDK.entitlements";
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = FJE97HEJ7P;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -564,7 +566,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = LiveTex_SDK_Demo/LTObjcBridging.h;
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Distribution;
diff --git a/LiveTex SDK.xcodeproj/project.xcworkspace/xcuserdata/emil.a.xcuserdatad/UserInterfaceState.xcuserstate b/LiveTex SDK.xcodeproj/project.xcworkspace/xcuserdata/emil.a.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index 309b3a0..0000000
Binary files a/LiveTex SDK.xcodeproj/project.xcworkspace/xcuserdata/emil.a.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git a/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
deleted file mode 100644
index 0a90b51..0000000
--- a/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcschemes/LiveTex SDK.xcscheme b/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcschemes/LiveTex SDK.xcscheme
deleted file mode 100644
index af11679..0000000
--- a/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcschemes/LiveTex SDK.xcscheme
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcschemes/xcschememanagement.plist b/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcschemes/xcschememanagement.plist
deleted file mode 100644
index bb83d8c..0000000
--- a/LiveTex SDK.xcodeproj/xcuserdata/emil.a.xcuserdatad/xcschemes/xcschememanagement.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- SchemeUserState
-
- LiveTex SDK.xcscheme
-
- orderHint
- 0
-
-
- SuppressBuildableAutocreation
-
- 55F73AFA1A0A6EB800C28B0A
-
- primary
-
-
-
-
-
diff --git a/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
deleted file mode 100644
index fe2b454..0000000
--- a/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcschemes/LiveTex_SDK_Demo.xcscheme b/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcschemes/LiveTex_SDK_Demo.xcscheme
deleted file mode 100644
index 69505a4..0000000
--- a/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcschemes/LiveTex_SDK_Demo.xcscheme
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcschemes/xcschememanagement.plist b/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcschemes/xcschememanagement.plist
deleted file mode 100644
index 6feb933..0000000
--- a/LiveTex SDK.xcodeproj/xcuserdata/mackudos.xcuserdatad/xcschemes/xcschememanagement.plist
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
- SchemeUserState
-
- LiveTex_SDK_Demo.xcscheme
-
- orderHint
- 0
-
-
- SuppressBuildableAutocreation
-
- 55F73AFA1A0A6EB800C28B0A
-
- primary
-
-
- 55F73B121A0A6EB900C28B0A
-
- primary
-
-
-
-
-
diff --git a/LiveTex SDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/LiveTex SDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/LiveTex SDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/LiveTex SDK.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/LiveTex SDK.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/LiveTex SDK.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/LiveTex SDK.xcworkspace/xcuserdata/emil.a.xcuserdatad/UserInterfaceState.xcuserstate b/LiveTex SDK.xcworkspace/xcuserdata/emil.a.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index 3229b29..0000000
Binary files a/LiveTex SDK.xcworkspace/xcuserdata/emil.a.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git a/LiveTex SDK.xcworkspace/xcuserdata/emil.a.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/LiveTex SDK.xcworkspace/xcuserdata/emil.a.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
deleted file mode 100644
index ed9a9b4..0000000
--- a/LiveTex SDK.xcworkspace/xcuserdata/emil.a.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/LiveTex_SDK_Demo/AppDelegate.swift b/LiveTex_SDK_Demo/AppDelegate.swift
index aae62d3..3a0ea27 100644
--- a/LiveTex_SDK_Demo/AppDelegate.swift
+++ b/LiveTex_SDK_Demo/AppDelegate.swift
@@ -18,7 +18,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var internetReachability: Reachability!
var reachabilityAlert: UIAlertController?
- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
NotificationCenter.default.addObserver(self, selector: #selector(AppDelegate.reachabilityChanged(_:)), name: NSNotification.Name.reachabilityChanged, object: nil)
internetReachability = Reachability.forInternetConnection()
internetReachability.startNotifier();
@@ -50,7 +50,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
NotificationCenter.default.post(name: Notification.Name(rawValue: kApplicationDidRegisterWithDeviceToken), object: nil)
}
- func reachabilityChanged(_ note:Notification) {
+ @objc func reachabilityChanged(_ note:Notification) {
let curReach: Reachability = note.object as! Reachability
processReachability(curReach)
}
@@ -61,8 +61,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func processReachability(_ curReach: Reachability) {
let status:NetworkStatus = curReach.currentReachabilityStatus()
if status == NetworkStatus.NotReachable {
- reachabilityAlert = UIAlertController(title: "", message: "Интернет соединение потеряно, дождитесь когда система восстановит соединение", preferredStyle: UIAlertControllerStyle.alert)
- let cancelAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.cancel, handler: nil)
+ reachabilityAlert = UIAlertController(title: "", message: "Интернет соединение потеряно, дождитесь когда система восстановит соединение", preferredStyle: UIAlertController.Style.alert)
+ let cancelAction = UIAlertAction(title: "OK", style: UIAlertAction.Style.cancel, handler: nil)
reachabilityAlert!.addAction(cancelAction)
self.window?.rootViewController?.present(reachabilityAlert!, animated: true, completion: nil)
} else {
diff --git a/LiveTex_SDK_Demo/AuthorizationViewController.swift b/LiveTex_SDK_Demo/AuthorizationViewController.swift
index 4f603fc..85bbd3a 100644
--- a/LiveTex_SDK_Demo/AuthorizationViewController.swift
+++ b/LiveTex_SDK_Demo/AuthorizationViewController.swift
@@ -34,7 +34,7 @@ class AuthorizationViewController: UIViewController {
super.didReceiveMemoryWarning()
}
- func applicationDidRegisterWithDeviceToken() {
+ @objc func applicationDidRegisterWithDeviceToken() {
onlineModeButton.isEnabled = true
startService()
@@ -56,7 +56,7 @@ class AuthorizationViewController: UIViewController {
delegateQueue: OperationQueue.main)
LivetexCoreManager.defaultManager.coreService.start { (token: String?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
self.onlineModeButton.isEnabled = false
} else {
diff --git a/LiveTex_SDK_Demo/ChatViewController.swift b/LiveTex_SDK_Demo/ChatViewController.swift
index ee38d5d..2094f8b 100644
--- a/LiveTex_SDK_Demo/ChatViewController.swift
+++ b/LiveTex_SDK_Demo/ChatViewController.swift
@@ -39,7 +39,7 @@ class ChatViewController: JSQMessagesViewController,
func receiveData() {
/* Запрашиваем текущее состояние диалога */
LivetexCoreManager.defaultManager.coreService.state (completionHandler: { (state: LCDialogState?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
} else {
self.update(state!)
@@ -48,7 +48,7 @@ class ChatViewController: JSQMessagesViewController,
/* Запрашиваем историю переписки */
LivetexCoreManager.defaultManager.coreService.messageHistory(20, offset: 0, completionHandler: { (messageList: [LCMessage]?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
return
}
@@ -57,7 +57,7 @@ class ChatViewController: JSQMessagesViewController,
toConfirmList?.forEach({ (message: LCMessage) in
/* Отправляем подтверждение о получении сообщения */
LivetexCoreManager.defaultManager.coreService.confirmMessage(withID: message.messageId, completionHandler: { (success: Bool, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
} else {
message.confirm = true
@@ -74,14 +74,14 @@ class ChatViewController: JSQMessagesViewController,
if !response.destinationIsSet {
/* Получаем список назначений */
LivetexCoreManager.defaultManager.coreService.destinations(completionHandler: { (destinations: [LCDestination]?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
return
}
/* Указываем адресат обращения */
LivetexCoreManager.defaultManager.coreService.setDestination(destinations!.first!, attributes: LCDialogAttributes(visible: [:], hidden: [:]), options: [], completionHandler: { (success: Bool, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
}
})
@@ -103,7 +103,7 @@ class ChatViewController: JSQMessagesViewController,
let media = JSQPhotoMediaItem(maskAsOutgoing: !message.attributes.file.senderIsSet)
let url = Foundation.URL(string: message.attributes.file.url.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed)!)!
URLSession.shared.dataTask(with: url, completionHandler: { (data: Data?, response: URLResponse?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
} else {
DispatchQueue.main.async {
@@ -123,12 +123,15 @@ class ChatViewController: JSQMessagesViewController,
// MARK: - UIImagePickerController
- func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
- let image = info[UIImagePickerControllerEditedImage] as! UIImage
- let imageData = UIImagePNGRepresentation(image)
+ func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
+// Local variable inserted by Swift 4.2 migrator.
+let info = convertFromUIImagePickerControllerInfoKeyDictionary(info)
+
+ let image = info[convertFromUIImagePickerControllerInfoKey(UIImagePickerController.InfoKey.editedImage)] as! UIImage
+ let imageData = image.pngData()
/* Отправляем файловое сообщение */
LivetexCoreManager.defaultManager.coreService.sendFileMessage(imageData!) { (response: LCSendMessageResponse?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
} else {
/* Переназначаем адресат обращения в случае необходимости */
@@ -159,7 +162,7 @@ class ChatViewController: JSQMessagesViewController,
func receiveTextMessage(_ message: LCMessage) {
/* Отправляем подтверждение о получении сообщения */
LivetexCoreManager.defaultManager.coreService.confirmMessage(withID: message.messageId) { (success: Bool, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
}
}
@@ -176,7 +179,7 @@ class ChatViewController: JSQMessagesViewController,
func selectDestination(_ destinations: [LCDestination]) {
/* Указываем адресат обращения */
LivetexCoreManager.defaultManager.coreService.setDestination(destinations.first!, attributes: LCDialogAttributes(visible: [:], hidden: [:]), options: [], completionHandler: { (success: Bool, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
}
})
@@ -186,7 +189,7 @@ class ChatViewController: JSQMessagesViewController,
override func didPressSend(_ button: UIButton, withMessageText text: String, senderId: String, senderDisplayName: String, date: Date) {
/* Отправляем текстовое сообщение */
LivetexCoreManager.defaultManager.coreService.sendTextMessage(text) { (response: LCSendMessageResponse?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
} else {
/* Переназначаем адресат обращения в случае необходимости */
@@ -202,7 +205,7 @@ class ChatViewController: JSQMessagesViewController,
self.inputToolbar.contentView!.textView!.resignFirstResponder()
let imagePickerController: UIImagePickerController = UIImagePickerController()
imagePickerController.delegate = self
- imagePickerController.sourceType = UIImagePickerControllerSourceType.savedPhotosAlbum
+ imagePickerController.sourceType = UIImagePickerController.SourceType.savedPhotosAlbum
imagePickerController.allowsEditing = true
self.present(imagePickerController, animated: true, completion: nil)
}
@@ -248,7 +251,7 @@ class ChatViewController: JSQMessagesViewController,
}
cell.textView.textColor = tintColor
- cell.textView.linkTextAttributes = [NSForegroundColorAttributeName: tintColor]
+ cell.textView.linkTextAttributes = convertToOptionalNSAttributedStringKeyDictionary([NSAttributedString.Key.foregroundColor.rawValue: tintColor])
}
return cell
@@ -287,3 +290,19 @@ class ChatViewController: JSQMessagesViewController,
return kJSQMessagesCollectionViewCellLabelHeightDefault;
}
}
+
+// Helper function inserted by Swift 4.2 migrator.
+fileprivate func convertFromUIImagePickerControllerInfoKeyDictionary(_ input: [UIImagePickerController.InfoKey: Any]) -> [String: Any] {
+ return Dictionary(uniqueKeysWithValues: input.map {key, value in (key.rawValue, value)})
+}
+
+// Helper function inserted by Swift 4.2 migrator.
+fileprivate func convertFromUIImagePickerControllerInfoKey(_ input: UIImagePickerController.InfoKey) -> String {
+ return input.rawValue
+}
+
+// Helper function inserted by Swift 4.2 migrator.
+fileprivate func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? {
+ guard let input = input else { return nil }
+ return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)})
+}
diff --git a/LiveTex_SDK_Demo/ConversationViewController.swift b/LiveTex_SDK_Demo/ConversationViewController.swift
index e049c0c..14038af 100644
--- a/LiveTex_SDK_Demo/ConversationViewController.swift
+++ b/LiveTex_SDK_Demo/ConversationViewController.swift
@@ -19,14 +19,14 @@ class ConversationViewController: UIViewController, UITextFieldDelegate {
super.viewDidLoad()
let paddleView:UIView = UIView(frame: CGRect(x:0, y:0, width:16, height:20))
self.nameField.leftView = paddleView
- self.nameField.leftViewMode = UITextFieldViewMode.always
+ self.nameField.leftViewMode = UITextField.ViewMode.always
self.navigationController?.isNavigationBarHidden = false
}
override func viewWillAppear(_ animated: Bool) {
/* Получаем список назначений */
LivetexCoreManager.defaultManager.coreService.destinations { (destinations: [LCDestination]?, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
return
}
@@ -43,7 +43,7 @@ class ConversationViewController: UIViewController, UITextFieldDelegate {
/* Указываем адресата обращения и дополнительно к пользовательским атрибутам укажем, чтобы передавались тип устройства и тип соединения */
LivetexCoreManager.defaultManager.coreService.setDestination(result.first!, attributes: attributes, options: [.deviceModel, .connectionType], completionHandler: { (success: Bool, error: Error?) in
- if let error = error as? NSError {
+ if let error = error as NSError? {
print(error)
}
})
@@ -62,8 +62,8 @@ class ConversationViewController: UIViewController, UITextFieldDelegate {
}
if !errorMessage.isEmpty {
- let alert: UIAlertController = UIAlertController(title: "Ошибка", message: errorMessage, preferredStyle: UIAlertControllerStyle.alert)
- let cancelAction: UIAlertAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.cancel, handler: nil)
+ let alert: UIAlertController = UIAlertController(title: "Ошибка", message: errorMessage, preferredStyle: UIAlertController.Style.alert)
+ let cancelAction: UIAlertAction = UIAlertAction(title: "OK", style: UIAlertAction.Style.cancel, handler: nil)
alert.addAction(cancelAction)
self.present(alert, animated: true, completion: nil)
diff --git a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x-1.png b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x-1.png
deleted file mode 100644
index a3fcdb7..0000000
Binary files a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x-1.png and /dev/null differ
diff --git a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon29x29@3x.png b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon29x29@3x.png
new file mode 100644
index 0000000..f80570f
Binary files /dev/null and b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon29x29@3x.png differ
diff --git a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x-1.png b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x-1.png
deleted file mode 100644
index 840be11..0000000
Binary files a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x-1.png and /dev/null differ
diff --git a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon40x40@3x.png b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon40x40@3x.png
new file mode 100644
index 0000000..4fc1c24
Binary files /dev/null and b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/AppIcon40x40@3x.png differ
diff --git a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/Contents.json b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/Contents.json
index 5adff15..7f4a31b 100644
--- a/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/Contents.json
+++ b/LiveTex_SDK_Demo/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -1,5 +1,15 @@
{
"images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "3x"
+ },
{
"size" : "29x29",
"idiom" : "iphone",
@@ -9,7 +19,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
- "filename" : "AppIcon29x29@2x-1.png",
+ "filename" : "AppIcon29x29@3x.png",
"scale" : "3x"
},
{
@@ -21,7 +31,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
- "filename" : "AppIcon40x40@2x-1.png",
+ "filename" : "AppIcon40x40@3x.png",
"scale" : "3x"
},
{
@@ -35,6 +45,11 @@
"idiom" : "iphone",
"filename" : "AppIcon60x60@3x.png",
"scale" : "3x"
+ },
+ {
+ "idiom" : "ios-marketing",
+ "size" : "1024x1024",
+ "scale" : "1x"
}
],
"info" : {
diff --git a/LiveTex_SDK_Demo/Images.xcassets/LaunchImage-2.launchimage/Contents.json b/LiveTex_SDK_Demo/Images.xcassets/LaunchImage-2.launchimage/Contents.json
deleted file mode 100644
index e37b649..0000000
--- a/LiveTex_SDK_Demo/Images.xcassets/LaunchImage-2.launchimage/Contents.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "images" : [
- {
- "orientation" : "portrait",
- "idiom" : "iphone",
- "minimum-system-version" : "7.0",
- "scale" : "2x"
- },
- {
- "orientation" : "portrait",
- "idiom" : "iphone",
- "minimum-system-version" : "7.0",
- "subtype" : "retina4",
- "scale" : "2x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/LiveTex_SDK_Demo/Main.storyboard b/LiveTex_SDK_Demo/Main.storyboard
index 9bd68e9..57c24e3 100644
--- a/LiveTex_SDK_Demo/Main.storyboard
+++ b/LiveTex_SDK_Demo/Main.storyboard
@@ -1,9 +1,9 @@
-
-
+
+
+
-
-
+
@@ -12,7 +12,7 @@
-
+
@@ -32,10 +32,11 @@
-
+
-
+
+
+
+
-
@@ -148,28 +155,28 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -255,13 +286,14 @@
-
+
-
+
+
@@ -278,13 +310,14 @@
-
+
-
+
+
@@ -301,13 +334,14 @@
-
+
-
+
+
diff --git a/LiveTex_SDK_Demo/SettingsViewController.swift b/LiveTex_SDK_Demo/SettingsViewController.swift
index 2e7b5fc..6eb8201 100644
--- a/LiveTex_SDK_Demo/SettingsViewController.swift
+++ b/LiveTex_SDK_Demo/SettingsViewController.swift
@@ -30,23 +30,29 @@ class SettingsViewController: UITableViewController, UITextFieldDelegate {
tableView.deselectRow(at: indexPath, animated: true)
if indexPath.section == 0 {
let cell = tableView.cellForRow(at: indexPath)
- if cell?.accessoryType == UITableViewCellAccessoryType.checkmark {
+ if cell?.accessoryType == UITableViewCell.AccessoryType.checkmark {
return
} else {
if indexPathForSelectedRow != nil {
let selectedCell = tableView.cellForRow(at: indexPathForSelectedRow!)
- selectedCell?.accessoryType = UITableViewCellAccessoryType.none
+ selectedCell?.accessoryType = UITableViewCell.AccessoryType.none
}
- cell?.accessoryType = UITableViewCellAccessoryType.checkmark
+ cell?.accessoryType = UITableViewCell.AccessoryType.checkmark
urlField.text = cell?.detailTextLabel?.text
- keyField.text = "demo"
+ keyField.text = "demo-prod"
if indexPath.section == 0 {
switch indexPath.row {
case 0,
1:
siteField.text = "123280"
- case 2,
- 3:
+ case 2:
+ siteField.text = "10023868"
+ case 3:
+ keyField.text = "sdkkey161872"
+ siteField.text = "123280"
+ case 4:
+ urlField.text = "http://192.168.4.141:4430"
+ keyField.text = "statistics-dev-demo-app"
siteField.text = "10023868"
default: