From 3328f2ce4f25ddabc45e4fbf2942565495d41c68 Mon Sep 17 00:00:00 2001 From: Nitesh_Technobrave Date: Fri, 12 Jun 2020 15:07:27 +0530 Subject: [PATCH 1/2] Swift 5.x and Xcode 11.x support --- Podfile.lock | 4 +- twiliochat.xcodeproj/project.pbxproj | 37 ++++++++++++++----- .../xcschemes/twiliochat.xcscheme | 24 +++++------- twiliochat/AlertDialogController.swift | 2 +- twiliochat/AppDelegate.swift | 2 +- twiliochat/DateTodayFormatter.swift | 4 +- twiliochat/InputDialogController.swift | 4 +- twiliochat/MainChatViewController.swift | 10 ++--- twiliochat/MenuViewController.swift | 4 +- twiliochat/TextFieldFormHandler.swift | 14 +++---- 10 files changed, 60 insertions(+), 45 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index d7fc845..ad66c5b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -11,7 +11,7 @@ DEPENDENCIES: - TwilioChatClient (~> 2.3) SPEC REPOS: - https://github.com/cocoapods/specs.git: + https://github.com/CocoaPods/Specs.git: - SlackTextViewController - SWRevealViewController - TwilioAccessManager @@ -25,4 +25,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e91581ba06073050ed2230e4abd93b6f8adc9d67 -COCOAPODS: 1.5.3 +COCOAPODS: 1.9.1 diff --git a/twiliochat.xcodeproj/project.pbxproj b/twiliochat.xcodeproj/project.pbxproj index fc93c5c..d91c027 100644 --- a/twiliochat.xcodeproj/project.pbxproj +++ b/twiliochat.xcodeproj/project.pbxproj @@ -314,7 +314,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 1150; ORGANIZATIONNAME = Twilio; TargetAttributes = { 59F208F91C04C06800CC2392 = { @@ -333,6 +333,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -377,7 +378,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/SWRevealViewController/SWRevealViewController.framework", "${BUILT_PRODUCTS_DIR}/SlackTextViewController/SlackTextViewController.framework", "${PODS_ROOT}/TwilioAccessManager/TwilioAccessManager.framework", @@ -394,7 +395,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 9785D95EAE7C333D7258BA48 /* [CP] Embed Pods Frameworks */ = { @@ -403,7 +404,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-twiliochat/Pods-twiliochat-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-twiliochat/Pods-twiliochat-frameworks.sh", "${BUILT_PRODUCTS_DIR}/SWRevealViewController/SWRevealViewController.framework", "${BUILT_PRODUCTS_DIR}/SlackTextViewController/SlackTextViewController.framework", "${PODS_ROOT}/TwilioAccessManager/TwilioAccessManager.framework", @@ -420,7 +421,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-twiliochat/Pods-twiliochat-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-twiliochat/Pods-twiliochat-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; AC99985F6B681623E5091B05 /* [CP] Check Pods Manifest.lock */ = { @@ -529,18 +530,27 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -577,18 +587,27 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -634,7 +653,7 @@ PRODUCT_BUNDLE_IDENTIFIER = twilio.twiliochat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "twiliochat/twiliochat-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -657,7 +676,7 @@ PRODUCT_BUNDLE_IDENTIFIER = twilio.twiliochat; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "twiliochat/twiliochat-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -672,7 +691,7 @@ PRODUCT_BUNDLE_IDENTIFIER = twilio.twiliochatTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/twiliochat.app/twiliochat"; }; name = Debug; @@ -688,7 +707,7 @@ PRODUCT_BUNDLE_IDENTIFIER = twilio.twiliochatTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/twiliochat.app/twiliochat"; }; name = Release; diff --git a/twiliochat.xcworkspace/xcshareddata/xcschemes/twiliochat.xcscheme b/twiliochat.xcworkspace/xcshareddata/xcschemes/twiliochat.xcscheme index 3fba7b9..dcf833e 100644 --- a/twiliochat.xcworkspace/xcshareddata/xcschemes/twiliochat.xcscheme +++ b/twiliochat.xcworkspace/xcshareddata/xcschemes/twiliochat.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -49,17 +58,6 @@ - - - - - - - - Void)?) { + presenter:(UIViewController), completion:(() -> Void)?) { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) let defaultAction = UIAlertAction(title: "OK", style: .cancel) { (_) -> Void in diff --git a/twiliochat/AppDelegate.swift b/twiliochat/AppDelegate.swift index a1b7517..714c0a3 100644 --- a/twiliochat/AppDelegate.swift +++ b/twiliochat/AppDelegate.swift @@ -4,7 +4,7 @@ import UIKit class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MessagingManager.sharedManager().presentLaunchScreen() MessagingManager.sharedManager().presentRootViewController() return true diff --git a/twiliochat/DateTodayFormatter.swift b/twiliochat/DateTodayFormatter.swift index 6ed0359..38e935a 100644 --- a/twiliochat/DateTodayFormatter.swift +++ b/twiliochat/DateTodayFormatter.swift @@ -35,7 +35,7 @@ extension NSDate { var formattedDateString = dateString if dateString.hasSuffix("Z") { - let lastIndex = dateString.characters.indices.last! + let lastIndex = dateString.indices.last! formattedDateString = dateString.substring(to: lastIndex) + "-000" } return dateFromString(str: formattedDateString, withFormat:"yyyy-MM-dd'T'HH:mm:ss.SSSZ") @@ -44,7 +44,7 @@ extension NSDate { class func dateFromString(str: String, withFormat dateFormat: String) -> NSDate? { let formatter = DateFormatter() formatter.dateFormat = dateFormat - formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") as Locale! + formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") as Locale? return formatter.date(from: str) as NSDate? } } diff --git a/twiliochat/InputDialogController.swift b/twiliochat/InputDialogController.swift index 98239e5..f944833 100644 --- a/twiliochat/InputDialogController.swift +++ b/twiliochat/InputDialogController.swift @@ -30,7 +30,7 @@ class InputDialogController: NSObject { textField.placeholder = placeholder NotificationCenter.default.addObserver(self, selector: #selector(InputDialogController.handleTextFieldTextDidChangeNotification(notification:)), - name: NSNotification.Name.UITextFieldTextDidChange, + name: UITextField.textDidChangeNotification, object: nil) } @@ -39,7 +39,7 @@ class InputDialogController: NSObject { presenter.present(alert, animated: true, completion: nil) } - func handleTextFieldTextDidChangeNotification(notification: NSNotification) { + @objc func handleTextFieldTextDidChangeNotification(notification: NSNotification) { let textField = notification.object as? UITextField saveAction.isEnabled = !(textField!.text?.isEmpty ?? false) } diff --git a/twiliochat/MainChatViewController.swift b/twiliochat/MainChatViewController.swift index 1868b5a..9139bee 100644 --- a/twiliochat/MainChatViewController.swift +++ b/twiliochat/MainChatViewController.swift @@ -65,12 +65,12 @@ class MainChatViewController: SLKTextViewController { rightButton.setTitleColor(UIColor(red:0.973, green:0.557, blue:0.502, alpha:1), for: .normal) if let font = UIFont(name:"Avenir-Heavy", size:17) { - navigationController?.navigationBar.titleTextAttributes = [NSFontAttributeName: font] + navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.font: font] } tableView!.allowsSelection = false tableView!.estimatedRowHeight = 70 - tableView!.rowHeight = UITableViewAutomaticDimension + tableView!.rowHeight = UITableView.automaticDimension tableView!.separatorStyle = .none if channel == nil { @@ -82,9 +82,9 @@ class MainChatViewController: SLKTextViewController { super.viewDidLayoutSubviews() // required for iOS 11 - textInputbar.bringSubview(toFront: textInputbar.textView) - textInputbar.bringSubview(toFront: textInputbar.leftButton) - textInputbar.bringSubview(toFront: textInputbar.rightButton) + textInputbar.bringSubviewToFront(textInputbar.textView) + textInputbar.bringSubviewToFront(textInputbar.leftButton) + textInputbar.bringSubviewToFront(textInputbar.rightButton) } diff --git a/twiliochat/MenuViewController.swift b/twiliochat/MenuViewController.swift index 1bb4f9e..4db11be 100644 --- a/twiliochat/MenuViewController.swift +++ b/twiliochat/MenuViewController.swift @@ -48,7 +48,7 @@ class MenuViewController: UIViewController { refreshControl.endRefreshing() } - func refreshChannels() { + @objc func refreshChannels() { refreshControl.beginRefreshing() reloadChannelList() } @@ -154,7 +154,7 @@ extension MenuViewController : UITableViewDataSource { return false } - func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, + func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { if editingStyle != .delete { return diff --git a/twiliochat/TextFieldFormHandler.swift b/twiliochat/TextFieldFormHandler.swift index daf8e70..8ef7a9e 100644 --- a/twiliochat/TextFieldFormHandler.swift +++ b/twiliochat/TextFieldFormHandler.swift @@ -34,7 +34,7 @@ public class TextFieldFormHandler: NSObject { public var firstResponderIndex: Int? { if let firstResponder = self.firstResponder { - return self.textFields.index(of: firstResponder) + return self.textFields.firstIndex(of: firstResponder) } return nil } @@ -61,7 +61,7 @@ public class TextFieldFormHandler: NSObject { } func initializeObservers() { - NotificationCenter.default.addObserver(self, selector: #selector(TextFieldFormHandler.keyboardWillShow(notification:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(TextFieldFormHandler.keyboardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil) let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(TextFieldFormHandler.backgroundTap(sender:))) self.topContainer.addGestureRecognizer(tapRecognizer) } @@ -99,7 +99,7 @@ public class TextFieldFormHandler: NSObject { shiftScreenYPosition(position: 0, duration: 0.2, curve: .easeInOut) } - func shiftScreenYPosition(position: CGFloat, duration: TimeInterval, curve: UIViewAnimationCurve) { + func shiftScreenYPosition(position: CGFloat, duration: TimeInterval, curve: UIView.AnimationCurve) { UIView.beginAnimations("moveView", context: nil) UIView.setAnimationCurve(curve) UIView.setAnimationDuration(duration) @@ -108,14 +108,14 @@ public class TextFieldFormHandler: NSObject { UIView.commitAnimations() } - func backgroundTap(sender: UITapGestureRecognizer) { + @objc func backgroundTap(sender: UITapGestureRecognizer) { topContainer.endEditing(true) moveScreenDown() } - func keyboardWillShow(notification: NSNotification) { + @objc func keyboardWillShow(notification: NSNotification) { if (keyboardSize == 0) { - if let keyboardRect = (notification.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue { + if let keyboardRect = (notification.userInfo?[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue { keyboardSize = min(keyboardRect.height, keyboardRect.width) } } @@ -157,7 +157,7 @@ extension TextFieldFormHandler : UITextFieldDelegate { return true } - let index = self.textFields.index(of: textField) + let index = self.textFields.firstIndex(of: textField) let nextTextField = self.textFields[index! + 1] nextTextField.becomeFirstResponder() return true From 74071b50b44a99baedb0c09002082f512c14a8dc Mon Sep 17 00:00:00 2001 From: Nitesh Date: Tue, 28 Jul 2020 19:30:24 +0530 Subject: [PATCH 2/2] Update the pods --- Podfile.lock | 2 +- twiliochat.xcodeproj/project.pbxproj | 90 +++++++++++++++++++--------- twiliochat/MessagingManager.swift | 4 +- 3 files changed, 65 insertions(+), 31 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 5462215..106d634 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -21,4 +21,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 9fb530d9294dcf8e8f7f735b87bea8ccde0b39f3 -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.3 diff --git a/twiliochat.xcodeproj/project.pbxproj b/twiliochat.xcodeproj/project.pbxproj index 9bbaf75..b9739ac 100644 --- a/twiliochat.xcodeproj/project.pbxproj +++ b/twiliochat.xcodeproj/project.pbxproj @@ -32,6 +32,8 @@ 87F895F61C0E044300754007 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87F895F51C0E044300754007 /* MenuViewController.swift */; }; 87F895F81C0E045F00754007 /* MainChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87F895F71C0E045F00754007 /* MainChatViewController.swift */; }; 8A07B2CB1F224CAD009F0836 /* MockMessagingManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A07B2CA1F224CAD009F0836 /* MockMessagingManager.swift */; }; + 9D8B51618580EE39205BCEEA /* Pods_twiliochatTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ECEB4988DD138F9D14169BC /* Pods_twiliochatTests.framework */; }; + E6B148DE95F68F3003E4CECA /* Pods_twiliochat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 395644183CFDEED850DD6C98 /* Pods_twiliochat.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -45,6 +47,9 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 041CA08C19DDD5B8560DA76C /* Pods-twiliochat.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-twiliochat.debug.xcconfig"; path = "Target Support Files/Pods-twiliochat/Pods-twiliochat.debug.xcconfig"; sourceTree = ""; }; + 2ECEB4988DD138F9D14169BC /* Pods_twiliochatTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_twiliochatTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 395644183CFDEED850DD6C98 /* Pods_twiliochat.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_twiliochat.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 59A866DC1C1B5E8100525F07 /* MockAlertDialogController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockAlertDialogController.swift; sourceTree = ""; }; 59A866DE1C1B6C0900525F07 /* LoginViewControllerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewControllerTests.swift; sourceTree = ""; }; 59AE1CCD1C0C8C280008B10B /* TextFieldFormHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldFormHandler.swift; sourceTree = ""; }; @@ -62,6 +67,7 @@ 59F209311C050EF700CC2392 /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; 59F5EDAF1C6E925500CE7D32 /* TokenRequestHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenRequestHandler.swift; sourceTree = ""; }; 59F5EDB21C720E1200CE7D32 /* SessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionManager.swift; sourceTree = ""; }; + 7C2754B8C3321793DE16B7FF /* Pods-twiliochatTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-twiliochatTests.release.xcconfig"; path = "Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests.release.xcconfig"; sourceTree = ""; }; 825276F51DFB48EC0029E3CA /* twiliochat-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "twiliochat-Bridging-Header.h"; sourceTree = ""; }; 877109141C10EF4F004C57D3 /* ChannelManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChannelManager.swift; sourceTree = ""; }; 877109161C15E55E004C57D3 /* MenuTableCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuTableCell.swift; sourceTree = ""; }; @@ -75,6 +81,8 @@ 87F895F51C0E044300754007 /* MenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = ""; }; 87F895F71C0E045F00754007 /* MainChatViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainChatViewController.swift; sourceTree = ""; }; 8A07B2CA1F224CAD009F0836 /* MockMessagingManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockMessagingManager.swift; sourceTree = ""; }; + 984CFAF0FD536EFC361ACD16 /* Pods-twiliochatTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-twiliochatTests.debug.xcconfig"; path = "Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests.debug.xcconfig"; sourceTree = ""; }; + BC44279897908D6D89ECADC3 /* Pods-twiliochat.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-twiliochat.release.xcconfig"; path = "Target Support Files/Pods-twiliochat/Pods-twiliochat.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -82,6 +90,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + E6B148DE95F68F3003E4CECA /* Pods_twiliochat.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -89,12 +98,22 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9D8B51618580EE39205BCEEA /* Pods_twiliochatTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3F2B58955A397B6A5EC610CC /* Frameworks */ = { + isa = PBXGroup; + children = ( + 395644183CFDEED850DD6C98 /* Pods_twiliochat.framework */, + 2ECEB4988DD138F9D14169BC /* Pods_twiliochatTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 59A866D91C1B5D3700525F07 /* Mocks */ = { isa = PBXGroup; children = ( @@ -131,6 +150,7 @@ 59F209111C04C06800CC2392 /* twiliochatTests */, 59F208FB1C04C06800CC2392 /* Products */, 89D67A5C1B1630989E04019D /* Pods */, + 3F2B58955A397B6A5EC610CC /* Frameworks */, ); sourceTree = ""; }; @@ -231,6 +251,10 @@ 89D67A5C1B1630989E04019D /* Pods */ = { isa = PBXGroup; children = ( + 041CA08C19DDD5B8560DA76C /* Pods-twiliochat.debug.xcconfig */, + BC44279897908D6D89ECADC3 /* Pods-twiliochat.release.xcconfig */, + 984CFAF0FD536EFC361ACD16 /* Pods-twiliochatTests.debug.xcconfig */, + 7C2754B8C3321793DE16B7FF /* Pods-twiliochatTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -242,9 +266,11 @@ isa = PBXNativeTarget; buildConfigurationList = 59F209221C04C06800CC2392 /* Build configuration list for PBXNativeTarget "twiliochat" */; buildPhases = ( + 46E2B23905303AE8780C5286 /* [CP] Check Pods Manifest.lock */, 59F208F61C04C06800CC2392 /* Sources */, 59F208F71C04C06800CC2392 /* Frameworks */, 59F208F81C04C06800CC2392 /* Resources */, + 02BB23CEE09F9D42BA20D79D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -259,9 +285,11 @@ isa = PBXNativeTarget; buildConfigurationList = 59F209251C04C06800CC2392 /* Build configuration list for PBXNativeTarget "twiliochatTests" */; buildPhases = ( + C34AB6E3E611980A0D814F0E /* [CP] Check Pods Manifest.lock */, 59F2090A1C04C06800CC2392 /* Sources */, 59F2090B1C04C06800CC2392 /* Frameworks */, 59F2090C1C04C06800CC2392 /* Resources */, + 545DF57F6398CD19A5FA8334 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -338,16 +366,15 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 627A9442CE781663D9A680DB /* [CP] Embed Pods Frameworks */ = { + 02BB23CEE09F9D42BA20D79D /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-twiliochat/Pods-twiliochat-frameworks.sh", "${BUILT_PRODUCTS_DIR}/SWRevealViewController/SWRevealViewController.framework", "${BUILT_PRODUCTS_DIR}/SlackTextViewController/SlackTextViewController.framework", - "${PODS_ROOT}/TwilioAccessManager/TwilioAccessManager.framework", "${PODS_ROOT}/TwilioChatClient/TwilioChatClient.framework", "${PODS_ROOT}/TwilioChatClient/TwilioChatClient.framework.dSYM", ); @@ -355,71 +382,76 @@ outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SWRevealViewController.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SlackTextViewController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioAccessManager.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioChatClient.framework", "${DWARF_DSYM_FOLDER_PATH}/TwilioChatClient.framework.dSYM", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-twiliochat/Pods-twiliochat-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 9785D95EAE7C333D7258BA48 /* [CP] Embed Pods Frameworks */ = { + 46E2B23905303AE8780C5286 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-twiliochat/Pods-twiliochat-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/SWRevealViewController/SWRevealViewController.framework", - "${BUILT_PRODUCTS_DIR}/SlackTextViewController/SlackTextViewController.framework", - "${PODS_ROOT}/TwilioAccessManager/TwilioAccessManager.framework", - "${PODS_ROOT}/TwilioChatClient/TwilioChatClient.framework", - "${PODS_ROOT}/TwilioChatClient/TwilioChatClient.framework.dSYM", + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SWRevealViewController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SlackTextViewController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioAccessManager.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioChatClient.framework", - "${DWARF_DSYM_FOLDER_PATH}/TwilioChatClient.framework.dSYM", + "$(DERIVED_FILE_DIR)/Pods-twiliochat-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-twiliochat/Pods-twiliochat-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; }; - AC99985F6B681623E5091B05 /* [CP] Check Pods Manifest.lock */ = { + 545DF57F6398CD19A5FA8334 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", + "${PODS_ROOT}/Target Support Files/Pods-twiliochatTests/Pods-twiliochatTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/SWRevealViewController/SWRevealViewController.framework", + "${BUILT_PRODUCTS_DIR}/SlackTextViewController/SlackTextViewController.framework", + "${PODS_ROOT}/TwilioChatClient/TwilioChatClient.framework", + "${PODS_ROOT}/TwilioChatClient/TwilioChatClient.framework.dSYM", ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-twiliochatTests-checkManifestLockResult.txt", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SWRevealViewController.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SlackTextViewController.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioChatClient.framework", + "${DWARF_DSYM_FOLDER_PATH}/TwilioChatClient.framework.dSYM", ); 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-twiliochatTests/Pods-twiliochatTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - B4DA9BBC3EB298E4EFA04918 /* [CP] Check Pods Manifest.lock */ = { + C34AB6E3E611980A0D814F0E /* [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-twiliochat-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-twiliochatTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -602,6 +634,7 @@ }; 59F209231C04C06800CC2392 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 041CA08C19DDD5B8560DA76C /* Pods-twiliochat.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -624,6 +657,7 @@ }; 59F209241C04C06800CC2392 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = BC44279897908D6D89ECADC3 /* Pods-twiliochat.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -646,6 +680,7 @@ }; 59F209261C04C06800CC2392 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 984CFAF0FD536EFC361ACD16 /* Pods-twiliochatTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = ""; @@ -661,6 +696,7 @@ }; 59F209271C04C06800CC2392 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 7C2754B8C3321793DE16B7FF /* Pods-twiliochatTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = ""; diff --git a/twiliochat/MessagingManager.swift b/twiliochat/MessagingManager.swift index 57273b3..8da2afc 100644 --- a/twiliochat/MessagingManager.swift +++ b/twiliochat/MessagingManager.swift @@ -160,9 +160,7 @@ extension MessagingManager : TwilioChatClientDelegate { ChannelManager.sharedManager.channelsList = client.channelsList() ChannelManager.sharedManager.populateChannelDescriptors() loadGeneralChatRoomWithCompletion { success, error in - if success { - self.presentRootViewController() - } + self.presentRootViewController() } } self.delegate?.chatClient(client, synchronizationStatusUpdated: status)