diff --git a/ActionCableClient.podspec b/ActionCableClient.podspec index 41e1082..8eab011 100644 --- a/ActionCableClient.podspec +++ b/ActionCableClient.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "ActionCableClient" - s.version = "0.2.4" + s.version = "4.2.0" s.summary = "A Swift client for the Rails ActionCable WebSocket server." s.description = <<-DESC ActionCable is a new WebSocket server being released with Rails 5 which makes it easy to add real-time features to your app. This Swift client makes it dead-simple to connect with that server, abstracting away everything except what you need to get going. @@ -12,12 +12,12 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/danielrhodes/Swift-ActionCableClient.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/danielrhodes' - s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' } + s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.2' } s.ios.deployment_target = '8.0' s.tvos.deployment_target = '9.0' s.requires_arc = true s.source_files = 'Source/Classes/**/*' s.frameworks = 'Foundation' - s.dependency 'Starscream', '~> 3.0.3' + s.dependency 'Starscream', '~> 3.0.6' end diff --git a/ActionCableClient.xcodeproj/project.pbxproj b/ActionCableClient.xcodeproj/project.pbxproj index 1e95e75..49bf55c 100644 --- a/ActionCableClient.xcodeproj/project.pbxproj +++ b/ActionCableClient.xcodeproj/project.pbxproj @@ -505,7 +505,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -527,7 +527,7 @@ PRODUCT_NAME = ActionCableClient; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -551,7 +551,7 @@ PRODUCT_NAME = ActionCableClient; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -577,7 +577,7 @@ PRODUCT_NAME = ActionCableClient; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -593,7 +593,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.danielrhodes.ActionCableClient-Test-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -608,7 +608,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.danielrhodes.ActionCableClient-Test-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Example/ActionCableClient-Example.xcodeproj/project.pbxproj b/Example/ActionCableClient-Example.xcodeproj/project.pbxproj index ab47db8..76e1235 100644 --- a/Example/ActionCableClient-Example.xcodeproj/project.pbxproj +++ b/Example/ActionCableClient-Example.xcodeproj/project.pbxproj @@ -154,7 +154,6 @@ 86D451531DC31BF9006A516E /* Frameworks */, 86D451541DC31BF9006A516E /* Resources */, 73670B087BDA56514C37256F /* [CP] Embed Pods Frameworks */, - 54AE2864EEF206764C29DEB5 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -174,7 +173,6 @@ 86D4517E1DC31D73006A516E /* Frameworks */, 86D4517F1DC31D73006A516E /* Resources */, CB2674BAF940CAB39684678D /* [CP] Embed Pods Frameworks */, - 44C432A26A1306534DDB0E9A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -197,7 +195,7 @@ TargetAttributes = { 86D451551DC31BF9006A516E = { CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; ProvisioningStyle = Automatic; }; 86D451801DC31D73006A516E = { @@ -265,36 +263,6 @@ 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; }; - 44C432A26A1306534DDB0E9A /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ActionCableClient-Example-tvOS/Pods-ActionCableClient-Example-tvOS-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 54AE2864EEF206764C29DEB5 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ActionCableClient-Example-iOS/Pods-ActionCableClient-Example-iOS-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 714E8598059A7B374097B96E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -524,8 +492,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "ActionCableClient-Example-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -541,8 +508,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.danielrhodes.ActionCableClient-Example-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "ActionCableClient-Example-Bridging-Header.h"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -557,7 +523,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.danielrhodes.ActionCableClient-Example-tvOS"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -574,7 +540,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.danielrhodes.ActionCableClient-Example-tvOS"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; diff --git a/Example/ActionCableClient-Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/ActionCableClient-Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/ActionCableClient-Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/ActionCableClient/AppDelegate.swift b/Example/ActionCableClient/AppDelegate.swift index c103a95..3b77c49 100644 --- a/Example/ActionCableClient/AppDelegate.swift +++ b/Example/ActionCableClient/AppDelegate.swift @@ -28,7 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { let controller = ChatViewController() let navigationController = UINavigationController() navigationController.pushViewController(controller, animated: false) diff --git a/Example/ActionCableClient/ChatCell.swift b/Example/ActionCableClient/ChatCell.swift index 764d00a..328612b 100644 --- a/Example/ActionCableClient/ChatCell.swift +++ b/Example/ActionCableClient/ChatCell.swift @@ -35,7 +35,7 @@ class ChatCell: UITableViewCell { } } - override init(style: UITableViewCellStyle, reuseIdentifier: String?) { + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) textView.frame = CGRect.zero textView.lineBreakMode = NSLineBreakMode.byWordWrapping diff --git a/Example/ActionCableClient/ChatView.swift b/Example/ActionCableClient/ChatView.swift index d75206a..fcbb5b0 100644 --- a/Example/ActionCableClient/ChatView.swift +++ b/Example/ActionCableClient/ChatView.swift @@ -36,24 +36,24 @@ class ChatView : UIView { super.init(frame: frame) self.tableView.frame = CGRect.zero - self.tableView.contentInset = UIEdgeInsetsMake(0, -5, 0, 0); + self.tableView.contentInset = UIEdgeInsets(top: 0, left: -5, bottom: 0, right: 0); self.addSubview(self.tableView) self.textField.frame = CGRect.zero - self.textField.borderStyle = UITextBorderStyle.bezel + self.textField.borderStyle = UITextField.BorderStyle.bezel self.textField.returnKeyType = UIReturnKeyType.send self.textField.placeholder = "Say something..." self.addSubview(self.textField) self.backgroundColor = UIColor.white - NotificationCenter.default.addObserver(self, selector: #selector(ChatView.keyboardWillShowNotification(_:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(ChatView.keyboardWillHideNotification(_:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(ChatView.keyboardWillShowNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(ChatView.keyboardWillHideNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) } deinit { - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil) - NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil) } required init?(coder aDecoder: NSCoder) { @@ -86,9 +86,9 @@ class ChatView : UIView { extension ChatView { @objc func keyboardWillHideNotification(_ notification: Notification) { let userInfo = (notification as NSNotification).userInfo! - let animationDuration = (userInfo[UIKeyboardAnimationDurationUserInfoKey] as! NSNumber).doubleValue - let rawAnimationCurve = ((notification as NSNotification).userInfo![UIKeyboardAnimationCurveUserInfoKey] as! NSNumber).uint32Value << 16 - let animationCurve = UIViewAnimationOptions(rawValue: UInt(rawAnimationCurve)) + let animationDuration = (userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as! NSNumber).doubleValue + let rawAnimationCurve = ((notification as NSNotification).userInfo![UIResponder.keyboardAnimationCurveUserInfoKey] as! NSNumber).uint32Value << 16 + let animationCurve = UIView.AnimationOptions(rawValue: UInt(rawAnimationCurve)) UIView.animate(withDuration: animationDuration, delay: 0.0, options: [.beginFromCurrentState, animationCurve], animations: { self.bottomLayoutConstraint?.update(offset: 0) @@ -98,11 +98,11 @@ extension ChatView { @objc func keyboardWillShowNotification(_ notification: Notification) { let userInfo = (notification as NSNotification).userInfo! - let animationDuration = (userInfo[UIKeyboardAnimationDurationUserInfoKey] as! NSNumber).doubleValue - let keyboardEndFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue + let animationDuration = (userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as! NSNumber).doubleValue + let keyboardEndFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue let convertedKeyboardEndFrame = self.convert(keyboardEndFrame, from: self.window) - let rawAnimationCurve = ((notification as NSNotification).userInfo![UIKeyboardAnimationCurveUserInfoKey] as! NSNumber).uint32Value << 16 - let animationCurve = UIViewAnimationOptions(rawValue: UInt(rawAnimationCurve)) + let rawAnimationCurve = ((notification as NSNotification).userInfo![UIResponder.keyboardAnimationCurveUserInfoKey] as! NSNumber).uint32Value << 16 + let animationCurve = UIView.AnimationOptions(rawValue: UInt(rawAnimationCurve)) UIView.animate(withDuration: animationDuration, delay: 0.0, options: [.beginFromCurrentState, animationCurve], animations: { self.bottomLayoutConstraint?.update(offset: -convertedKeyboardEndFrame.height) self.updateConstraintsIfNeeded() diff --git a/Example/ActionCableClient/ChatViewController.swift b/Example/ActionCableClient/ChatViewController.swift index 73f00b7..60d6195 100644 --- a/Example/ActionCableClient/ChatViewController.swift +++ b/Example/ActionCableClient/ChatViewController.swift @@ -66,7 +66,7 @@ class ChatViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - let alert = UIAlertController(title: "Chat", message: "What's Your Name?", preferredStyle: UIAlertControllerStyle.alert) + let alert = UIAlertController(title: "Chat", message: "What's Your Name?", preferredStyle: UIAlertController.Style.alert) var nameTextField: UITextField? alert.addTextField(configurationHandler: {(textField: UITextField!) in @@ -75,7 +75,7 @@ class ChatViewController: UIViewController { nameTextField = textField }) - alert.addAction(UIAlertAction(title: "Start", style: UIAlertActionStyle.default) {(action: UIAlertAction) in + alert.addAction(UIAlertAction(title: "Start", style: UIAlertAction.Style.default) {(action: UIAlertAction) in self.name = nameTextField?.text self.chatView?.textField.becomeFirstResponder() }) @@ -187,14 +187,14 @@ struct ChatMessage { func attributedString() -> NSAttributedString { let messageString: String = "\(self.name) \(self.message)" - let nameRange = NSRange(location: 0, length: self.name.characters.count) - let nonNameRange = NSRange(location: nameRange.length, length: messageString.characters.count - nameRange.length) + let nameRange = NSRange(location: 0, length: self.name.count) + let nonNameRange = NSRange(location: nameRange.length, length: messageString.count - nameRange.length) let string: NSMutableAttributedString = NSMutableAttributedString(string: messageString) - string.addAttribute(NSAttributedStringKey.font, + string.addAttribute(NSAttributedString.Key.font, value: UIFont.boldSystemFont(ofSize: 18.0), range: nameRange) - string.addAttribute(NSAttributedStringKey.font, value: UIFont.systemFont(ofSize: 18.0), range: nonNameRange) + string.addAttribute(NSAttributedString.Key.font, value: UIFont.systemFont(ofSize: 18.0), range: nonNameRange) return string } } diff --git a/Example/Podfile b/Example/Podfile index ea4ee17..7085cce 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -3,8 +3,8 @@ use_frameworks! def common_pods pod 'ActionCableClient', :path => '../' - pod 'SwiftyJSON' - pod 'SnapKit' + pod 'SwiftyJSON', '~> 4.2.0' + pod 'SnapKit', '~> 4.2.0' end def common_test_pods diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 4e98259..1948d22 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,25 +1,31 @@ PODS: - - ActionCableClient (0.2.3): - - Starscream (~> 2.1.1) - - SnapKit (3.2.0) - - Starscream (2.1.1) - - SwiftyJSON (3.1.4) + - ActionCableClient (4.2.0): + - Starscream (~> 3.0.6) + - SnapKit (4.2.0) + - Starscream (3.0.6) + - SwiftyJSON (4.2.0) DEPENDENCIES: - ActionCableClient (from `../`) - - SnapKit - - SwiftyJSON + - SnapKit (~> 4.2.0) + - SwiftyJSON (~> 4.2.0) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - SnapKit + - Starscream + - SwiftyJSON EXTERNAL SOURCES: ActionCableClient: - :path: ../ + :path: "../" SPEC CHECKSUMS: - ActionCableClient: b292c0cb95490f0a5d417729b8052764b1d6babe - SnapKit: 1ca44df72cfa543218d177cb8aab029d10d86ea7 - Starscream: 142bd8ef24592d985daee9fa48c936070b85b15f - SwiftyJSON: c2842d878f95482ffceec5709abc3d05680c0220 + ActionCableClient: 0c1207b0a8a6922b2b485d2038af0403e7b480c9 + SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a + Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5 + SwiftyJSON: c4bcba26dd9ec7a027fc8eade48e2c911f229e96 -PODFILE CHECKSUM: dbc0283d807753c3c71ad17b82e66d2742059690 +PODFILE CHECKSUM: 9baeb2340906dd1d8d68d40f0ad04b8a2fc1738b -COCOAPODS: 1.3.1 +COCOAPODS: 1.5.3