From 78f414d35fb3fda2171a7e61896c6233f5b8dee1 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 11 Feb 2020 11:34:42 +0700 Subject: [PATCH 01/31] - Pods Updated to use latest Starscream api as I was seeing some crashes with the old version. Fixed code to use the latest Starscream api - Made changes suggested by 'switchCTRL' & 'Vladimir Lebedev-Schmidthof' on original repository since no one accepting pull requests. - Version bumped --- Podfile | 18 +-- Podfile.lock | 38 +++-- README.md | 4 +- SignalR-Swift-Example/Podfile.lock | 25 +-- .../project.pbxproj | 96 +++-------- SignalR-Swift.xcodeproj/project.pbxproj | 77 ++++----- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + SignalR-Swift/Client/Hubs/HubProxy.swift | 37 +++-- SignalR-Swift/Info.plist | 2 +- .../ServerSentEvents/ChunkBuffer.swift | 8 +- .../Transports/WebSocketTransport.swift | 149 ++++++++++-------- SignalRSwift.podspec | 8 +- 12 files changed, 223 insertions(+), 247 deletions(-) create mode 100644 SignalR-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Podfile b/Podfile index e568f69..c28c7c0 100644 --- a/Podfile +++ b/Podfile @@ -1,30 +1,20 @@ # Uncomment the next line to define a global platform for your project -platform :ios, '10.3' +platform :ios, '9.0' target 'SignalRSwift' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! # Pods for SignalR-Swift - pod 'Alamofire', '~> 4.2' - pod 'Starscream', '~> 3.0' + pod 'Alamofire' + pod 'Starscream' target 'SignalR-SwiftTests' do inherit! :search_paths # Pods for testing pod 'Quick' pod 'Nimble' - pod 'Mockit', '~> 1.3' + pod 'Mockit' end end - -post_install do |installer| - installer.pods_project.targets.each do |target| - if target.name == 'Mockit' - target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '3.2' - end - end - end -end \ No newline at end of file diff --git a/Podfile.lock b/Podfile.lock index 7110e54..581282a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,24 +1,32 @@ PODS: - - Alamofire (4.6.0) - - Mockit (1.3.4) - - Nimble (7.0.3) - - Quick (1.2.0) - - Starscream (3.0.3) + - Alamofire (4.9.1) + - Mockit (1.5.0) + - Nimble (8.0.5) + - Quick (2.2.0) + - Starscream (4.0.0) DEPENDENCIES: - - Alamofire (~> 4.2) - - Mockit (~> 1.3) + - Alamofire + - Mockit - Nimble - Quick - - Starscream (~> 3.0) + - Starscream + +SPEC REPOS: + trunk: + - Alamofire + - Mockit + - Nimble + - Quick + - Starscream SPEC CHECKSUMS: - Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4 - Mockit: 1b253f229dde898b268f8bd5dffcf2fd0151ff75 - Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac - Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08 - Starscream: dfb1b3f39506717ee52b67fb48de0c8269504cbc + Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 + Mockit: 09492d654a2945096603d76ea77b131bdcfb2233 + Nimble: 4ab1aeb9b45553c75b9687196b0fa0713170a332 + Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e + Starscream: 04b26f02727e10a002e6b5d21b188ba0d049910b -PODFILE CHECKSUM: 79d0be02a68490c1ac445f39448ee90e8f37cad7 +PODFILE CHECKSUM: fbb16c39d93e3b98af81f291ed56343951baef5b -COCOAPODS: 1.3.1 +COCOAPODS: 1.8.4 diff --git a/README.md b/README.md index 4722aa9..7684b1a 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ $ gem install cocoapods To integrate SignalR-Swift into your Xcode project using CocoaPods, specify it in your Podfile: ``` -source 'https://github.com/CocoaPods/Specs.git' +source 'https://github.com/kamrankhan07/SignalR-Swift.git' platform :ios, '8.0' -pod 'SignalRSwift', '~> 2.0.2' +pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git' ``` Then, run the following command: diff --git a/SignalR-Swift-Example/Podfile.lock b/SignalR-Swift-Example/Podfile.lock index ad6858b..52a9283 100644 --- a/SignalR-Swift-Example/Podfile.lock +++ b/SignalR-Swift-Example/Podfile.lock @@ -1,22 +1,27 @@ PODS: - - Alamofire (4.6.0) - - SignalRSwift (2.0.1): - - Alamofire (~> 4.2) - - Starscream (~> 3.0) - - Starscream (3.0.3) + - Alamofire (4.9.1) + - SignalRSwift (2.1.0): + - Alamofire + - Starscream + - Starscream (4.0.0) DEPENDENCIES: - SignalRSwift (from `../`) +SPEC REPOS: + trunk: + - Alamofire + - Starscream + EXTERNAL SOURCES: SignalRSwift: - :path: ../ + :path: "../" SPEC CHECKSUMS: - Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4 - SignalRSwift: 92b0536d81f0dea4bb3f941adea7422dc26886e8 - Starscream: dfb1b3f39506717ee52b67fb48de0c8269504cbc + Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 + SignalRSwift: 41a414a785c59aa7a0b9012df8ace8c1c820ec2e + Starscream: 04b26f02727e10a002e6b5d21b188ba0d049910b PODFILE CHECKSUM: 0b670b9c4ac8d7df99f98ba1a30595cebc4466a9 -COCOAPODS: 1.3.1 +COCOAPODS: 1.8.4 diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj index 19568e7..25f27a3 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 715553CCD279348CB60CA3CA /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB5250B3C095B54B6A8372E7 /* Pods_SignalR_Swift_ExampleTests.framework */; }; C9E64D701E27DC3300DEDC20 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */; }; C9E64D721E27DC3300DEDC20 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D711E27DC3300DEDC20 /* ViewController.swift */; }; C9E64D771E27DC3300DEDC20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9E64D761E27DC3300DEDC20 /* Assets.xcassets */; }; @@ -27,12 +26,12 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 26A458CE9EF8F3422E825CF9 /* Pods_SignalR_Swift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 790AC94075959051C56799D5 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; - 793E4C03DAB6B7009192E2EF /* Pods-SignalR-Swift-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.release.xcconfig"; sourceTree = ""; }; - A2D0F25BF5CDF45777FDC3D3 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; - BB5250B3C095B54B6A8372E7 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C61CCEAF90DA9573CAF2F41D /* Pods-SignalR-Swift-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.debug.xcconfig"; sourceTree = ""; }; + 34C423C8415C9D7D709AF98C /* Pods_SignalR_Swift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4AC4142A6C198298FE587578 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; + 4E6C9352E26E287BEDA458A8 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; + 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A99CC09EC2595A7FD1BA1510 /* Pods-SignalR-Swift-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.release.xcconfig"; sourceTree = ""; }; + C15CDE19EABC2C1FC1F180C6 /* Pods-SignalR-Swift-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.debug.xcconfig"; sourceTree = ""; }; C9E64D6C1E27DC3300DEDC20 /* SignalR-Swift-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SignalR-Swift-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C9E64D711E27DC3300DEDC20 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -57,7 +56,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 715553CCD279348CB60CA3CA /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -67,8 +65,8 @@ 3074C68C23B280A1578C9624 /* Frameworks */ = { isa = PBXGroup; children = ( - 26A458CE9EF8F3422E825CF9 /* Pods_SignalR_Swift_Example.framework */, - BB5250B3C095B54B6A8372E7 /* Pods_SignalR_Swift_ExampleTests.framework */, + 34C423C8415C9D7D709AF98C /* Pods_SignalR_Swift_Example.framework */, + 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -76,10 +74,10 @@ 781EA09133FDDDA08190CC4A /* Pods */ = { isa = PBXGroup; children = ( - C61CCEAF90DA9573CAF2F41D /* Pods-SignalR-Swift-Example.debug.xcconfig */, - 793E4C03DAB6B7009192E2EF /* Pods-SignalR-Swift-Example.release.xcconfig */, - A2D0F25BF5CDF45777FDC3D3 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */, - 790AC94075959051C56799D5 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */, + C15CDE19EABC2C1FC1F180C6 /* Pods-SignalR-Swift-Example.debug.xcconfig */, + A99CC09EC2595A7FD1BA1510 /* Pods-SignalR-Swift-Example.release.xcconfig */, + 4AC4142A6C198298FE587578 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */, + 4E6C9352E26E287BEDA458A8 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -138,7 +136,6 @@ C9E64D691E27DC3300DEDC20 /* Frameworks */, C9E64D6A1E27DC3300DEDC20 /* Resources */, 6F42A1175AEEF087513135D6 /* [CP] Embed Pods Frameworks */, - 3B0F052C7D6CDBE56E5190EC /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -157,8 +154,6 @@ C9E64D7C1E27DC3400DEDC20 /* Sources */, C9E64D7D1E27DC3400DEDC20 /* Frameworks */, C9E64D7E1E27DC3400DEDC20 /* Resources */, - 10D9A3292E3B053C4B1F1E8B /* [CP] Embed Pods Frameworks */, - 77521BBF68CE60E8E2BA4051 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -177,7 +172,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1130; ORGANIZATIONNAME = "Jordan Camara"; TargetAttributes = { C9E64D6B1E27DC3300DEDC20 = { @@ -195,7 +190,7 @@ }; buildConfigurationList = C9E64D671E27DC3300DEDC20 /* Build configuration list for PBXProject "SignalR-Swift-Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -251,43 +246,13 @@ 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; }; - 10D9A3292E3B053C4B1F1E8B /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 3B0F052C7D6CDBE56E5190EC /* [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-SignalR-Swift-Example/Pods-SignalR-Swift-Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 6F42A1175AEEF087513135D6 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", "${BUILT_PRODUCTS_DIR}/SignalRSwift/SignalRSwift.framework", "${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework", @@ -300,22 +265,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 77521BBF68CE60E8E2BA4051 /* [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-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; B721394EE4F0D4E64AB5B418 /* [CP] Check Pods Manifest.lock */ = { @@ -390,6 +340,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -399,6 +350,7 @@ 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_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -406,6 +358,7 @@ 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; @@ -446,6 +399,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -455,6 +409,7 @@ 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_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -462,6 +417,7 @@ 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; @@ -493,7 +449,7 @@ }; C9E64D8A1E27DC3400DEDC20 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C61CCEAF90DA9573CAF2F41D /* Pods-SignalR-Swift-Example.debug.xcconfig */; + baseConfigurationReference = C15CDE19EABC2C1FC1F180C6 /* Pods-SignalR-Swift-Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 8Z35TU97D6; @@ -507,7 +463,7 @@ }; C9E64D8B1E27DC3400DEDC20 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 793E4C03DAB6B7009192E2EF /* Pods-SignalR-Swift-Example.release.xcconfig */; + baseConfigurationReference = A99CC09EC2595A7FD1BA1510 /* Pods-SignalR-Swift-Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 8Z35TU97D6; @@ -521,7 +477,7 @@ }; C9E64D8D1E27DC3400DEDC20 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A2D0F25BF5CDF45777FDC3D3 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */; + baseConfigurationReference = 4AC4142A6C198298FE587578 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -537,7 +493,7 @@ }; C9E64D8E1E27DC3400DEDC20 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 790AC94075959051C56799D5 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */; + baseConfigurationReference = 4E6C9352E26E287BEDA458A8 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 60d96a5..2cc14d4 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 03D89CA2D29AD16BE22FB404 /* Pods_SignalRSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */; }; 563B87161F1FA11100D75CEF /* ServerSentEventsTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B87151F1FA11100D75CEF /* ServerSentEventsTransport.swift */; }; 568A77191F223CB2004F5D1C /* ChunkBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A77181F223CB2004F5D1C /* ChunkBuffer.swift */; }; 568A771B1F223CF0004F5D1C /* ServerSentEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A771A1F223CF0004F5D1C /* ServerSentEvent.swift */; }; @@ -40,6 +39,7 @@ C9FC2D951E2025B80027FE59 /* AutoTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FC2D941E2025B80027FE59 /* AutoTransport.swift */; }; C9FC2D971E2025DB0027FE59 /* HttpTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FC2D961E2025DB0027FE59 /* HttpTransport.swift */; }; C9FC2D991E23BC600027FE59 /* ConnectionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */; }; + D7CF60613B31AC265821815F /* Pods_SignalRSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -92,6 +92,8 @@ C9FC2D941E2025B80027FE59 /* AutoTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutoTransport.swift; sourceTree = ""; }; C9FC2D961E2025DB0027FE59 /* HttpTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HttpTransport.swift; sourceTree = ""; }; C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDelegate.swift; sourceTree = ""; }; + CE3269EA23F2637500B29F0F /* SignalRSwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SignalRSwift.podspec; sourceTree = ""; }; + CE3269EB23F264BC00B29F0F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -100,7 +102,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 03D89CA2D29AD16BE22FB404 /* Pods_SignalRSwift.framework in Frameworks */, + D7CF60613B31AC265821815F /* Pods_SignalRSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -180,6 +182,8 @@ C9330B291E1FE59A00B1F2D5 /* Products */, C4B90292188059B3970F0902 /* Pods */, 316A9BF3DEFAB629DD2C78FD /* Frameworks */, + CE3269EA23F2637500B29F0F /* SignalRSwift.podspec */, + CE3269EB23F264BC00B29F0F /* README.md */, ); sourceTree = ""; }; @@ -329,7 +333,6 @@ C9330B241E1FE59A00B1F2D5 /* Frameworks */, C9330B251E1FE59A00B1F2D5 /* Headers */, C9330B261E1FE59A00B1F2D5 /* Resources */, - BE9A67E61EA448B742E04260 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -349,7 +352,6 @@ C9330B2E1E1FE59A00B1F2D5 /* Frameworks */, C9330B2F1E1FE59A00B1F2D5 /* Resources */, 1408BA98AFE158F7832B6F37 /* [CP] Embed Pods Frameworks */, - E29934DC4C7132EA079822B1 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -368,7 +370,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0820; + LastUpgradeCheck = 1130; ORGANIZATIONNAME = "Jordan Camara"; TargetAttributes = { C9330B271E1FE59A00B1F2D5 = { @@ -390,6 +392,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = C9330B1E1E1FE59A00B1F2D5; @@ -427,24 +430,20 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Mockit/Mockit.framework", "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mockit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 8893B2F1770B24873610B1CA /* [CP] Check Pods Manifest.lock */ = { @@ -465,36 +464,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; }; - BE9A67E61EA448B742E04260 /* [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-SignalRSwift/Pods-SignalRSwift-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - E29934DC4C7132EA079822B1 /* [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-SignalR-SwiftTests/Pods-SignalR-SwiftTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; F71AD12E7750A42FE3671D48 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -574,20 +543,29 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = 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_DOCUMENTATION_COMMENTS = YES; 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; @@ -611,7 +589,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -627,20 +605,29 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = 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_DOCUMENTATION_COMMENTS = YES; 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; @@ -658,7 +645,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -684,6 +671,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -707,6 +695,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.1.0; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -718,7 +707,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 65B59CFA9FAF15B46BDCDEC1 /* Pods-SignalR-SwiftTests.debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = 8Z35TU97D6; INFOPLIST_FILE = "SignalR-SwiftTests/Info.plist"; @@ -734,7 +722,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = B5E080DF752A22D635CE38CF /* Pods-SignalR-SwiftTests.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = 8Z35TU97D6; INFOPLIST_FILE = "SignalR-SwiftTests/Info.plist"; diff --git a/SignalR-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SignalR-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SignalR-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SignalR-Swift/Client/Hubs/HubProxy.swift b/SignalR-Swift/Client/Hubs/HubProxy.swift index f6b8f8f..8902b33 100644 --- a/SignalR-Swift/Client/Hubs/HubProxy.swift +++ b/SignalR-Swift/Client/Hubs/HubProxy.swift @@ -2,29 +2,29 @@ // HubProxy.swift // SignalR-Swift // -// +// // Copyright © 2017 Jordan Camara. All rights reserved. // import Foundation public class HubProxy: HubProxyProtocol { - + public var state = [String: Any]() - + private weak var connection: HubConnectionProtocol? private let hubName: String private var subscriptions = [String: Subscription]() - + // MARK: - Init - + public init(connection: HubConnectionProtocol, hubName: String) { self.connection = connection self.hubName = hubName } - + // MARK: - Subscribe - + public func on(eventName: String, handler: @escaping Subscription) -> Subscription? { guard !eventName.isEmpty else { NSException.raise(.invalidArgumentException, format: NSLocalizedString("Argument eventName is null", comment: "null event name exception"), arguments: getVaList(["nil"])) @@ -33,19 +33,19 @@ public class HubProxy: HubProxyProtocol { return self.subscriptions[eventName] ?? self.subscriptions.updateValue(handler, forKey: eventName) ?? handler } - + public func invokeEvent(eventName: String, withArgs args: [Any]) { if let subscription = self.subscriptions[eventName] { subscription(args) } } - + // MARK: - Publish - + public func invoke(method: String, withArgs args: [Any]) { self.invoke(method: method, withArgs: args, completionHandler: nil) } - + public func invoke(method: String, withArgs args: [Any], completionHandler: ((Any?, Error?) -> ())?) { guard !method.isEmpty else { NSException.raise(.invalidArgumentException, format: NSLocalizedString("Argument method is null", comment: "null event name exception"), arguments: getVaList(["nil"])) @@ -53,13 +53,22 @@ public class HubProxy: HubProxyProtocol { } guard let connection = self.connection else { return } - + let callbackId = connection.registerCallback { result in guard let hubResult = result else { return } hubResult.state?.forEach { (key, value) in self.state[key] = value } - completionHandler?(hubResult.result, nil) + if hubResult.error == nil { + completionHandler?(hubResult.result, nil) + } else { + let userInfo = [ + NSLocalizedFailureReasonErrorKey: NSExceptionName.objectNotAvailableException.rawValue, + NSLocalizedDescriptionKey: hubResult.error! + ] + let error = NSError(domain: "com.autosoftdms.SignalR-Swift.\(type(of: self))", code: 0, userInfo: userInfo) + completionHandler?(nil, error) + } } - + let hubData = HubInvocation(callbackId: callbackId, hub: self.hubName, method: method, diff --git a/SignalR-Swift/Info.plist b/SignalR-Swift/Info.plist index fbe1e6b..ec0cc7b 100644 --- a/SignalR-Swift/Info.plist +++ b/SignalR-Swift/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift b/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift index 3cc8e6a..a4a37a8 100644 --- a/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift +++ b/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift @@ -22,17 +22,17 @@ final class ChunkBuffer { func readLine() -> String? { var line: String? - - while let endIndex = buffer.index(of: "\n") { + + while let endIndex = buffer.index(of: "\n") ?? buffer.index(of: "\r\n") { let substring = buffer[.. ())?) { super.negotiate(connection: connection, connectionData: connectionData, completionHandler: completionHandler) } - + override public func start(connection: ConnectionProtocol, connectionData: String?, completionHandler: ((Any?, Error?) -> ())?) { self.connectionInfo = WebSocketConnectionInfo(connection: connection, data: connectionData) - + // perform connection self.performConnect(completionHandler: completionHandler) } - + override public func send(connection: ConnectionProtocol, data: Any, connectionData: String?, completionHandler: ((Any?, Error?) -> ())?) { if let dataString = data as? String { self.webSocket?.write(string: dataString) @@ -47,34 +47,34 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { completionHandler?(nil, nil) } - + override public func abort(connection: ConnectionProtocol, timeout: Double, connectionData: String?) { self.stopWebSocket() super.abort(connection: connection, timeout: timeout, connectionData: connectionData) } - + override public func lostConnection(connection: ConnectionProtocol) { self.stopWebSocket() - + if self.tryCompleteAbort() { return } - + self.reconnect(connection: self.connectionInfo?.connection) } - + private func stopWebSocket() { self.webSocket?.delegate = nil self.webSocket?.disconnect() self.webSocket = nil } - + // MARK: - WebSockets transport - + func performConnect(completionHandler: ((_ response: String?, _ error: Error?) -> ())?) { self.performConnect(reconnecting: false, completionHandler: completionHandler) } - + func performConnect(reconnecting: Bool, completionHandler: ((_ response: String?, _ error: Error?) -> ())?) { let connection = self.connectionInfo?.connection var parameters: [String: Any] = [ @@ -84,13 +84,13 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { "groupsToken": connection?.groupsToken ?? "", "connectionData": self.connectionInfo?.data ?? "" ] - + if let queryString = self.connectionInfo?.connection?.queryString { for (key, value) in queryString { parameters[key] = value } } - + var urlComponents = URLComponents(string: connection!.url) if let urlScheme = urlComponents?.scheme { if urlScheme.hasPrefix("https") { @@ -99,19 +99,17 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { urlComponents?.scheme = "ws" } } - + do { let baseUrl = try urlComponents?.asURL() - let url = reconnecting ? baseUrl!.absoluteString.appending("reconnect") : baseUrl!.absoluteString.appending("connect") - let request = connection?.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 30) - + self.startClosure = completionHandler if let startClosure = self.startClosure { self.connectTimeoutOperation = BlockOperation(block: { [weak self] in guard let strongSelf = self else { return } - + let userInfo = [ NSLocalizedDescriptionKey: NSLocalizedString("Connection timed out.", comment: "timeout error description"), NSLocalizedFailureReasonErrorKey: NSLocalizedString("Connection did not receive initialized message before the timeout.", comment: "timeout error reason"), @@ -119,86 +117,101 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { ] let error = NSError(domain: "com.autosoftdms.SignalR-Swift.\(type(of: strongSelf))", code: NSURLErrorTimedOut, userInfo: userInfo) strongSelf.stopWebSocket() - strongSelf.startClosure = nil startClosure(nil, error) }) - self.connectTimeoutOperation?.perform(#selector(BlockOperation.start), with: nil, afterDelay: connection!.transportConnectTimeout) } - + if let encodedRequest = request?.request { - self.webSocket = WebSocket(request: encodedRequest) - self.webSocket!.disableSSLCertValidation = connection?.webSocketAllowsSelfSignedSSL ?? false + self.webSocket = WebSocket(request: encodedRequest, certPinner: FoundationSecurity(allowSelfSigned: connection?.webSocketAllowsSelfSignedSSL ?? false)) self.webSocket!.delegate = self self.webSocket!.connect() } } catch { - + } } - + func reconnect(connection: ConnectionProtocol?) { _ = BlockOperation { [weak self] in if let strongSelf = self, let connection = connection, Connection.ensureReconnecting(connection: connection) { strongSelf.performConnect(reconnecting: true, completionHandler: nil) } - }.perform(#selector(BlockOperation.start), with: nil, afterDelay: self.reconnectDelay) + }.perform(#selector(BlockOperation.start), with: nil, afterDelay: self.reconnectDelay) } - + // MARK: - WebSocketDelegate - - public func websocketDidConnect(socket: WebSocketClient){ - if let connection = self.connectionInfo?.connection, connection.changeState(oldState: .reconnecting, toState: .connected) { - connection.didReconnect() + private func stopTimeOutOperation() { + if let startClosure = self.startClosure, let connectTimeoutOperation = self.connectTimeoutOperation { + NSObject.cancelPreviousPerformRequests(withTarget: connectTimeoutOperation, selector: #selector(BlockOperation.start), object: nil) + self.connectTimeoutOperation = nil + self.startClosure = nil + startClosure(nil, nil) } } - public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) { - if let error = error { - webSocketError(error) - } - else if !self.tryCompleteAbort() { - self.reconnect(connection: self.connectionInfo?.connection) + private func webSocketConnected(_ headers: [String: String]) { + self.stopTimeOutOperation() + if let connection = self.connectionInfo?.connection, + connection.changeState(oldState: .reconnecting, toState: .connected) == true { + connection.didReconnect() } } - - private func webSocketError(_ error: Error) { - if let startClosure = self.startClosure, let connectTimeoutOperation = self.connectTimeoutOperation { - NSObject.cancelPreviousPerformRequests(withTarget: connectTimeoutOperation, selector: #selector(BlockOperation.start), object: nil) - - self.connectTimeoutOperation = nil - self.stopWebSocket() - - self.startClosure = nil - startClosure(nil, error) - } else if !self.startedAbort { + + private func webSocketDisconnected(_ reason: String, _ code: UInt16) { + if self.tryCompleteAbort() == false { self.reconnect(connection: self.connectionInfo?.connection) + } else { + self.connectionInfo?.connection?.disconnect() + self.stopWebSocket() } } - - public func websocketDidReceiveMessage(socket: WebSocketClient, text: String) { + + private func webSocketReceivedMessage(_ string: String) { var timedOut = false var disconnected = false - - if let connection = self.connectionInfo?.connection, let data = text.data(using: .utf8) { + if let connection = self.connectionInfo?.connection, let data = string.data(using: .utf8) { connection.processResponse(response: data, shouldReconnect: &timedOut, disconnected: &disconnected) } - - if let startClosure = self.startClosure, let connectTimeoutOperation = self.connectTimeoutOperation { - NSObject.cancelPreviousPerformRequests(withTarget: connectTimeoutOperation, selector: #selector(BlockOperation.start), object: nil) - self.connectTimeoutOperation = nil - - self.startClosure = nil - startClosure(nil, nil) - } - - if disconnected { - self.connectionInfo?.connection?.disconnect() + } + + private func webSocketError(_ error: Error?) { + if self.startedAbort == false { + self.reconnect(connection: self.connectionInfo?.connection) + } else { + self.stopTimeOutOperation() self.stopWebSocket() } } - public func websocketDidReceiveData(socket: WebSocketClient, data: Data) { + public func didReceive(event: WebSocketEvent, client: WebSocket) { + switch event { + case .connected(let headers): + print("websocket is connected: \(headers)") + webSocketConnected(headers) + case .disconnected(let reason, let code): + print("websocket is disconnected: \(reason) with code: \(code)") + webSocketDisconnected(reason, code) + case .text(let string): + print("Received text: \(string)") + webSocketReceivedMessage(string) + case .binary(let data): + print("Received data: \(data.count)") + case .ping(_): + break + case .pong(_): + break + case .viablityChanged(_): + break + case .reconnectSuggested(_): + break + case .cancelled: + break; + case .error(let error): + print(error.debugDescription) + webSocketError(error) + } } } + diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 570d170..6ffd0f0 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.0.3" + s.version = "2.1.0" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. @@ -57,14 +57,14 @@ Pod::Spec.new do |s| # the deployment target. You can optionally include the target after the platform. # - s.platform = :ios, "8.0" + s.platform = :ios, "9.0" s.source = { :git => "https://github.com/AutosoftDMS/SignalR-Swift.git", :tag => "#{s.version}" } s.source_files = "SignalR-Swift/**/*.swift" s.exclude_files = "Classes/Exclude" - s.dependency "Alamofire", "~> 4.2" - s.dependency "Starscream", "~> 3.0" + s.dependency "Alamofire" + s.dependency "Starscream" end From bc619611eac4c8431d88c42d7c82d0e65d68999e Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 11 Feb 2020 15:28:37 +0700 Subject: [PATCH 02/31] project settings fix --- README.md | 2 +- SignalR-Swift.xcodeproj/project.pbxproj | 8 ++------ SignalRSwift.podspec | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7684b1a..51da561 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ To integrate SignalR-Swift into your Xcode project using CocoaPods, specify it i ``` source 'https://github.com/kamrankhan07/SignalR-Swift.git' -platform :ios, '8.0' +platform :ios, '9.0' pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git' ``` diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 2cc14d4..5b6c383 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -92,8 +92,6 @@ C9FC2D941E2025B80027FE59 /* AutoTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutoTransport.swift; sourceTree = ""; }; C9FC2D961E2025DB0027FE59 /* HttpTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HttpTransport.swift; sourceTree = ""; }; C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDelegate.swift; sourceTree = ""; }; - CE3269EA23F2637500B29F0F /* SignalRSwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SignalRSwift.podspec; sourceTree = ""; }; - CE3269EB23F264BC00B29F0F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -182,8 +180,6 @@ C9330B291E1FE59A00B1F2D5 /* Products */, C4B90292188059B3970F0902 /* Pods */, 316A9BF3DEFAB629DD2C78FD /* Frameworks */, - CE3269EA23F2637500B29F0F /* SignalRSwift.podspec */, - CE3269EB23F264BC00B29F0F /* README.md */, ); sourceTree = ""; }; @@ -671,7 +667,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.0; + MARKETING_VERSION = 2.1.1; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -695,7 +691,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.0; + MARKETING_VERSION = 2.1.1; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 6ffd0f0..5be4b71 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.0" + s.version = "2.1.1" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From a2f547b64b531db0cf1ba0c6a6fb8a0ea9365f5b Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Wed, 12 Feb 2020 11:13:42 +0700 Subject: [PATCH 03/31] set `webSocketAllowsSelfSignedSSL` to true so that websocket connects, current setting require user to explicitly set it as true or provide SSL pinning configuration --- SignalR-Swift-Example/Podfile.lock | 4 ++-- .../SignalR-Swift-Example.xcodeproj/project.pbxproj | 2 ++ SignalR-Swift.xcodeproj/project.pbxproj | 8 ++++++-- SignalR-Swift/Client/Connection.swift | 2 +- SignalR-Swift/Transports/WebSocketTransport.swift | 2 +- SignalRSwift.podspec | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/SignalR-Swift-Example/Podfile.lock b/SignalR-Swift-Example/Podfile.lock index 52a9283..cdc5c2d 100644 --- a/SignalR-Swift-Example/Podfile.lock +++ b/SignalR-Swift-Example/Podfile.lock @@ -1,6 +1,6 @@ PODS: - Alamofire (4.9.1) - - SignalRSwift (2.1.0): + - SignalRSwift (2.1.1): - Alamofire - Starscream - Starscream (4.0.0) @@ -19,7 +19,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 - SignalRSwift: 41a414a785c59aa7a0b9012df8ace8c1c820ec2e + SignalRSwift: 14b50492a093a8863aa9101e9ee02577d2e9dd0b Starscream: 04b26f02727e10a002e6b5d21b188ba0d049910b PODFILE CHECKSUM: 0b670b9c4ac8d7df99f98ba1a30595cebc4466a9 diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj index 25f27a3..4a91ad1 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + B37FEE14B5F7CB4B84E4DAF7 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */; }; C9E64D701E27DC3300DEDC20 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */; }; C9E64D721E27DC3300DEDC20 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D711E27DC3300DEDC20 /* ViewController.swift */; }; C9E64D771E27DC3300DEDC20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9E64D761E27DC3300DEDC20 /* Assets.xcassets */; }; @@ -56,6 +57,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B37FEE14B5F7CB4B84E4DAF7 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 5b6c383..25d6535 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -92,6 +92,8 @@ C9FC2D941E2025B80027FE59 /* AutoTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutoTransport.swift; sourceTree = ""; }; C9FC2D961E2025DB0027FE59 /* HttpTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HttpTransport.swift; sourceTree = ""; }; C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDelegate.swift; sourceTree = ""; }; + CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SignalRSwift.podspec; sourceTree = ""; }; + CE3269ED23F3B26B00B29F0F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -180,6 +182,8 @@ C9330B291E1FE59A00B1F2D5 /* Products */, C4B90292188059B3970F0902 /* Pods */, 316A9BF3DEFAB629DD2C78FD /* Frameworks */, + CE3269ED23F3B26B00B29F0F /* README.md */, + CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */, ); sourceTree = ""; }; @@ -667,7 +671,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.1; + MARKETING_VERSION = 2.1.2; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -691,7 +695,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.1; + MARKETING_VERSION = 2.1.2; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/SignalR-Swift/Client/Connection.swift b/SignalR-Swift/Client/Connection.swift index c8bcb0e..917e91e 100644 --- a/SignalR-Swift/Client/Connection.swift +++ b/SignalR-Swift/Client/Connection.swift @@ -43,7 +43,7 @@ public class Connection: ConnectionProtocol { public var headers = HTTPHeaders() public var keepAliveData: KeepAliveData? - public var webSocketAllowsSelfSignedSSL = false + public var webSocketAllowsSelfSignedSSL = true public internal(set) var sessionManager: SessionManager public var transport: ClientTransportProtocol? diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index ccbdfea..2b1b1d4 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -124,7 +124,7 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { } if let encodedRequest = request?.request { - self.webSocket = WebSocket(request: encodedRequest, certPinner: FoundationSecurity(allowSelfSigned: connection?.webSocketAllowsSelfSignedSSL ?? false)) + self.webSocket = WebSocket(request: encodedRequest, certPinner: FoundationSecurity(allowSelfSigned: connection?.webSocketAllowsSelfSignedSSL ?? true)) self.webSocket!.delegate = self self.webSocket!.connect() } diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 5be4b71..f206ac2 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.1" + s.version = "2.1.2" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From a3393d8343df90343aab79bbd64b82efd5b328d7 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 25 Feb 2020 17:44:55 +0700 Subject: [PATCH 04/31] logs removed --- SignalR-Swift/Transports/WebSocketTransport.swift | 8 ++++---- SignalRSwift.podspec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index 2b1b1d4..74619b8 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -188,16 +188,16 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { public func didReceive(event: WebSocketEvent, client: WebSocket) { switch event { case .connected(let headers): - print("websocket is connected: \(headers)") + //print("websocket is connected: \(headers)") webSocketConnected(headers) case .disconnected(let reason, let code): - print("websocket is disconnected: \(reason) with code: \(code)") + //print("websocket is disconnected: \(reason) with code: \(code)") webSocketDisconnected(reason, code) case .text(let string): - print("Received text: \(string)") + //print("Received text: \(string)") webSocketReceivedMessage(string) case .binary(let data): - print("Received data: \(data.count)") + //print("Received data: \(data.count)") case .ping(_): break case .pong(_): diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index f206ac2..f66e4f4 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.2" + s.version = "2.1.3" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From bdbd8baef86dd6655053fdb7fdd0e7c12b5bd31c Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Mon, 2 Mar 2020 14:58:17 +0700 Subject: [PATCH 05/31] fix public interface --- SignalR-Swift.xcodeproj/project.pbxproj | 4 ++-- SignalR-Swift/Transports/AutoTransport.swift | 2 +- SignalR-Swift/Transports/LongPollingTransport.swift | 4 ++++ SignalR-Swift/Transports/ServerSentEventsTransport.swift | 4 ++++ SignalR-Swift/Transports/WebSocketTransport.swift | 4 ++++ SignalRSwift.podspec | 2 +- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 25d6535..324c23b 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -671,7 +671,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.4; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -695,7 +695,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.2; + MARKETING_VERSION = 2.1.4; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/SignalR-Swift/Transports/AutoTransport.swift b/SignalR-Swift/Transports/AutoTransport.swift index 61ec1a4..4ab956f 100644 --- a/SignalR-Swift/Transports/AutoTransport.swift +++ b/SignalR-Swift/Transports/AutoTransport.swift @@ -22,7 +22,7 @@ public class AutoTransport: HttpTransport { self.init(withTransports: transports) } - init(withTransports transports: [ClientTransportProtocol]) { + public init(withTransports transports: [ClientTransportProtocol]) { self.transports = transports } diff --git a/SignalR-Swift/Transports/LongPollingTransport.swift b/SignalR-Swift/Transports/LongPollingTransport.swift index 445e1d7..9251662 100644 --- a/SignalR-Swift/Transports/LongPollingTransport.swift +++ b/SignalR-Swift/Transports/LongPollingTransport.swift @@ -14,6 +14,10 @@ public class LongPollingTransport: HttpTransport { var errorDelay = 2.0 var pollingQueue = DispatchQueue(label: "com.autosoftdms.SignalR-Swift.serial") + public override init() { + super.init() + } + // MARK: - Client Transport Protocol override public var name: String? { diff --git a/SignalR-Swift/Transports/ServerSentEventsTransport.swift b/SignalR-Swift/Transports/ServerSentEventsTransport.swift index 3353775..6eb840a 100644 --- a/SignalR-Swift/Transports/ServerSentEventsTransport.swift +++ b/SignalR-Swift/Transports/ServerSentEventsTransport.swift @@ -19,6 +19,10 @@ public class ServerSentEventsTransport: HttpTransport { var reconnectDelay: TimeInterval = 2.0 + public override init() { + super.init() + } + override public var name: String? { return "serverSentEvents" } diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index 74619b8..f3907d5 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -19,6 +19,10 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { private var startClosure: WebSocketStartClosure? private var connectTimeoutOperation: BlockOperation? + public override init() { + super.init() + } + override public var name: String? { return "webSockets" } diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index f66e4f4..9737cd1 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.3" + s.version = "2.1.4" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 732842a599370522f73b8bb67223409db1e0116d Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Mon, 2 Mar 2020 15:11:49 +0700 Subject: [PATCH 06/31] code fix --- SignalR-Swift.xcodeproj/project.pbxproj | 4 ++-- SignalR-Swift/Transports/WebSocketTransport.swift | 1 + SignalRSwift.podspec | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 324c23b..8a45632 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -671,7 +671,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.4; + MARKETING_VERSION = 2.1.5; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -695,7 +695,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.4; + MARKETING_VERSION = 2.1.5; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index f3907d5..2e8ba91 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -202,6 +202,7 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { webSocketReceivedMessage(string) case .binary(let data): //print("Received data: \(data.count)") + break case .ping(_): break case .pong(_): diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 9737cd1..2e2eb01 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.4" + s.version = "2.1.5" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From fa724f1ba40556abd788bd1e6c3472050f796cad Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 16 Apr 2020 10:27:43 +0700 Subject: [PATCH 07/31] update name --- Podfile.lock | 10 +++++----- SignalR-Swift-Example/Podfile.lock | 14 +++++++------- .../project.pbxproj | 2 -- SignalR-Swift/Transports/WebSocketTransport.swift | 2 +- SignalRSwift.podspec | 2 +- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 581282a..280ac2b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,9 +1,9 @@ PODS: - Alamofire (4.9.1) - Mockit (1.5.0) - - Nimble (8.0.5) + - Nimble (8.0.7) - Quick (2.2.0) - - Starscream (4.0.0) + - Starscream (4.0.3) DEPENDENCIES: - Alamofire @@ -23,10 +23,10 @@ SPEC REPOS: SPEC CHECKSUMS: Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 Mockit: 09492d654a2945096603d76ea77b131bdcfb2233 - Nimble: 4ab1aeb9b45553c75b9687196b0fa0713170a332 + Nimble: a73af6ecd4c9106f434f3d55fc54570be3739e0b Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e - Starscream: 04b26f02727e10a002e6b5d21b188ba0d049910b + Starscream: ef06f0961fff0880bca0604416d61141e4faca67 PODFILE CHECKSUM: fbb16c39d93e3b98af81f291ed56343951baef5b -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.1 diff --git a/SignalR-Swift-Example/Podfile.lock b/SignalR-Swift-Example/Podfile.lock index cdc5c2d..4ff97bd 100644 --- a/SignalR-Swift-Example/Podfile.lock +++ b/SignalR-Swift-Example/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - Alamofire (4.9.1) - - SignalRSwift (2.1.1): + - Alamofire (5.1.0) + - SignalRSwift (2.1.6): - Alamofire - Starscream - - Starscream (4.0.0) + - Starscream (4.0.3) DEPENDENCIES: - SignalRSwift (from `../`) @@ -18,10 +18,10 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 - SignalRSwift: 14b50492a093a8863aa9101e9ee02577d2e9dd0b - Starscream: 04b26f02727e10a002e6b5d21b188ba0d049910b + Alamofire: 9d5c5f602928e512395b30950c5984eca840093c + SignalRSwift: a9cb458342cb400e38243ac51b28121eb3563077 + Starscream: ef06f0961fff0880bca0604416d61141e4faca67 PODFILE CHECKSUM: 0b670b9c4ac8d7df99f98ba1a30595cebc4466a9 -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.1 diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj index 4a91ad1..8a66b78 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj @@ -27,7 +27,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 34C423C8415C9D7D709AF98C /* Pods_SignalR_Swift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4AC4142A6C198298FE587578 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; 4E6C9352E26E287BEDA458A8 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -67,7 +66,6 @@ 3074C68C23B280A1578C9624 /* Frameworks */ = { isa = PBXGroup; children = ( - 34C423C8415C9D7D709AF98C /* Pods_SignalR_Swift_Example.framework */, 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */, ); name = Frameworks; diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index 2e8ba91..825e75b 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -207,7 +207,7 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { break case .pong(_): break - case .viablityChanged(_): + case .viabilityChanged(_): break case .reconnectSuggested(_): break diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 2e2eb01..198fb2e 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.5" + s.version = "2.1.6" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 994dadee7c7d59ce8a24a077b461a078b35d65d3 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Sun, 30 Aug 2020 22:40:33 +0700 Subject: [PATCH 08/31] Updated for minimum iOS 10 version --- Podfile | 2 +- Podfile.lock | 20 +-- README.md | 6 +- SignalR-Swift-Example/Podfile | 2 +- SignalR-Swift-Example/Podfile.lock | 16 +-- .../project.pbxproj | 99 +++++++------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++ SignalR-Swift.xcodeproj/project.pbxproj | 121 +++++++++--------- SignalR-Swift/Client/Connection.swift | 39 +++--- SignalR-Swift/Client/Hubs/HubConnection.swift | 2 +- .../Client/Protocols/ConnectionProtocol.swift | 4 +- SignalR-Swift/Transports/HttpTransport.swift | 6 +- .../ServerSentEventsTransport.swift | 58 +++++---- .../Transports/WebSocketTransport.swift | 2 +- SignalRSwift.podspec | 4 +- 15 files changed, 219 insertions(+), 170 deletions(-) create mode 100644 SignalR-Swift-Example/SignalR-Swift-Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Podfile b/Podfile index c28c7c0..0665c33 100644 --- a/Podfile +++ b/Podfile @@ -1,5 +1,5 @@ # Uncomment the next line to define a global platform for your project -platform :ios, '9.0' +platform :ios, '10.0' target 'SignalRSwift' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks diff --git a/Podfile.lock b/Podfile.lock index 280ac2b..a86ed77 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - Alamofire (4.9.1) + - Alamofire (5.2.2) - Mockit (1.5.0) - - Nimble (8.0.7) - - Quick (2.2.0) - - Starscream (4.0.3) + - Nimble (8.1.1) + - Quick (3.0.0) + - Starscream (4.0.4) DEPENDENCIES: - Alamofire @@ -21,12 +21,12 @@ SPEC REPOS: - Starscream SPEC CHECKSUMS: - Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 + Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0 Mockit: 09492d654a2945096603d76ea77b131bdcfb2233 - Nimble: a73af6ecd4c9106f434f3d55fc54570be3739e0b - Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e - Starscream: ef06f0961fff0880bca0604416d61141e4faca67 + Nimble: 5f8a2fb6fa343a7242dfdd9d42f7267419d464b2 + Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2 + Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 -PODFILE CHECKSUM: fbb16c39d93e3b98af81f291ed56343951baef5b +PODFILE CHECKSUM: 8cfb1fef9f5267a2491b93bc836d7622db3f8310 -COCOAPODS: 1.9.1 +COCOAPODS: 1.9.3 diff --git a/README.md b/README.md index 51da561..5de65fe 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,13 @@ To integrate SignalR-Swift into your Xcode project using CocoaPods, specify it i ``` source 'https://github.com/kamrankhan07/SignalR-Swift.git' -platform :ios, '9.0' +platform :ios, '9.0' (2.1.6) +pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git', :tag => '2.1.6' + +platform :ios, '10.0' (onwards) pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git' + ``` Then, run the following command: diff --git a/SignalR-Swift-Example/Podfile b/SignalR-Swift-Example/Podfile index aa850b5..cddd0b3 100644 --- a/SignalR-Swift-Example/Podfile +++ b/SignalR-Swift-Example/Podfile @@ -1,5 +1,5 @@ # Uncomment the next line to define a global platform for your project -platform :ios, '10.3' +platform :ios, '10.0' target 'SignalR-Swift-Example' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks diff --git a/SignalR-Swift-Example/Podfile.lock b/SignalR-Swift-Example/Podfile.lock index 4ff97bd..591f5c1 100644 --- a/SignalR-Swift-Example/Podfile.lock +++ b/SignalR-Swift-Example/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - Alamofire (5.1.0) - - SignalRSwift (2.1.6): + - Alamofire (5.2.2) + - SignalRSwift (2.1.7): - Alamofire - Starscream - - Starscream (4.0.3) + - Starscream (4.0.4) DEPENDENCIES: - SignalRSwift (from `../`) @@ -18,10 +18,10 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - Alamofire: 9d5c5f602928e512395b30950c5984eca840093c - SignalRSwift: a9cb458342cb400e38243ac51b28121eb3563077 - Starscream: ef06f0961fff0880bca0604416d61141e4faca67 + Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0 + SignalRSwift: 3cd1c763f16006ad3dd7bec4fc48d32691937a91 + Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 -PODFILE CHECKSUM: 0b670b9c4ac8d7df99f98ba1a30595cebc4466a9 +PODFILE CHECKSUM: b21ec611911e40f8919863b5c067ce599c15f03e -COCOAPODS: 1.9.1 +COCOAPODS: 1.9.3 diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj index 8a66b78..f50c158 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj @@ -7,7 +7,8 @@ objects = { /* Begin PBXBuildFile section */ - B37FEE14B5F7CB4B84E4DAF7 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */; }; + 4220CD78A9BCF8D882BCC02A /* Pods_SignalR_Swift_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F3FB98223388C57BEE23DE4 /* Pods_SignalR_Swift_Example.framework */; }; + 54D992EE2714D32C58E29207 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 368B1196C6EFC915C5E758D8 /* Pods_SignalR_Swift_ExampleTests.framework */; }; C9E64D701E27DC3300DEDC20 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */; }; C9E64D721E27DC3300DEDC20 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D711E27DC3300DEDC20 /* ViewController.swift */; }; C9E64D771E27DC3300DEDC20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9E64D761E27DC3300DEDC20 /* Assets.xcassets */; }; @@ -27,11 +28,11 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 4AC4142A6C198298FE587578 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; - 4E6C9352E26E287BEDA458A8 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; - 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A99CC09EC2595A7FD1BA1510 /* Pods-SignalR-Swift-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.release.xcconfig"; sourceTree = ""; }; - C15CDE19EABC2C1FC1F180C6 /* Pods-SignalR-Swift-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.debug.xcconfig"; sourceTree = ""; }; + 05E37B89163869AF502F1CDF /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; + 0F3FB98223388C57BEE23DE4 /* Pods_SignalR_Swift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 368B1196C6EFC915C5E758D8 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 64FBD2AA863EBC1C6E5F1847 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; + 71D72D02CAC62F15659B33F8 /* Pods-SignalR-Swift-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.debug.xcconfig"; sourceTree = ""; }; C9E64D6C1E27DC3300DEDC20 /* SignalR-Swift-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SignalR-Swift-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C9E64D711E27DC3300DEDC20 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -42,6 +43,7 @@ C9E64D841E27DC3400DEDC20 /* SignalR_Swift_ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignalR_Swift_ExampleTests.swift; sourceTree = ""; }; C9E64D861E27DC3400DEDC20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C9E64D901E27E47800DEDC20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + DF6E88DA50252B1C671A3177 /* Pods-SignalR-Swift-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.release.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,6 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4220CD78A9BCF8D882BCC02A /* Pods_SignalR_Swift_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -56,30 +59,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B37FEE14B5F7CB4B84E4DAF7 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */, + 54D992EE2714D32C58E29207 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 3074C68C23B280A1578C9624 /* Frameworks */ = { + 886B7849965E5C3A8E3E1D7A /* Frameworks */ = { isa = PBXGroup; children = ( - 71A5F569092E83301B3A4D30 /* Pods_SignalR_Swift_ExampleTests.framework */, + 0F3FB98223388C57BEE23DE4 /* Pods_SignalR_Swift_Example.framework */, + 368B1196C6EFC915C5E758D8 /* Pods_SignalR_Swift_ExampleTests.framework */, ); name = Frameworks; sourceTree = ""; }; - 781EA09133FDDDA08190CC4A /* Pods */ = { + AA34610D67E363DB319A23F6 /* Pods */ = { isa = PBXGroup; children = ( - C15CDE19EABC2C1FC1F180C6 /* Pods-SignalR-Swift-Example.debug.xcconfig */, - A99CC09EC2595A7FD1BA1510 /* Pods-SignalR-Swift-Example.release.xcconfig */, - 4AC4142A6C198298FE587578 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */, - 4E6C9352E26E287BEDA458A8 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */, + 71D72D02CAC62F15659B33F8 /* Pods-SignalR-Swift-Example.debug.xcconfig */, + DF6E88DA50252B1C671A3177 /* Pods-SignalR-Swift-Example.release.xcconfig */, + 64FBD2AA863EBC1C6E5F1847 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */, + 05E37B89163869AF502F1CDF /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */, ); name = Pods; + path = Pods; sourceTree = ""; }; C9E64D631E27DC3300DEDC20 = { @@ -88,8 +93,8 @@ C9E64D6E1E27DC3300DEDC20 /* SignalR-Swift-Example */, C9E64D831E27DC3400DEDC20 /* SignalR-Swift-ExampleTests */, C9E64D6D1E27DC3300DEDC20 /* Products */, - 781EA09133FDDDA08190CC4A /* Pods */, - 3074C68C23B280A1578C9624 /* Frameworks */, + AA34610D67E363DB319A23F6 /* Pods */, + 886B7849965E5C3A8E3E1D7A /* Frameworks */, ); sourceTree = ""; }; @@ -131,11 +136,11 @@ isa = PBXNativeTarget; buildConfigurationList = C9E64D891E27DC3400DEDC20 /* Build configuration list for PBXNativeTarget "SignalR-Swift-Example" */; buildPhases = ( - 0C3202FEE06CE733AE264351 /* [CP] Check Pods Manifest.lock */, + 42C00E5E2B74186C5A2DE8AD /* [CP] Check Pods Manifest.lock */, C9E64D681E27DC3300DEDC20 /* Sources */, C9E64D691E27DC3300DEDC20 /* Frameworks */, C9E64D6A1E27DC3300DEDC20 /* Resources */, - 6F42A1175AEEF087513135D6 /* [CP] Embed Pods Frameworks */, + 8B56917674E1E95B61682FB0 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -150,7 +155,7 @@ isa = PBXNativeTarget; buildConfigurationList = C9E64D8C1E27DC3400DEDC20 /* Build configuration list for PBXNativeTarget "SignalR-Swift-ExampleTests" */; buildPhases = ( - B721394EE4F0D4E64AB5B418 /* [CP] Check Pods Manifest.lock */, + 1A821CDD21B22CE9CCFBF011 /* [CP] Check Pods Manifest.lock */, C9E64D7C1E27DC3400DEDC20 /* Sources */, C9E64D7D1E27DC3400DEDC20 /* Frameworks */, C9E64D7E1E27DC3400DEDC20 /* Resources */, @@ -228,62 +233,70 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0C3202FEE06CE733AE264351 /* [CP] Check Pods Manifest.lock */ = { + 1A821CDD21B22CE9CCFBF011 /* [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-SignalR-Swift-Example-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-SignalR-Swift-ExampleTests-checkManifestLockResult.txt", ); 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"; showEnvVarsInLog = 0; }; - 6F42A1175AEEF087513135D6 /* [CP] Embed Pods Frameworks */ = { + 42C00E5E2B74186C5A2DE8AD /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/SignalRSwift/SignalRSwift.framework", - "${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework", + "${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}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SignalRSwift.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework", + "$(DERIVED_FILE_DIR)/Pods-SignalR-Swift-Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example-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; }; - B721394EE4F0D4E64AB5B418 /* [CP] Check Pods Manifest.lock */ = { + 8B56917674E1E95B61682FB0 /* [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-SignalR-Swift-Example/Pods-SignalR-Swift-Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/SignalRSwift/SignalRSwift.framework", + "${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework", ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SignalR-Swift-ExampleTests-checkManifestLockResult.txt", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SignalRSwift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework", ); 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-SignalR-Swift-Example/Pods-SignalR-Swift-Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -385,7 +398,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -438,7 +451,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -449,7 +462,7 @@ }; C9E64D8A1E27DC3400DEDC20 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C15CDE19EABC2C1FC1F180C6 /* Pods-SignalR-Swift-Example.debug.xcconfig */; + baseConfigurationReference = 71D72D02CAC62F15659B33F8 /* Pods-SignalR-Swift-Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 8Z35TU97D6; @@ -463,7 +476,7 @@ }; C9E64D8B1E27DC3400DEDC20 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A99CC09EC2595A7FD1BA1510 /* Pods-SignalR-Swift-Example.release.xcconfig */; + baseConfigurationReference = DF6E88DA50252B1C671A3177 /* Pods-SignalR-Swift-Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 8Z35TU97D6; @@ -477,7 +490,7 @@ }; C9E64D8D1E27DC3400DEDC20 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4AC4142A6C198298FE587578 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */; + baseConfigurationReference = 64FBD2AA863EBC1C6E5F1847 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -493,7 +506,7 @@ }; C9E64D8E1E27DC3400DEDC20 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4E6C9352E26E287BEDA458A8 /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */; + baseConfigurationReference = 05E37B89163869AF502F1CDF /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SignalR-Swift-Example/SignalR-Swift-Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 8a45632..656913a 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -7,10 +7,11 @@ objects = { /* Begin PBXBuildFile section */ + 0336DFF91BB4140F617253C8 /* Pods_SignalR_SwiftTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0970B241C0D8413B8A9B8416 /* Pods_SignalR_SwiftTests.framework */; }; 563B87161F1FA11100D75CEF /* ServerSentEventsTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B87151F1FA11100D75CEF /* ServerSentEventsTransport.swift */; }; 568A77191F223CB2004F5D1C /* ChunkBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A77181F223CB2004F5D1C /* ChunkBuffer.swift */; }; 568A771B1F223CF0004F5D1C /* ServerSentEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A771A1F223CF0004F5D1C /* ServerSentEvent.swift */; }; - AA049197DB8438E88C7B3D5D /* Pods_SignalR_SwiftTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 291C54976E982A542BA4B4C3 /* Pods_SignalR_SwiftTests.framework */; }; + C6ECF8B6D4F0D63610024AB3 /* Pods_SignalRSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F3E2664EA9067DA3309A83A /* Pods_SignalRSwift.framework */; }; C91154631E24113F007C0DD9 /* WebSocketTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154621E24113F007C0DD9 /* WebSocketTransport.swift */; }; C91154661E241239007C0DD9 /* WebSocketConnectionInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154651E241239007C0DD9 /* WebSocketConnectionInfo.swift */; }; C91154681E243082007C0DD9 /* ReceivedMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154671E243082007C0DD9 /* ReceivedMessage.swift */; }; @@ -39,7 +40,6 @@ C9FC2D951E2025B80027FE59 /* AutoTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FC2D941E2025B80027FE59 /* AutoTransport.swift */; }; C9FC2D971E2025DB0027FE59 /* HttpTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FC2D961E2025DB0027FE59 /* HttpTransport.swift */; }; C9FC2D991E23BC600027FE59 /* ConnectionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */; }; - D7CF60613B31AC265821815F /* Pods_SignalRSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,14 +53,15 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 291C54976E982A542BA4B4C3 /* Pods_SignalR_SwiftTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_SwiftTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 42E40FC4FECA749AD861D67E /* Pods-SignalRSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.debug.xcconfig"; sourceTree = ""; }; + 0970B241C0D8413B8A9B8416 /* Pods_SignalR_SwiftTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_SwiftTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2EC113E2B99A23B23569B683 /* Pods-SignalR-SwiftTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.release.xcconfig"; sourceTree = ""; }; + 3019D93A3287DFB23C41B846 /* Pods-SignalR-SwiftTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.debug.xcconfig"; sourceTree = ""; }; + 49B5BB4A071DD8A199988E10 /* Pods-SignalRSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.debug.xcconfig"; path = "Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.debug.xcconfig"; sourceTree = ""; }; 563B87151F1FA11100D75CEF /* ServerSentEventsTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerSentEventsTransport.swift; sourceTree = ""; }; 568A77181F223CB2004F5D1C /* ChunkBuffer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ChunkBuffer.swift; path = "SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift"; sourceTree = SOURCE_ROOT; }; 568A771A1F223CF0004F5D1C /* ServerSentEvent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ServerSentEvent.swift; path = "SignalR-Swift/Transports/ServerSentEvents/ServerSentEvent.swift"; sourceTree = SOURCE_ROOT; }; - 65B59CFA9FAF15B46BDCDEC1 /* Pods-SignalR-SwiftTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.debug.xcconfig"; sourceTree = ""; }; - B5E080DF752A22D635CE38CF /* Pods-SignalR-SwiftTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.release.xcconfig"; sourceTree = ""; }; - B9B048FC932F5933F9447DCE /* Pods-SignalRSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.release.xcconfig"; sourceTree = ""; }; + 7F3E2664EA9067DA3309A83A /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BB9B649DF0F8A7E41F534F0A /* Pods-SignalRSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.release.xcconfig"; path = "Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.release.xcconfig"; sourceTree = ""; }; C91154621E24113F007C0DD9 /* WebSocketTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketTransport.swift; sourceTree = ""; }; C91154651E241239007C0DD9 /* WebSocketConnectionInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketConnectionInfo.swift; sourceTree = ""; }; C91154671E243082007C0DD9 /* ReceivedMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReceivedMessage.swift; sourceTree = ""; }; @@ -94,7 +95,6 @@ C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDelegate.swift; sourceTree = ""; }; CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SignalRSwift.podspec; sourceTree = ""; }; CE3269ED23F3B26B00B29F0F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -102,7 +102,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D7CF60613B31AC265821815F /* Pods_SignalRSwift.framework in Frameworks */, + C6ECF8B6D4F0D63610024AB3 /* Pods_SignalRSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -111,22 +111,13 @@ buildActionMask = 2147483647; files = ( C9330B321E1FE59A00B1F2D5 /* SignalRSwift.framework in Frameworks */, - AA049197DB8438E88C7B3D5D /* Pods_SignalR_SwiftTests.framework in Frameworks */, + 0336DFF91BB4140F617253C8 /* Pods_SignalR_SwiftTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 316A9BF3DEFAB629DD2C78FD /* Frameworks */ = { - isa = PBXGroup; - children = ( - E3DD50F71B5A709F5EC093E9 /* Pods_SignalRSwift.framework */, - 291C54976E982A542BA4B4C3 /* Pods_SignalR_SwiftTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 5686CBB81F7C03B3008CA187 /* ServerSentEvents */ = { isa = PBXGroup; children = ( @@ -136,15 +127,25 @@ path = ServerSentEvents; sourceTree = ""; }; - C4B90292188059B3970F0902 /* Pods */ = { + 89A6BE56D58C5D1F44B4C1F2 /* Pods */ = { isa = PBXGroup; children = ( - 65B59CFA9FAF15B46BDCDEC1 /* Pods-SignalR-SwiftTests.debug.xcconfig */, - B5E080DF752A22D635CE38CF /* Pods-SignalR-SwiftTests.release.xcconfig */, - 42E40FC4FECA749AD861D67E /* Pods-SignalRSwift.debug.xcconfig */, - B9B048FC932F5933F9447DCE /* Pods-SignalRSwift.release.xcconfig */, + 3019D93A3287DFB23C41B846 /* Pods-SignalR-SwiftTests.debug.xcconfig */, + 2EC113E2B99A23B23569B683 /* Pods-SignalR-SwiftTests.release.xcconfig */, + 49B5BB4A071DD8A199988E10 /* Pods-SignalRSwift.debug.xcconfig */, + BB9B649DF0F8A7E41F534F0A /* Pods-SignalRSwift.release.xcconfig */, ); name = Pods; + path = Pods; + sourceTree = ""; + }; + B7D1214F5724602EDD3E0C77 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0970B241C0D8413B8A9B8416 /* Pods_SignalR_SwiftTests.framework */, + 7F3E2664EA9067DA3309A83A /* Pods_SignalRSwift.framework */, + ); + name = Frameworks; sourceTree = ""; }; C911545F1E23D205007C0DD9 /* Models */ = { @@ -180,10 +181,10 @@ C9330B2A1E1FE59A00B1F2D5 /* SignalR-Swift */, C9330B351E1FE59A00B1F2D5 /* SignalR-SwiftTests */, C9330B291E1FE59A00B1F2D5 /* Products */, - C4B90292188059B3970F0902 /* Pods */, - 316A9BF3DEFAB629DD2C78FD /* Frameworks */, CE3269ED23F3B26B00B29F0F /* README.md */, CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */, + 89A6BE56D58C5D1F44B4C1F2 /* Pods */, + B7D1214F5724602EDD3E0C77 /* Frameworks */, ); sourceTree = ""; }; @@ -328,7 +329,7 @@ isa = PBXNativeTarget; buildConfigurationList = C9330B3C1E1FE59A00B1F2D5 /* Build configuration list for PBXNativeTarget "SignalRSwift" */; buildPhases = ( - 8893B2F1770B24873610B1CA /* [CP] Check Pods Manifest.lock */, + FF1C626F19D1E9D255108BAC /* [CP] Check Pods Manifest.lock */, C9330B231E1FE59A00B1F2D5 /* Sources */, C9330B241E1FE59A00B1F2D5 /* Frameworks */, C9330B251E1FE59A00B1F2D5 /* Headers */, @@ -347,11 +348,11 @@ isa = PBXNativeTarget; buildConfigurationList = C9330B3F1E1FE59A00B1F2D5 /* Build configuration list for PBXNativeTarget "SignalR-SwiftTests" */; buildPhases = ( - F71AD12E7750A42FE3671D48 /* [CP] Check Pods Manifest.lock */, + 196215561549F25403E8C35D /* [CP] Check Pods Manifest.lock */, C9330B2D1E1FE59A00B1F2D5 /* Sources */, C9330B2E1E1FE59A00B1F2D5 /* Frameworks */, C9330B2F1E1FE59A00B1F2D5 /* Resources */, - 1408BA98AFE158F7832B6F37 /* [CP] Embed Pods Frameworks */, + 8F3A2AB0DEBA64E63E054FE0 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -424,58 +425,66 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1408BA98AFE158F7832B6F37 /* [CP] Embed Pods Frameworks */ = { + 196215561549F25403E8C35D /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Mockit/Mockit.framework", - "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", - "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", + "${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}/Mockit.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", + "$(DERIVED_FILE_DIR)/Pods-SignalR-SwiftTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests-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; }; - 8893B2F1770B24873610B1CA /* [CP] Check Pods Manifest.lock */ = { + 8F3A2AB0DEBA64E63E054FE0 /* [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-SignalR-SwiftTests/Pods-SignalR-SwiftTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Mockit/Mockit.framework", + "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", + "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SignalRSwift-checkManifestLockResult.txt", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mockit.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", ); 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-SignalR-SwiftTests/Pods-SignalR-SwiftTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F71AD12E7750A42FE3671D48 /* [CP] Check Pods Manifest.lock */ = { + FF1C626F19D1E9D255108BAC /* [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-SignalR-SwiftTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-SignalRSwift-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -589,7 +598,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -645,7 +654,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -658,7 +667,7 @@ }; C9330B3D1E1FE59A00B1F2D5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 42E40FC4FECA749AD861D67E /* Pods-SignalRSwift.debug.xcconfig */; + baseConfigurationReference = 49B5BB4A071DD8A199988E10 /* Pods-SignalRSwift.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -669,9 +678,8 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "SignalR-Swift/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.5; + MARKETING_VERSION = 2.1.7; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -682,7 +690,7 @@ }; C9330B3E1E1FE59A00B1F2D5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B9B048FC932F5933F9447DCE /* Pods-SignalRSwift.release.xcconfig */; + baseConfigurationReference = BB9B649DF0F8A7E41F534F0A /* Pods-SignalRSwift.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; @@ -693,9 +701,8 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "SignalR-Swift/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.1.5; + MARKETING_VERSION = 2.1.7; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -705,7 +712,7 @@ }; C9330B401E1FE59A00B1F2D5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 65B59CFA9FAF15B46BDCDEC1 /* Pods-SignalR-SwiftTests.debug.xcconfig */; + baseConfigurationReference = 3019D93A3287DFB23C41B846 /* Pods-SignalR-SwiftTests.debug.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = 8Z35TU97D6; @@ -720,7 +727,7 @@ }; C9330B411E1FE59A00B1F2D5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B5E080DF752A22D635CE38CF /* Pods-SignalR-SwiftTests.release.xcconfig */; + baseConfigurationReference = 2EC113E2B99A23B23569B683 /* Pods-SignalR-SwiftTests.release.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = 8Z35TU97D6; diff --git a/SignalR-Swift/Client/Connection.swift b/SignalR-Swift/Client/Connection.swift index 917e91e..216a6f5 100644 --- a/SignalR-Swift/Client/Connection.swift +++ b/SignalR-Swift/Client/Connection.swift @@ -44,7 +44,7 @@ public class Connection: ConnectionProtocol { public var headers = HTTPHeaders() public var keepAliveData: KeepAliveData? public var webSocketAllowsSelfSignedSSL = true - public internal(set) var sessionManager: SessionManager + public internal(set) var sessionManager: Session public var transport: ClientTransportProtocol? public var transportConnectTimeout = 0.0 @@ -68,7 +68,7 @@ public class Connection: ConnectionProtocol { return connection.state == .reconnecting } - public init(withUrl url: String, queryString: [String: String]? = nil, sessionManager: SessionManager = .default) { + public init(withUrl url: String, queryString: [String: String]? = nil, sessionManager: Session = .default) { self.url = url.hasSuffix("/") ? url : url.appending("/") self.queryString = queryString self.sessionManager = sessionManager @@ -287,28 +287,35 @@ public class Connection: ConnectionProtocol { public func updateLastKeepAlive() { self.keepAliveData?.lastKeepAlive = Date() } - - public func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?) -> DataRequest { - return self.getRequest(url: url, httpMethod: httpMethod, encoding: encoding, parameters: parameters, timeout: 30.0, headers: [:]) - } - - public func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double) -> DataRequest { - return self.getRequest(url: url, httpMethod: httpMethod, encoding: encoding, parameters: parameters, timeout: timeout, headers: [:]) - } - public func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double, headers: HTTPHeaders) -> DataRequest { + private func encodedURLRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double, headers: HTTPHeaders) -> URLRequest? { var globalHeaders = self.headers globalHeaders["User-Agent"] = self.createUserAgentString(client: "SignalR.Client.iOS") - - for (httpHeader, value) in headers { + + for (httpHeader, value) in headers.dictionary { globalHeaders[httpHeader] = value } - + var urlRequest = try? URLRequest(url: url.asURL(), method: httpMethod, headers: globalHeaders) urlRequest?.timeoutInterval = timeout - + let encodedURLRequest = try? encoding.encode(urlRequest!, with: parameters) - return sessionManager.request(encodedURLRequest!) + return encodedURLRequest + } + + public func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?) -> DataRequest { + let request = encodedURLRequest(url: url, httpMethod: httpMethod, encoding: encoding, parameters: parameters, timeout: 30.0, headers: [:]) + return sessionManager.request(request!) + } + + public func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double) -> DataRequest { + let request = encodedURLRequest(url: url, httpMethod: httpMethod, encoding: encoding, parameters: parameters, timeout: timeout, headers: [:]) + return sessionManager.request(request!) + } + + public func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double, headers: HTTPHeaders) -> DataStreamRequest { + let request = encodedURLRequest(url: url, httpMethod: httpMethod, encoding: encoding, parameters: parameters, timeout: timeout, headers: headers) + return sessionManager.streamRequest(request!) } func createUserAgentString(client: String) -> String { diff --git a/SignalR-Swift/Client/Hubs/HubConnection.swift b/SignalR-Swift/Client/Hubs/HubConnection.swift index 39e8a18..e34951b 100644 --- a/SignalR-Swift/Client/Hubs/HubConnection.swift +++ b/SignalR-Swift/Client/Hubs/HubConnection.swift @@ -17,7 +17,7 @@ public class HubConnection: Connection, HubConnectionProtocol { public init(withUrl url: String, queryString: [String: String]? = nil, - sessionManager: SessionManager = .default, + sessionManager: Session = .default, useDefault: Bool = true) { super.init(withUrl: HubConnection.getUrl(url: url, useDefault: useDefault), queryString: queryString, diff --git a/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift b/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift index 517c1d0..62ec9ee 100644 --- a/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift +++ b/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift @@ -24,7 +24,7 @@ public protocol ConnectionProtocol: class { var state: ConnectionState { get } var transport: ClientTransportProtocol? { get } var headers: HTTPHeaders { get set } - var sessionManager: SessionManager { get } + var sessionManager: Session { get } var webSocketAllowsSelfSignedSSL: Bool { get set } func onSending() -> String? @@ -45,6 +45,6 @@ public protocol ConnectionProtocol: class { func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?) -> DataRequest func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double) -> DataRequest - func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double, headers: HTTPHeaders) -> DataRequest + func getRequest(url: URLConvertible, httpMethod: HTTPMethod, encoding: ParameterEncoding, parameters: Parameters?, timeout: Double, headers: HTTPHeaders) -> DataStreamRequest func processResponse(response: Data, shouldReconnect: inout Bool, disconnected: inout Bool) } diff --git a/SignalR-Swift/Transports/HttpTransport.swift b/SignalR-Swift/Transports/HttpTransport.swift index dc6abd6..c547d09 100644 --- a/SignalR-Swift/Transports/HttpTransport.swift +++ b/SignalR-Swift/Transports/HttpTransport.swift @@ -28,14 +28,14 @@ public class HttpTransport: ClientTransportProtocol { let encodedRequest = connection.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 30.0) - encodedRequest.validate().responseJSON { (response: DataResponse) in + encodedRequest.validate().responseJSON { (response: DataResponse) in switch response.result { case .success(let result): if let json = result as? [String: Any] { completionHandler?(NegotiationResponse(jsonObject: json), nil) } else { - completionHandler?(nil, AFError.responseSerializationFailed(reason: .inputDataNil)) + completionHandler?(nil, AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) } case .failure(let error): completionHandler?(nil, error) @@ -68,7 +68,7 @@ public class HttpTransport: ClientTransportProtocol { } let request = connection.getRequest(url: encodedRequestURL, httpMethod: .post, encoding: URLEncoding.httpBody, parameters: requestParams) - request.validate().responseJSON { (response: DataResponse) in + request.validate().responseJSON { (response: DataResponse) in switch response.result { case .success(let result): connection.didReceiveData(data: result) diff --git a/SignalR-Swift/Transports/ServerSentEventsTransport.swift b/SignalR-Swift/Transports/ServerSentEventsTransport.swift index 6eb840a..4699384 100644 --- a/SignalR-Swift/Transports/ServerSentEventsTransport.swift +++ b/SignalR-Swift/Transports/ServerSentEventsTransport.swift @@ -89,31 +89,41 @@ public class ServerSentEventsTransport: HttpTransport { parameters: parameters, timeout: 240, headers: ["Connection": "Keep-Alive"]) - .stream { [weak self] data in - self?.sseQueue.async { [weak connection] in - guard let strongSelf = self, let strongConnection = connection else { return } - - strongSelf.buffer.append(data: data) - - while let line = strongSelf.buffer.readLine() { - guard let message = ServerSentEvent.tryParse(line: line) else { continue } - DispatchQueue.main.async { strongSelf.process(message: message, connection: strongConnection) } + .validate() + .responseStream { [weak self, weak connection] stream in + switch stream.event { + + case let .stream(result): + if case let .success(data) = result { + self?.sseQueue.async { [weak connection] in + guard let strongSelf = self, let strongConnection = connection else { return } + + strongSelf.buffer.append(data: data) + + while let line = strongSelf.buffer.readLine() { + guard let message = ServerSentEvent.tryParse(line: line) else { continue } + DispatchQueue.main.async { strongSelf.process(message: message, connection: strongConnection) } + } + } + } + + case let .complete(completion): + + guard let strongSelf = self, let strongConnection = connection else { return } + + strongSelf.cancelTimeoutOperation() + + if let error = completion.error as NSError?, error.code != NSURLErrorCancelled { + strongConnection.didReceiveError(error: error) + } + + if strongSelf.stop { + strongSelf.completeAbort() + } else if !strongSelf.tryCompleteAbort() && !isReconnecting { + strongSelf.reconnect(connection: strongConnection, data: connectionData) + } + } - } - }.validate().response() { [weak self, weak connection] dataResponse in - guard let strongSelf = self, let strongConnection = connection else { return } - - strongSelf.cancelTimeoutOperation() - - if let error = dataResponse.error as NSError?, error.code != NSURLErrorCancelled { - strongConnection.didReceiveError(error: error) - } - - if strongSelf.stop { - strongSelf.completeAbort() - } else if !strongSelf.tryCompleteAbort() && !isReconnecting { - strongSelf.reconnect(connection: strongConnection, data: connectionData) - } } } diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index 825e75b..971521b 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -200,7 +200,7 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { case .text(let string): //print("Received text: \(string)") webSocketReceivedMessage(string) - case .binary(let data): + case .binary(_): //print("Received data: \(data.count)") break case .ping(_): diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 198fb2e..7b1ebc2 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.6" + s.version = "2.1.7" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. @@ -57,7 +57,7 @@ Pod::Spec.new do |s| # the deployment target. You can optionally include the target after the platform. # - s.platform = :ios, "9.0" + s.platform = :ios, "10.0" s.source = { :git => "https://github.com/AutosoftDMS/SignalR-Swift.git", :tag => "#{s.version}" } From 5f2eb11fd0dde23f036fe95e60eeddc3c3ade622 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Mon, 27 Sep 2021 20:46:47 +0700 Subject: [PATCH 09/31] Swift 5.5 update --- Podfile.lock | 14 +++++------ SignalR-Swift-Example/Podfile.lock | 10 ++++---- .../project.pbxproj | 23 ++++++++----------- .../SignalR-Swift-Example/AppDelegate.swift | 2 +- .../ViewController.swift | 2 +- SignalR-Swift.xcodeproj/project.pbxproj | 13 +++-------- .../Client/Protocols/ConnectionDelegate.swift | 2 +- .../Client/Protocols/ConnectionProtocol.swift | 2 +- SignalR-Swift/Transports/HttpTransport.swift | 4 ++++ .../Transports/LongPollingTransport.swift | 4 ++-- .../ServerSentEventsTransport.swift | 2 +- .../Transports/WebSocketTransport.swift | 2 +- SignalRSwift.podspec | 2 +- 13 files changed, 37 insertions(+), 45 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index a86ed77..82d204c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,8 +1,8 @@ PODS: - - Alamofire (5.2.2) + - Alamofire (5.4.4) - Mockit (1.5.0) - - Nimble (8.1.1) - - Quick (3.0.0) + - Nimble (9.2.1) + - Quick (4.0.0) - Starscream (4.0.4) DEPENDENCIES: @@ -21,12 +21,12 @@ SPEC REPOS: - Starscream SPEC CHECKSUMS: - Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0 + Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9 Mockit: 09492d654a2945096603d76ea77b131bdcfb2233 - Nimble: 5f8a2fb6fa343a7242dfdd9d42f7267419d464b2 - Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2 + Nimble: e7e615c0335ee4bf5b0d786685451e62746117d5 + Quick: 6473349e43b9271a8d43839d9ba1c442ed1b7ac4 Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 PODFILE CHECKSUM: 8cfb1fef9f5267a2491b93bc836d7622db3f8310 -COCOAPODS: 1.9.3 +COCOAPODS: 1.11.2 diff --git a/SignalR-Swift-Example/Podfile.lock b/SignalR-Swift-Example/Podfile.lock index 591f5c1..d99c786 100644 --- a/SignalR-Swift-Example/Podfile.lock +++ b/SignalR-Swift-Example/Podfile.lock @@ -1,6 +1,6 @@ PODS: - - Alamofire (5.2.2) - - SignalRSwift (2.1.7): + - Alamofire (5.4.4) + - SignalRSwift (2.1.8): - Alamofire - Starscream - Starscream (4.0.4) @@ -18,10 +18,10 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0 - SignalRSwift: 3cd1c763f16006ad3dd7bec4fc48d32691937a91 + Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9 + SignalRSwift: 08ba81a0bd2aeab9941e3cbf29237674edcde493 Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 PODFILE CHECKSUM: b21ec611911e40f8919863b5c067ce599c15f03e -COCOAPODS: 1.9.3 +COCOAPODS: 1.11.2 diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj index f50c158..b3ccebb 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj @@ -7,8 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 4220CD78A9BCF8D882BCC02A /* Pods_SignalR_Swift_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F3FB98223388C57BEE23DE4 /* Pods_SignalR_Swift_Example.framework */; }; - 54D992EE2714D32C58E29207 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 368B1196C6EFC915C5E758D8 /* Pods_SignalR_Swift_ExampleTests.framework */; }; C9E64D701E27DC3300DEDC20 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */; }; C9E64D721E27DC3300DEDC20 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D711E27DC3300DEDC20 /* ViewController.swift */; }; C9E64D771E27DC3300DEDC20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9E64D761E27DC3300DEDC20 /* Assets.xcassets */; }; @@ -29,8 +27,6 @@ /* Begin PBXFileReference section */ 05E37B89163869AF502F1CDF /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; - 0F3FB98223388C57BEE23DE4 /* Pods_SignalR_Swift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 368B1196C6EFC915C5E758D8 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 64FBD2AA863EBC1C6E5F1847 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; 71D72D02CAC62F15659B33F8 /* Pods-SignalR-Swift-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.debug.xcconfig"; sourceTree = ""; }; C9E64D6C1E27DC3300DEDC20 /* SignalR-Swift-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SignalR-Swift-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -51,7 +47,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4220CD78A9BCF8D882BCC02A /* Pods_SignalR_Swift_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -59,7 +54,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 54D992EE2714D32C58E29207 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -69,8 +63,6 @@ 886B7849965E5C3A8E3E1D7A /* Frameworks */ = { isa = PBXGroup; children = ( - 0F3FB98223388C57BEE23DE4 /* Pods_SignalR_Swift_Example.framework */, - 368B1196C6EFC915C5E758D8 /* Pods_SignalR_Swift_ExampleTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -83,7 +75,6 @@ 64FBD2AA863EBC1C6E5F1847 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */, 05E37B89163869AF502F1CDF /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -177,7 +168,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = "Jordan Camara"; TargetAttributes = { C9E64D6B1E27DC3300DEDC20 = { @@ -374,6 +365,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -404,6 +396,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -433,6 +426,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -455,6 +449,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -470,7 +465,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -484,7 +479,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -499,7 +494,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift-ExampleTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SignalR-Swift-Example.app/SignalR-Swift-Example"; }; name = Debug; @@ -515,7 +510,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift-ExampleTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SignalR-Swift-Example.app/SignalR-Swift-Example"; }; name = Release; diff --git a/SignalR-Swift-Example/SignalR-Swift-Example/AppDelegate.swift b/SignalR-Swift-Example/SignalR-Swift-Example/AppDelegate.swift index abe746a..ca04448 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example/AppDelegate.swift +++ b/SignalR-Swift-Example/SignalR-Swift-Example/AppDelegate.swift @@ -14,7 +14,7 @@ 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 { // Override point for customization after application launch. return true } diff --git a/SignalR-Swift-Example/SignalR-Swift-Example/ViewController.swift b/SignalR-Swift-Example/SignalR-Swift-Example/ViewController.swift index 33c9020..2b658b9 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example/ViewController.swift +++ b/SignalR-Swift-Example/SignalR-Swift-Example/ViewController.swift @@ -101,7 +101,7 @@ class ViewController: UIViewController { @IBAction func send(_ sender: AnyObject?) { if let hub = chatHub, let message = messageTextField.text { - hub.invoke(method: "send", withArgs: [name, message]) + hub.invoke(method: "send", withArgs: [name ?? "Name: ", message]) } messageTextField.resignFirstResponder() } diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 656913a..58952c8 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -7,11 +7,9 @@ objects = { /* Begin PBXBuildFile section */ - 0336DFF91BB4140F617253C8 /* Pods_SignalR_SwiftTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0970B241C0D8413B8A9B8416 /* Pods_SignalR_SwiftTests.framework */; }; 563B87161F1FA11100D75CEF /* ServerSentEventsTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B87151F1FA11100D75CEF /* ServerSentEventsTransport.swift */; }; 568A77191F223CB2004F5D1C /* ChunkBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A77181F223CB2004F5D1C /* ChunkBuffer.swift */; }; 568A771B1F223CF0004F5D1C /* ServerSentEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A771A1F223CF0004F5D1C /* ServerSentEvent.swift */; }; - C6ECF8B6D4F0D63610024AB3 /* Pods_SignalRSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F3E2664EA9067DA3309A83A /* Pods_SignalRSwift.framework */; }; C91154631E24113F007C0DD9 /* WebSocketTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154621E24113F007C0DD9 /* WebSocketTransport.swift */; }; C91154661E241239007C0DD9 /* WebSocketConnectionInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154651E241239007C0DD9 /* WebSocketConnectionInfo.swift */; }; C91154681E243082007C0DD9 /* ReceivedMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154671E243082007C0DD9 /* ReceivedMessage.swift */; }; @@ -53,14 +51,12 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 0970B241C0D8413B8A9B8416 /* Pods_SignalR_SwiftTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_SwiftTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2EC113E2B99A23B23569B683 /* Pods-SignalR-SwiftTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.release.xcconfig"; sourceTree = ""; }; 3019D93A3287DFB23C41B846 /* Pods-SignalR-SwiftTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.debug.xcconfig"; sourceTree = ""; }; 49B5BB4A071DD8A199988E10 /* Pods-SignalRSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.debug.xcconfig"; path = "Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.debug.xcconfig"; sourceTree = ""; }; 563B87151F1FA11100D75CEF /* ServerSentEventsTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerSentEventsTransport.swift; sourceTree = ""; }; 568A77181F223CB2004F5D1C /* ChunkBuffer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ChunkBuffer.swift; path = "SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift"; sourceTree = SOURCE_ROOT; }; 568A771A1F223CF0004F5D1C /* ServerSentEvent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ServerSentEvent.swift; path = "SignalR-Swift/Transports/ServerSentEvents/ServerSentEvent.swift"; sourceTree = SOURCE_ROOT; }; - 7F3E2664EA9067DA3309A83A /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BB9B649DF0F8A7E41F534F0A /* Pods-SignalRSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.release.xcconfig"; path = "Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.release.xcconfig"; sourceTree = ""; }; C91154621E24113F007C0DD9 /* WebSocketTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketTransport.swift; sourceTree = ""; }; C91154651E241239007C0DD9 /* WebSocketConnectionInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketConnectionInfo.swift; sourceTree = ""; }; @@ -102,7 +98,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C6ECF8B6D4F0D63610024AB3 /* Pods_SignalRSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -111,7 +106,6 @@ buildActionMask = 2147483647; files = ( C9330B321E1FE59A00B1F2D5 /* SignalRSwift.framework in Frameworks */, - 0336DFF91BB4140F617253C8 /* Pods_SignalR_SwiftTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -135,15 +129,12 @@ 49B5BB4A071DD8A199988E10 /* Pods-SignalRSwift.debug.xcconfig */, BB9B649DF0F8A7E41F534F0A /* Pods-SignalRSwift.release.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; B7D1214F5724602EDD3E0C77 /* Frameworks */ = { isa = PBXGroup; children = ( - 0970B241C0D8413B8A9B8416 /* Pods_SignalR_SwiftTests.framework */, - 7F3E2664EA9067DA3309A83A /* Pods_SignalRSwift.framework */, ); name = Frameworks; sourceTree = ""; @@ -371,7 +362,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = "Jordan Camara"; TargetAttributes = { C9330B271E1FE59A00B1F2D5 = { @@ -573,6 +564,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -635,6 +627,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; diff --git a/SignalR-Swift/Client/Protocols/ConnectionDelegate.swift b/SignalR-Swift/Client/Protocols/ConnectionDelegate.swift index 9d81796..7e4203b 100644 --- a/SignalR-Swift/Client/Protocols/ConnectionDelegate.swift +++ b/SignalR-Swift/Client/Protocols/ConnectionDelegate.swift @@ -8,7 +8,7 @@ import Foundation -protocol ConnectionDelegate: class { +protocol ConnectionDelegate: AnyObject { func connectionDidOpen(connection: ConnectionProtocol) func connectionDidClose(connection: ConnectionProtocol) func connectionWillReconnect(connection: ConnectionProtocol) diff --git a/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift b/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift index 62ec9ee..6cdb1db 100644 --- a/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift +++ b/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift @@ -10,7 +10,7 @@ import Foundation import UIKit import Alamofire -public protocol ConnectionProtocol: class { +public protocol ConnectionProtocol: AnyObject { var version: Version { get set } var transportConnectTimeout: Double { get set } var keepAliveData: KeepAliveData? { get set } diff --git a/SignalR-Swift/Transports/HttpTransport.swift b/SignalR-Swift/Transports/HttpTransport.swift index c547d09..75df25b 100644 --- a/SignalR-Swift/Transports/HttpTransport.swift +++ b/SignalR-Swift/Transports/HttpTransport.swift @@ -27,6 +27,10 @@ public class HttpTransport: ClientTransportProtocol { let parameters = self.getConnectionParameters(connection: connection, connectionData: connectionData) let encodedRequest = connection.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 30.0) + + encodedRequest.responseJSON { (response) in + print(response.debugDescription) + } encodedRequest.validate().responseJSON { (response: DataResponse) in switch response.result { diff --git a/SignalR-Swift/Transports/LongPollingTransport.swift b/SignalR-Swift/Transports/LongPollingTransport.swift index 9251662..169b337 100644 --- a/SignalR-Swift/Transports/LongPollingTransport.swift +++ b/SignalR-Swift/Transports/LongPollingTransport.swift @@ -122,7 +122,7 @@ public class LongPollingTransport: HttpTransport { canReconnect = true - _ = BlockOperation(block: { + BlockOperation(block: { strongSelf.poll(connection: strongConnection, connectionData: connectionData, completionHandler: nil) }).perform(#selector(BlockOperation.start), with: nil, afterDelay: strongSelf.errorDelay) } else { @@ -142,7 +142,7 @@ public class LongPollingTransport: HttpTransport { if canReconnect { canReconnect = false - _ = BlockOperation(block: { [weak self, weak connection] in + BlockOperation(block: { [weak self, weak connection] in guard let strongSelf = self, let strongConnection = connection else { return } strongSelf.connectionReconnect(connection: strongConnection, canReconnect: canReconnectCopy) }).perform(#selector(BlockOperation.start), with: nil, afterDelay: self.reconnectDelay) diff --git a/SignalR-Swift/Transports/ServerSentEventsTransport.swift b/SignalR-Swift/Transports/ServerSentEventsTransport.swift index 4699384..d437c15 100644 --- a/SignalR-Swift/Transports/ServerSentEventsTransport.swift +++ b/SignalR-Swift/Transports/ServerSentEventsTransport.swift @@ -163,7 +163,7 @@ public class ServerSentEventsTransport: HttpTransport { } private func reconnect(connection: ConnectionProtocol, data: String?) { - _ = BlockOperation { [weak self, weak connection] in + BlockOperation { [weak self, weak connection] in if let strongSelf = self, let strongConnection = connection, strongConnection.state != .disconnected, Connection.ensureReconnecting(connection: strongConnection) { strongSelf.open(connection: strongConnection, connectionData: data, isReconnecting: true) diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index 971521b..09e5545 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -138,7 +138,7 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { } func reconnect(connection: ConnectionProtocol?) { - _ = BlockOperation { [weak self] in + BlockOperation { [weak self] in if let strongSelf = self, let connection = connection, Connection.ensureReconnecting(connection: connection) { strongSelf.performConnect(reconnecting: true, completionHandler: nil) } diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 7b1ebc2..c3929f2 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.7" + s.version = "2.1.8" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From ac1adb82bfbe4760b089d8dfd72cb4c7653c22a7 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 00:05:21 +0700 Subject: [PATCH 10/31] Swift version update + podspec update --- Podfile | 2 +- .../project.pbxproj | 8 ++++++++ SignalR-Swift.xcodeproj/project.pbxproj | 18 ++++++++++++++---- SignalR-Swift/Client/Connection.swift | 4 +++- SignalR-Swift/Transports/AutoTransport.swift | 2 +- .../ServerSentEvents/ChunkBuffer.swift | 2 +- SignalRSwift.podspec | 2 +- 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Podfile b/Podfile index 0665c33..cb01dae 100644 --- a/Podfile +++ b/Podfile @@ -7,7 +7,7 @@ target 'SignalRSwift' do # Pods for SignalR-Swift pod 'Alamofire' - pod 'Starscream' + pod 'Starscream', :git => 'https://github.com/kamrankhan07/Starscream.git' target 'SignalR-SwiftTests' do inherit! :search_paths diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj index b3ccebb..a58b739 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 8045ED75F42A9C4443F08EF0 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F38BF701DB154B564C2657C7 /* Pods_SignalR_Swift_ExampleTests.framework */; }; + C9A0B2B8AB9CB9D8FF33FC6C /* Pods_SignalR_Swift_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C17ABC7303FABDDF9430F0D /* Pods_SignalR_Swift_Example.framework */; }; C9E64D701E27DC3300DEDC20 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */; }; C9E64D721E27DC3300DEDC20 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D711E27DC3300DEDC20 /* ViewController.swift */; }; C9E64D771E27DC3300DEDC20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9E64D761E27DC3300DEDC20 /* Assets.xcassets */; }; @@ -29,6 +31,7 @@ 05E37B89163869AF502F1CDF /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; 64FBD2AA863EBC1C6E5F1847 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; 71D72D02CAC62F15659B33F8 /* Pods-SignalR-Swift-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.debug.xcconfig"; sourceTree = ""; }; + 9C17ABC7303FABDDF9430F0D /* Pods_SignalR_Swift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C9E64D6C1E27DC3300DEDC20 /* SignalR-Swift-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SignalR-Swift-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C9E64D711E27DC3300DEDC20 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -40,6 +43,7 @@ C9E64D861E27DC3400DEDC20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C9E64D901E27E47800DEDC20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; DF6E88DA50252B1C671A3177 /* Pods-SignalR-Swift-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.release.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.release.xcconfig"; sourceTree = ""; }; + F38BF701DB154B564C2657C7 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -47,6 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C9A0B2B8AB9CB9D8FF33FC6C /* Pods_SignalR_Swift_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -54,6 +59,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8045ED75F42A9C4443F08EF0 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -63,6 +69,8 @@ 886B7849965E5C3A8E3E1D7A /* Frameworks */ = { isa = PBXGroup; children = ( + 9C17ABC7303FABDDF9430F0D /* Pods_SignalR_Swift_Example.framework */, + F38BF701DB154B564C2657C7 /* Pods_SignalR_Swift_ExampleTests.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 58952c8..02682bb 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -10,6 +10,8 @@ 563B87161F1FA11100D75CEF /* ServerSentEventsTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B87151F1FA11100D75CEF /* ServerSentEventsTransport.swift */; }; 568A77191F223CB2004F5D1C /* ChunkBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A77181F223CB2004F5D1C /* ChunkBuffer.swift */; }; 568A771B1F223CF0004F5D1C /* ServerSentEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A771A1F223CF0004F5D1C /* ServerSentEvent.swift */; }; + 998A0F2C310CFB059B3A78D4 /* Pods_SignalRSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27052D99CE4489E31D3864D7 /* Pods_SignalRSwift.framework */; }; + A73138179358423839ADF882 /* Pods_SignalR_SwiftTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AEBF31FDC80F00C1212830C /* Pods_SignalR_SwiftTests.framework */; }; C91154631E24113F007C0DD9 /* WebSocketTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154621E24113F007C0DD9 /* WebSocketTransport.swift */; }; C91154661E241239007C0DD9 /* WebSocketConnectionInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154651E241239007C0DD9 /* WebSocketConnectionInfo.swift */; }; C91154681E243082007C0DD9 /* ReceivedMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154671E243082007C0DD9 /* ReceivedMessage.swift */; }; @@ -51,6 +53,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 27052D99CE4489E31D3864D7 /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2AEBF31FDC80F00C1212830C /* Pods_SignalR_SwiftTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_SwiftTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2EC113E2B99A23B23569B683 /* Pods-SignalR-SwiftTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.release.xcconfig"; sourceTree = ""; }; 3019D93A3287DFB23C41B846 /* Pods-SignalR-SwiftTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.debug.xcconfig"; sourceTree = ""; }; 49B5BB4A071DD8A199988E10 /* Pods-SignalRSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.debug.xcconfig"; path = "Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.debug.xcconfig"; sourceTree = ""; }; @@ -98,6 +102,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 998A0F2C310CFB059B3A78D4 /* Pods_SignalRSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -106,6 +111,7 @@ buildActionMask = 2147483647; files = ( C9330B321E1FE59A00B1F2D5 /* SignalRSwift.framework in Frameworks */, + A73138179358423839ADF882 /* Pods_SignalR_SwiftTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -135,6 +141,8 @@ B7D1214F5724602EDD3E0C77 /* Frameworks */ = { isa = PBXGroup; children = ( + 2AEBF31FDC80F00C1212830C /* Pods_SignalR_SwiftTests.framework */, + 27052D99CE4489E31D3864D7 /* Pods_SignalRSwift.framework */, ); name = Frameworks; sourceTree = ""; @@ -596,6 +604,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -651,6 +660,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -677,7 +687,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -699,7 +709,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -714,7 +724,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-SwiftTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -728,7 +738,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.autosoftdms.SignalR-SwiftTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/SignalR-Swift/Client/Connection.swift b/SignalR-Swift/Client/Connection.swift index 216a6f5..a1251d1 100644 --- a/SignalR-Swift/Client/Connection.swift +++ b/SignalR-Swift/Client/Connection.swift @@ -258,7 +258,9 @@ public class Connection: ConnectionProtocol { } public func didReconnect() { - NSObject.cancelPreviousPerformRequests(withTarget: self.disconnectTimeoutOperation, selector: #selector(BlockOperation.start), object: nil) + if let operation = disconnectTimeoutOperation { + NSObject.cancelPreviousPerformRequests(withTarget: operation, selector: #selector(BlockOperation.start), object: nil) + } self.disconnectTimeoutOperation = nil self.reconnected?() diff --git a/SignalR-Swift/Transports/AutoTransport.swift b/SignalR-Swift/Transports/AutoTransport.swift index 4ab956f..19632a1 100644 --- a/SignalR-Swift/Transports/AutoTransport.swift +++ b/SignalR-Swift/Transports/AutoTransport.swift @@ -42,7 +42,7 @@ public class AutoTransport: HttpTransport { if error == nil, let tryWebSockets = response?.tryWebSockets, !tryWebSockets, - let invalidIndex = strongRef.transports.index(where: { $0.name == "webSockets" }) { + let invalidIndex = strongRef.transports.firstIndex(where: { $0.name == "webSockets" }) { strongRef.transports.remove(at: invalidIndex) } diff --git a/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift b/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift index a4a37a8..72c7bc4 100644 --- a/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift +++ b/SignalR-Swift/Transports/ServerSentEvents/ChunkBuffer.swift @@ -23,7 +23,7 @@ final class ChunkBuffer { func readLine() -> String? { var line: String? - while let endIndex = buffer.index(of: "\n") ?? buffer.index(of: "\r\n") { + while let endIndex = buffer.firstIndex(of: "\n") ?? buffer.firstIndex(of: "\r\n") { let substring = buffer[.. Date: Tue, 28 Sep 2021 01:23:50 +0700 Subject: [PATCH 11/31] fixes --- Podfile.lock | 18 ++-- SignalR-Swift-Example/Podfile.lock | 4 +- .../project.pbxproj | 8 -- .../xcschemes/SignalR-Swift-Example.xcscheme | 88 +++++++++++++++++++ SignalR-Swift.xcodeproj/project.pbxproj | 8 -- .../Transports/WebSocketTransport.swift | 17 ++-- SignalRSwift.podspec | 2 +- 7 files changed, 113 insertions(+), 32 deletions(-) create mode 100644 SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/xcshareddata/xcschemes/SignalR-Swift-Example.xcscheme diff --git a/Podfile.lock b/Podfile.lock index 82d204c..8216d12 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -3,14 +3,14 @@ PODS: - Mockit (1.5.0) - Nimble (9.2.1) - Quick (4.0.0) - - Starscream (4.0.4) + - Starscream (4.0.4.1) DEPENDENCIES: - Alamofire - Mockit - Nimble - Quick - - Starscream + - Starscream (from `https://github.com/kamrankhan07/Starscream.git`) SPEC REPOS: trunk: @@ -18,15 +18,23 @@ SPEC REPOS: - Mockit - Nimble - Quick - - Starscream + +EXTERNAL SOURCES: + Starscream: + :git: https://github.com/kamrankhan07/Starscream.git + +CHECKOUT OPTIONS: + Starscream: + :commit: 99bc549b6e2c3d7ddc6ccb7ca0aecaff8b745a6c + :git: https://github.com/kamrankhan07/Starscream.git SPEC CHECKSUMS: Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9 Mockit: 09492d654a2945096603d76ea77b131bdcfb2233 Nimble: e7e615c0335ee4bf5b0d786685451e62746117d5 Quick: 6473349e43b9271a8d43839d9ba1c442ed1b7ac4 - Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 + Starscream: 88daa4735c36fd75a3e609af08ca5081f0f2c377 -PODFILE CHECKSUM: 8cfb1fef9f5267a2491b93bc836d7622db3f8310 +PODFILE CHECKSUM: 54cea80c0b7fcd8f0543026a052ccbd7d232a0d1 COCOAPODS: 1.11.2 diff --git a/SignalR-Swift-Example/Podfile.lock b/SignalR-Swift-Example/Podfile.lock index d99c786..d713c0c 100644 --- a/SignalR-Swift-Example/Podfile.lock +++ b/SignalR-Swift-Example/Podfile.lock @@ -1,6 +1,6 @@ PODS: - Alamofire (5.4.4) - - SignalRSwift (2.1.8): + - SignalRSwift (2.1.9): - Alamofire - Starscream - Starscream (4.0.4) @@ -19,7 +19,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9 - SignalRSwift: 08ba81a0bd2aeab9941e3cbf29237674edcde493 + SignalRSwift: e1e4a08c45e9c6dcaa7e126c8c57fed0e7c93efa Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 PODFILE CHECKSUM: b21ec611911e40f8919863b5c067ce599c15f03e diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj index a58b739..b3ccebb 100644 --- a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/project.pbxproj @@ -7,8 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 8045ED75F42A9C4443F08EF0 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F38BF701DB154B564C2657C7 /* Pods_SignalR_Swift_ExampleTests.framework */; }; - C9A0B2B8AB9CB9D8FF33FC6C /* Pods_SignalR_Swift_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C17ABC7303FABDDF9430F0D /* Pods_SignalR_Swift_Example.framework */; }; C9E64D701E27DC3300DEDC20 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */; }; C9E64D721E27DC3300DEDC20 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9E64D711E27DC3300DEDC20 /* ViewController.swift */; }; C9E64D771E27DC3300DEDC20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9E64D761E27DC3300DEDC20 /* Assets.xcassets */; }; @@ -31,7 +29,6 @@ 05E37B89163869AF502F1CDF /* Pods-SignalR-Swift-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.release.xcconfig"; sourceTree = ""; }; 64FBD2AA863EBC1C6E5F1847 /* Pods-SignalR-Swift-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-ExampleTests/Pods-SignalR-Swift-ExampleTests.debug.xcconfig"; sourceTree = ""; }; 71D72D02CAC62F15659B33F8 /* Pods-SignalR-Swift-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.debug.xcconfig"; sourceTree = ""; }; - 9C17ABC7303FABDDF9430F0D /* Pods_SignalR_Swift_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C9E64D6C1E27DC3300DEDC20 /* SignalR-Swift-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SignalR-Swift-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; C9E64D6F1E27DC3300DEDC20 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C9E64D711E27DC3300DEDC20 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -43,7 +40,6 @@ C9E64D861E27DC3400DEDC20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C9E64D901E27E47800DEDC20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; DF6E88DA50252B1C671A3177 /* Pods-SignalR-Swift-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-Swift-Example.release.xcconfig"; path = "Target Support Files/Pods-SignalR-Swift-Example/Pods-SignalR-Swift-Example.release.xcconfig"; sourceTree = ""; }; - F38BF701DB154B564C2657C7 /* Pods_SignalR_Swift_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_Swift_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -51,7 +47,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C9A0B2B8AB9CB9D8FF33FC6C /* Pods_SignalR_Swift_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -59,7 +54,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8045ED75F42A9C4443F08EF0 /* Pods_SignalR_Swift_ExampleTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -69,8 +63,6 @@ 886B7849965E5C3A8E3E1D7A /* Frameworks */ = { isa = PBXGroup; children = ( - 9C17ABC7303FABDDF9430F0D /* Pods_SignalR_Swift_Example.framework */, - F38BF701DB154B564C2657C7 /* Pods_SignalR_Swift_ExampleTests.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/xcshareddata/xcschemes/SignalR-Swift-Example.xcscheme b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/xcshareddata/xcschemes/SignalR-Swift-Example.xcscheme new file mode 100644 index 0000000..d0f3e09 --- /dev/null +++ b/SignalR-Swift-Example/SignalR-Swift-Example.xcodeproj/xcshareddata/xcschemes/SignalR-Swift-Example.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 02682bb..0a8f5bf 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -10,8 +10,6 @@ 563B87161F1FA11100D75CEF /* ServerSentEventsTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563B87151F1FA11100D75CEF /* ServerSentEventsTransport.swift */; }; 568A77191F223CB2004F5D1C /* ChunkBuffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A77181F223CB2004F5D1C /* ChunkBuffer.swift */; }; 568A771B1F223CF0004F5D1C /* ServerSentEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568A771A1F223CF0004F5D1C /* ServerSentEvent.swift */; }; - 998A0F2C310CFB059B3A78D4 /* Pods_SignalRSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27052D99CE4489E31D3864D7 /* Pods_SignalRSwift.framework */; }; - A73138179358423839ADF882 /* Pods_SignalR_SwiftTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AEBF31FDC80F00C1212830C /* Pods_SignalR_SwiftTests.framework */; }; C91154631E24113F007C0DD9 /* WebSocketTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154621E24113F007C0DD9 /* WebSocketTransport.swift */; }; C91154661E241239007C0DD9 /* WebSocketConnectionInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154651E241239007C0DD9 /* WebSocketConnectionInfo.swift */; }; C91154681E243082007C0DD9 /* ReceivedMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91154671E243082007C0DD9 /* ReceivedMessage.swift */; }; @@ -53,8 +51,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 27052D99CE4489E31D3864D7 /* Pods_SignalRSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalRSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 2AEBF31FDC80F00C1212830C /* Pods_SignalR_SwiftTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalR_SwiftTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2EC113E2B99A23B23569B683 /* Pods-SignalR-SwiftTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.release.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.release.xcconfig"; sourceTree = ""; }; 3019D93A3287DFB23C41B846 /* Pods-SignalR-SwiftTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalR-SwiftTests.debug.xcconfig"; path = "Target Support Files/Pods-SignalR-SwiftTests/Pods-SignalR-SwiftTests.debug.xcconfig"; sourceTree = ""; }; 49B5BB4A071DD8A199988E10 /* Pods-SignalRSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalRSwift.debug.xcconfig"; path = "Target Support Files/Pods-SignalRSwift/Pods-SignalRSwift.debug.xcconfig"; sourceTree = ""; }; @@ -102,7 +98,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 998A0F2C310CFB059B3A78D4 /* Pods_SignalRSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -111,7 +106,6 @@ buildActionMask = 2147483647; files = ( C9330B321E1FE59A00B1F2D5 /* SignalRSwift.framework in Frameworks */, - A73138179358423839ADF882 /* Pods_SignalR_SwiftTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -141,8 +135,6 @@ B7D1214F5724602EDD3E0C77 /* Frameworks */ = { isa = PBXGroup; children = ( - 2AEBF31FDC80F00C1212830C /* Pods_SignalR_SwiftTests.framework */, - 27052D99CE4489E31D3864D7 /* Pods_SignalRSwift.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index 09e5545..ccaa787 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -105,10 +105,6 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { } do { - let baseUrl = try urlComponents?.asURL() - let url = reconnecting ? baseUrl!.absoluteString.appending("reconnect") : baseUrl!.absoluteString.appending("connect") - let request = connection?.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 30) - self.startClosure = completionHandler if let startClosure = self.startClosure { self.connectTimeoutOperation = BlockOperation(block: { [weak self] in @@ -127,13 +123,18 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { self.connectTimeoutOperation?.perform(#selector(BlockOperation.start), with: nil, afterDelay: connection!.transportConnectTimeout) } - if let encodedRequest = request?.request { + let baseUrl = try urlComponents?.asURL() + let url = reconnecting ? baseUrl!.absoluteString.appending("reconnect") : baseUrl!.absoluteString.appending("connect") + let request = connection?.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 30) + + request?.onURLRequestCreation(perform: { [weak self] encodedRequest in + guard let self = self else { return } self.webSocket = WebSocket(request: encodedRequest, certPinner: FoundationSecurity(allowSelfSigned: connection?.webSocketAllowsSelfSignedSSL ?? true)) self.webSocket!.delegate = self self.webSocket!.connect() - } + }) } catch { - + print("error: \(error)") } } @@ -189,7 +190,7 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { } } - public func didReceive(event: WebSocketEvent, client: WebSocket) { + public func didReceive(event: WebSocketEvent, client: WebSocketClient) { switch event { case .connected(let headers): //print("websocket is connected: \(headers)") diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index cf5374b..c1589c3 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.1.9" + s.version = "2.2.0" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 1752dae6e4eb35dfdbf4b24ddf489f89de861ad0 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 09:11:22 +0700 Subject: [PATCH 12/31] podspec updated --- SignalRSwift.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index c1589c3..65b8dae 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.0" + s.version = "2.2.1" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. @@ -65,6 +65,6 @@ Pod::Spec.new do |s| s.exclude_files = "Classes/Exclude" s.dependency "Alamofire" - s.dependency "Starscream" + s.dependency "Starscream", :path => "https://github.com/kamrankhan07/Starscream.git" end From 40d97fe0dae5327bd9b6a1f789c1fcce852cc1bd Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 09:20:26 +0700 Subject: [PATCH 13/31] podspec updated with dependency --- SignalRSwift.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 65b8dae..be6220a 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -65,6 +65,6 @@ Pod::Spec.new do |s| s.exclude_files = "Classes/Exclude" s.dependency "Alamofire" - s.dependency "Starscream", :path => "https://github.com/kamrankhan07/Starscream.git" + s.dependency "kamrankhan07/Starscream" end From 9afd00d1d4a386feffc5a09b5c84361b5ae0b80d Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 09:24:04 +0700 Subject: [PATCH 14/31] version info added to podspec --- SignalRSwift.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index be6220a..d230c13 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -65,6 +65,6 @@ Pod::Spec.new do |s| s.exclude_files = "Classes/Exclude" s.dependency "Alamofire" - s.dependency "kamrankhan07/Starscream" + s.dependency "kamrankhan07/Starscream", '~> 4.0.5' end From 2b928f31b0b4c66da0f243bf027e95274fb36e7d Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 09:51:18 +0700 Subject: [PATCH 15/31] podspec test --- README.md | 3 +++ SignalRSwift.podspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5de65fe..7205219 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git', platform :ios, '10.0' (onwards) pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git' + +Add source in your pod file +source = 'https://github.com/kamrankhan07/Starscream' ``` Then, run the following command: diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index d230c13..be6220a 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -65,6 +65,6 @@ Pod::Spec.new do |s| s.exclude_files = "Classes/Exclude" s.dependency "Alamofire" - s.dependency "kamrankhan07/Starscream", '~> 4.0.5' + s.dependency "kamrankhan07/Starscream" end From f1973f7cf63af98ce7b52fb648e55456a2462c7e Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 10:03:32 +0700 Subject: [PATCH 16/31] fix --- SignalRSwift.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index be6220a..a3b536d 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -65,6 +65,6 @@ Pod::Spec.new do |s| s.exclude_files = "Classes/Exclude" s.dependency "Alamofire" - s.dependency "kamrankhan07/Starscream" + s.dependency "Starscream" end From 44b2096e234e6df9c64e7e27e92315dd2471ea48 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 10:05:14 +0700 Subject: [PATCH 17/31] readme updated --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 7205219..b224882 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,8 @@ pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git', platform :ios, '10.0' (onwards) +pod 'Starscream', :git => 'https://github.com/kamrankhan07/Starscream' pod 'SignalRSwift', :git => 'https://github.com/kamrankhan07/SignalR-Swift.git' - - -Add source in your pod file -source = 'https://github.com/kamrankhan07/Starscream' ``` Then, run the following command: From 96b8e2f0a601fd76a5f3f207f75be1bc424bd551 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Tue, 28 Sep 2021 12:56:59 +0700 Subject: [PATCH 18/31] Crash fix --- SignalR-Swift/Transports/HttpTransport.swift | 26 ++++++++++++------- .../Transports/WebSocketTransport.swift | 4 +-- SignalRSwift.podspec | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/SignalR-Swift/Transports/HttpTransport.swift b/SignalR-Swift/Transports/HttpTransport.swift index 75df25b..06d5bfb 100644 --- a/SignalR-Swift/Transports/HttpTransport.swift +++ b/SignalR-Swift/Transports/HttpTransport.swift @@ -28,17 +28,16 @@ public class HttpTransport: ClientTransportProtocol { let encodedRequest = connection.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 30.0) - encodedRequest.responseJSON { (response) in + /*encodedRequest.responseJSON { (response) in print(response.debugDescription) - } + }*/ encodedRequest.validate().responseJSON { (response: DataResponse) in switch response.result { case .success(let result): if let json = result as? [String: Any] { completionHandler?(NegotiationResponse(jsonObject: json), nil) - } - else { + } else { completionHandler?(nil, AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) } case .failure(let error): @@ -112,11 +111,20 @@ public class HttpTransport: ClientTransportProtocol { let parameters = self.getConnectionParameters(connection: connection, connectionData: connectionData) let encodedRequest = connection.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 2.0) - - let request = connection.getRequest(url: encodedRequest.request!.url!.absoluteString, httpMethod: .post, encoding: URLEncoding.httpBody, parameters: nil) - request.validate().response { response in - if response.error != nil { - self.completeAbort() + + encodedRequest.onURLRequestCreation { [weak self] urlRequest in + if let url = urlRequest.url { + let request = connection.getRequest(url: url.absoluteString, httpMethod: .post, encoding: URLEncoding.httpBody, parameters: nil) + request.validate().response { response in + switch response.result { + case .success(_): + self?.completeAbort() + case .failure(let error): + print(error) + } + } + } else { + self?.completeAbort() } } } diff --git a/SignalR-Swift/Transports/WebSocketTransport.swift b/SignalR-Swift/Transports/WebSocketTransport.swift index ccaa787..4319556 100644 --- a/SignalR-Swift/Transports/WebSocketTransport.swift +++ b/SignalR-Swift/Transports/WebSocketTransport.swift @@ -127,9 +127,9 @@ public class WebSocketTransport: HttpTransport, WebSocketDelegate { let url = reconnecting ? baseUrl!.absoluteString.appending("reconnect") : baseUrl!.absoluteString.appending("connect") let request = connection?.getRequest(url: url, httpMethod: .get, encoding: URLEncoding.default, parameters: parameters, timeout: 30) - request?.onURLRequestCreation(perform: { [weak self] encodedRequest in + request?.onURLRequestCreation(perform: { [weak self] urlRequest in guard let self = self else { return } - self.webSocket = WebSocket(request: encodedRequest, certPinner: FoundationSecurity(allowSelfSigned: connection?.webSocketAllowsSelfSignedSSL ?? true)) + self.webSocket = WebSocket(request: urlRequest, certPinner: FoundationSecurity(allowSelfSigned: connection?.webSocketAllowsSelfSignedSSL ?? true)) self.webSocket!.delegate = self self.webSocket!.connect() }) diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index a3b536d..c1589c3 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.1" + s.version = "2.2.0" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 4f9ea8e832f8b6eb9b4b72cc1adc651f3bbd7410 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Wed, 21 Sep 2022 20:29:23 +0700 Subject: [PATCH 19/31] Swift Package Manager files added --- Package.swift | 28 + SignalR-Swift.xcodeproj/project.pbxproj | 2 + .../SignalRSwiftTests_Info.plist | 25 + .../SignalRSwift_Info.plist | 25 + SignalRSwift.xcodeproj/project.pbxproj | 616 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcschemes/SignalRSwift-Package.xcscheme | 33 + Sources/SignalRSwift/SignalRSwift.swift | 5 + .../SignalRSwiftTests/SignalRSwiftTests.swift | 10 + 10 files changed, 759 insertions(+) create mode 100644 Package.swift create mode 100644 SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist create mode 100644 SignalRSwift.xcodeproj/SignalRSwift_Info.plist create mode 100644 SignalRSwift.xcodeproj/project.pbxproj create mode 100644 SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme create mode 100644 Sources/SignalRSwift/SignalRSwift.swift create mode 100644 Tests/SignalRSwiftTests/SignalRSwiftTests.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..273dd46 --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 5.7 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "SignalRSwift", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "SignalRSwift", + targets: ["SignalRSwift"]), + ], + dependencies: [ + .package(url: "https://github.com/Alamofire/Alamofire", from: "1.0.0"), + .package(url: "https://github.com/kamrankhan07/Starscream", from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "SignalRSwift", + dependencies: []), + .testTarget( + name: "SignalRSwiftTests", + dependencies: ["SignalRSwift"]), + ] +) diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 0a8f5bf..a87ba31 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -91,6 +91,7 @@ C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDelegate.swift; sourceTree = ""; }; CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SignalRSwift.podspec; sourceTree = ""; }; CE3269ED23F3B26B00B29F0F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + CEF6813028DB479400649172 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -174,6 +175,7 @@ C9330B291E1FE59A00B1F2D5 /* Products */, CE3269ED23F3B26B00B29F0F /* README.md */, CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */, + CEF6813028DB479400649172 /* Package.swift */, 89A6BE56D58C5D1F44B4C1F2 /* Pods */, B7D1214F5724602EDD3E0C77 /* Frameworks */, ); diff --git a/SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist b/SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist new file mode 100644 index 0000000..7c23420 --- /dev/null +++ b/SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/SignalRSwift.xcodeproj/SignalRSwift_Info.plist b/SignalRSwift.xcodeproj/SignalRSwift_Info.plist new file mode 100644 index 0000000..57ada9f --- /dev/null +++ b/SignalRSwift.xcodeproj/SignalRSwift_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/SignalRSwift.xcodeproj/project.pbxproj b/SignalRSwift.xcodeproj/project.pbxproj new file mode 100644 index 0000000..def666f --- /dev/null +++ b/SignalRSwift.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*UTF8*$! +{ + archiveVersion = "1"; + objectVersion = "46"; + objects = { + "OBJ_1" = { + isa = "PBXProject"; + attributes = { + LastSwiftMigration = "9999"; + LastUpgradeCheck = "9999"; + }; + buildConfigurationList = "OBJ_2"; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = "en"; + hasScannedForEncodings = "0"; + knownRegions = ( + "en" + ); + mainGroup = "OBJ_5"; + productRefGroup = "OBJ_13"; + projectDirPath = "."; + targets = ( + "signalrswift::SignalRSwift", + "signalrswift::SwiftPMPackageDescription", + "signalrswift::SignalRSwiftPackageTests::ProductTarget", + "signalrswift::SignalRSwiftTests" + ); + }; + "OBJ_10" = { + isa = "PBXGroup"; + children = ( + "OBJ_11" + ); + name = "Tests"; + path = ""; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_11" = { + isa = "PBXGroup"; + children = ( + "OBJ_12" + ); + name = "SignalRSwiftTests"; + path = "Tests/SignalRSwiftTests"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_12" = { + isa = "PBXFileReference"; + path = "SignalRSwiftTests.swift"; + sourceTree = ""; + }; + "OBJ_13" = { + isa = "PBXGroup"; + children = ( + "signalrswift::SignalRSwift::Product", + "signalrswift::SignalRSwiftTests::Product" + ); + name = "Products"; + path = ""; + sourceTree = "BUILT_PRODUCTS_DIR"; + }; + "OBJ_16" = { + isa = "PBXFileReference"; + path = "SignalR-Swift"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_17" = { + isa = "PBXFileReference"; + path = "SignalR-SwiftTests"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_18" = { + isa = "PBXFileReference"; + path = "SignalR-Swift-Example"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_19" = { + isa = "PBXFileReference"; + path = "SignalR-Swift.xcworkspace"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_2" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_3", + "OBJ_4" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_20" = { + isa = "PBXFileReference"; + path = "Pods"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_21" = { + isa = "PBXFileReference"; + path = "LICENSE.md"; + sourceTree = ""; + }; + "OBJ_22" = { + isa = "PBXFileReference"; + path = "README.md"; + sourceTree = ""; + }; + "OBJ_23" = { + isa = "PBXFileReference"; + path = "ACKNOWLEDGEMENTS.md"; + sourceTree = ""; + }; + "OBJ_24" = { + isa = "PBXFileReference"; + path = "Podfile"; + sourceTree = ""; + }; + "OBJ_25" = { + isa = "PBXFileReference"; + path = "SignalRSwift.podspec"; + sourceTree = ""; + }; + "OBJ_26" = { + isa = "PBXFileReference"; + path = "Podfile.lock"; + sourceTree = ""; + }; + "OBJ_28" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_29", + "OBJ_30" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_29" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CURRENT_PROJECT_VERSION = "1"; + DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; + ENABLE_TESTABILITY = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwift_Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = "11.0"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" + ); + MACOSX_DEPLOYMENT_TARGET = "10.13"; + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + PRODUCT_BUNDLE_IDENTIFIER = "SignalRSwift"; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = "YES"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "5.0"; + TARGET_NAME = "SignalRSwift"; + TVOS_DEPLOYMENT_TARGET = "11.0"; + WATCHOS_DEPLOYMENT_TARGET = "4.0"; + }; + name = "Debug"; + }; + "OBJ_3" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = "YES"; + COMBINE_HIDPI_IMAGES = "YES"; + COPY_PHASE_STRIP = "NO"; + DEBUG_INFORMATION_FORMAT = "dwarf"; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE=1", + "DEBUG=1" + ); + MACOSX_DEPLOYMENT_TARGET = "10.10"; + ONLY_ACTIVE_ARCH = "YES"; + OTHER_SWIFT_FLAGS = ( + "$(inherited)", + "-DXcode" + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = "macosx"; + SUPPORTED_PLATFORMS = ( + "$(AVAILABLE_PLATFORMS)" + ); + SUPPORTS_MACCATALYST = "YES"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE", + "DEBUG" + ); + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + USE_HEADERMAP = "NO"; + }; + name = "Debug"; + }; + "OBJ_30" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CURRENT_PROJECT_VERSION = "1"; + DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; + ENABLE_TESTABILITY = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwift_Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = "11.0"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" + ); + MACOSX_DEPLOYMENT_TARGET = "10.13"; + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + PRODUCT_BUNDLE_IDENTIFIER = "SignalRSwift"; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = "YES"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "5.0"; + TARGET_NAME = "SignalRSwift"; + TVOS_DEPLOYMENT_TARGET = "11.0"; + WATCHOS_DEPLOYMENT_TARGET = "4.0"; + }; + name = "Release"; + }; + "OBJ_31" = { + isa = "PBXSourcesBuildPhase"; + files = ( + "OBJ_32" + ); + }; + "OBJ_32" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_9"; + }; + "OBJ_33" = { + isa = "PBXFrameworksBuildPhase"; + files = ( + ); + }; + "OBJ_35" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_36", + "OBJ_37" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_36" = { + isa = "XCBuildConfiguration"; + buildSettings = { + LD = "/usr/bin/true"; + OTHER_SWIFT_FLAGS = ( + "-swift-version", + "5", + "-I", + "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/ManifestAPI", + "-sdk", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk", + "-package-description-version", + "5.7.0" + ); + SWIFT_VERSION = "5.0"; + }; + name = "Debug"; + }; + "OBJ_37" = { + isa = "XCBuildConfiguration"; + buildSettings = { + LD = "/usr/bin/true"; + OTHER_SWIFT_FLAGS = ( + "-swift-version", + "5", + "-I", + "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/ManifestAPI", + "-sdk", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk", + "-package-description-version", + "5.7.0" + ); + SWIFT_VERSION = "5.0"; + }; + name = "Release"; + }; + "OBJ_38" = { + isa = "PBXSourcesBuildPhase"; + files = ( + "OBJ_39" + ); + }; + "OBJ_39" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_6"; + }; + "OBJ_4" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = "YES"; + COMBINE_HIDPI_IMAGES = "YES"; + COPY_PHASE_STRIP = "YES"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_OPTIMIZATION_LEVEL = "s"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE=1" + ); + MACOSX_DEPLOYMENT_TARGET = "10.10"; + OTHER_SWIFT_FLAGS = ( + "$(inherited)", + "-DXcode" + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = "macosx"; + SUPPORTED_PLATFORMS = ( + "$(AVAILABLE_PLATFORMS)" + ); + SUPPORTS_MACCATALYST = "YES"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE" + ); + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + USE_HEADERMAP = "NO"; + }; + name = "Release"; + }; + "OBJ_41" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_42", + "OBJ_43" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_42" = { + isa = "XCBuildConfiguration"; + buildSettings = { + }; + name = "Debug"; + }; + "OBJ_43" = { + isa = "XCBuildConfiguration"; + buildSettings = { + }; + name = "Release"; + }; + "OBJ_44" = { + isa = "PBXTargetDependency"; + target = "signalrswift::SignalRSwiftTests"; + }; + "OBJ_46" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_47", + "OBJ_48" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_47" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_MODULES = "YES"; + CURRENT_PROJECT_VERSION = "1"; + DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = "14.0"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@loader_path/../Frameworks", + "@loader_path/Frameworks" + ); + MACOSX_DEPLOYMENT_TARGET = "11.0"; + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "5.0"; + TARGET_NAME = "SignalRSwiftTests"; + TVOS_DEPLOYMENT_TARGET = "14.0"; + WATCHOS_DEPLOYMENT_TARGET = "7.0"; + }; + name = "Debug"; + }; + "OBJ_48" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_MODULES = "YES"; + CURRENT_PROJECT_VERSION = "1"; + DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = "14.0"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@loader_path/../Frameworks", + "@loader_path/Frameworks" + ); + MACOSX_DEPLOYMENT_TARGET = "11.0"; + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "5.0"; + TARGET_NAME = "SignalRSwiftTests"; + TVOS_DEPLOYMENT_TARGET = "14.0"; + WATCHOS_DEPLOYMENT_TARGET = "7.0"; + }; + name = "Release"; + }; + "OBJ_49" = { + isa = "PBXSourcesBuildPhase"; + files = ( + "OBJ_50" + ); + }; + "OBJ_5" = { + isa = "PBXGroup"; + children = ( + "OBJ_6", + "OBJ_7", + "OBJ_10", + "OBJ_13", + "OBJ_16", + "OBJ_17", + "OBJ_18", + "OBJ_19", + "OBJ_20", + "OBJ_21", + "OBJ_22", + "OBJ_23", + "OBJ_24", + "OBJ_25", + "OBJ_26" + ); + path = ""; + sourceTree = ""; + }; + "OBJ_50" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_12"; + }; + "OBJ_51" = { + isa = "PBXFrameworksBuildPhase"; + files = ( + "OBJ_52" + ); + }; + "OBJ_52" = { + isa = "PBXBuildFile"; + fileRef = "signalrswift::SignalRSwift::Product"; + }; + "OBJ_53" = { + isa = "PBXTargetDependency"; + target = "signalrswift::SignalRSwift"; + }; + "OBJ_6" = { + isa = "PBXFileReference"; + explicitFileType = "sourcecode.swift"; + path = "Package.swift"; + sourceTree = ""; + }; + "OBJ_7" = { + isa = "PBXGroup"; + children = ( + "OBJ_8" + ); + name = "Sources"; + path = ""; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_8" = { + isa = "PBXGroup"; + children = ( + "OBJ_9" + ); + name = "SignalRSwift"; + path = "Sources/SignalRSwift"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_9" = { + isa = "PBXFileReference"; + path = "SignalRSwift.swift"; + sourceTree = ""; + }; + "signalrswift::SignalRSwift" = { + isa = "PBXNativeTarget"; + buildConfigurationList = "OBJ_28"; + buildPhases = ( + "OBJ_31", + "OBJ_33" + ); + dependencies = ( + ); + name = "SignalRSwift"; + productName = "SignalRSwift"; + productReference = "signalrswift::SignalRSwift::Product"; + productType = "com.apple.product-type.framework"; + }; + "signalrswift::SignalRSwift::Product" = { + isa = "PBXFileReference"; + path = "SignalRSwift.framework"; + sourceTree = "BUILT_PRODUCTS_DIR"; + }; + "signalrswift::SignalRSwiftPackageTests::ProductTarget" = { + isa = "PBXAggregateTarget"; + buildConfigurationList = "OBJ_41"; + buildPhases = ( + ); + dependencies = ( + "OBJ_44" + ); + name = "SignalRSwiftPackageTests"; + productName = "SignalRSwiftPackageTests"; + }; + "signalrswift::SignalRSwiftTests" = { + isa = "PBXNativeTarget"; + buildConfigurationList = "OBJ_46"; + buildPhases = ( + "OBJ_49", + "OBJ_51" + ); + dependencies = ( + "OBJ_53" + ); + name = "SignalRSwiftTests"; + productName = "SignalRSwiftTests"; + productReference = "signalrswift::SignalRSwiftTests::Product"; + productType = "com.apple.product-type.bundle.unit-test"; + }; + "signalrswift::SignalRSwiftTests::Product" = { + isa = "PBXFileReference"; + path = "SignalRSwiftTests.xctest"; + sourceTree = "BUILT_PRODUCTS_DIR"; + }; + "signalrswift::SwiftPMPackageDescription" = { + isa = "PBXNativeTarget"; + buildConfigurationList = "OBJ_35"; + buildPhases = ( + "OBJ_38" + ); + dependencies = ( + ); + name = "SignalRSwiftPackageDescription"; + productName = "SignalRSwiftPackageDescription"; + productType = "com.apple.product-type.framework"; + }; + }; + rootObject = "OBJ_1"; +} diff --git a/SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..fe1aa71 --- /dev/null +++ b/SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..a72dc2b --- /dev/null +++ b/SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + \ No newline at end of file diff --git a/SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme b/SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme new file mode 100644 index 0000000..428f64a --- /dev/null +++ b/SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Sources/SignalRSwift/SignalRSwift.swift b/Sources/SignalRSwift/SignalRSwift.swift new file mode 100644 index 0000000..74d054e --- /dev/null +++ b/Sources/SignalRSwift/SignalRSwift.swift @@ -0,0 +1,5 @@ +public struct SignalRSwift { + + public init() { + } +} diff --git a/Tests/SignalRSwiftTests/SignalRSwiftTests.swift b/Tests/SignalRSwiftTests/SignalRSwiftTests.swift new file mode 100644 index 0000000..9079543 --- /dev/null +++ b/Tests/SignalRSwiftTests/SignalRSwiftTests.swift @@ -0,0 +1,10 @@ +import XCTest +@testable import SignalRSwift + +final class SignalRSwiftTests: XCTestCase { + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + } +} From d2ba34002e36f3a00d359736b6c79bd0ba3350b4 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Wed, 21 Sep 2022 21:01:25 +0700 Subject: [PATCH 20/31] Revert "Swift Package Manager files added" This reverts commit 4f9ea8e832f8b6eb9b4b72cc1adc651f3bbd7410. --- Package.swift | 28 - SignalR-Swift.xcodeproj/project.pbxproj | 2 - .../SignalRSwiftTests_Info.plist | 25 - .../SignalRSwift_Info.plist | 25 - SignalRSwift.xcodeproj/project.pbxproj | 616 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/WorkspaceSettings.xcsettings | 8 - .../xcschemes/SignalRSwift-Package.xcscheme | 33 - Sources/SignalRSwift/SignalRSwift.swift | 5 - .../SignalRSwiftTests/SignalRSwiftTests.swift | 10 - 10 files changed, 759 deletions(-) delete mode 100644 Package.swift delete mode 100644 SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist delete mode 100644 SignalRSwift.xcodeproj/SignalRSwift_Info.plist delete mode 100644 SignalRSwift.xcodeproj/project.pbxproj delete mode 100644 SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme delete mode 100644 Sources/SignalRSwift/SignalRSwift.swift delete mode 100644 Tests/SignalRSwiftTests/SignalRSwiftTests.swift diff --git a/Package.swift b/Package.swift deleted file mode 100644 index 273dd46..0000000 --- a/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version: 5.7 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "SignalRSwift", - products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "SignalRSwift", - targets: ["SignalRSwift"]), - ], - dependencies: [ - .package(url: "https://github.com/Alamofire/Alamofire", from: "1.0.0"), - .package(url: "https://github.com/kamrankhan07/Starscream", from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "SignalRSwift", - dependencies: []), - .testTarget( - name: "SignalRSwiftTests", - dependencies: ["SignalRSwift"]), - ] -) diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index a87ba31..0a8f5bf 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -91,7 +91,6 @@ C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDelegate.swift; sourceTree = ""; }; CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SignalRSwift.podspec; sourceTree = ""; }; CE3269ED23F3B26B00B29F0F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - CEF6813028DB479400649172 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -175,7 +174,6 @@ C9330B291E1FE59A00B1F2D5 /* Products */, CE3269ED23F3B26B00B29F0F /* README.md */, CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */, - CEF6813028DB479400649172 /* Package.swift */, 89A6BE56D58C5D1F44B4C1F2 /* Pods */, B7D1214F5724602EDD3E0C77 /* Frameworks */, ); diff --git a/SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist b/SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist deleted file mode 100644 index 7c23420..0000000 --- a/SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist +++ /dev/null @@ -1,25 +0,0 @@ - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/SignalRSwift.xcodeproj/SignalRSwift_Info.plist b/SignalRSwift.xcodeproj/SignalRSwift_Info.plist deleted file mode 100644 index 57ada9f..0000000 --- a/SignalRSwift.xcodeproj/SignalRSwift_Info.plist +++ /dev/null @@ -1,25 +0,0 @@ - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/SignalRSwift.xcodeproj/project.pbxproj b/SignalRSwift.xcodeproj/project.pbxproj deleted file mode 100644 index def666f..0000000 --- a/SignalRSwift.xcodeproj/project.pbxproj +++ /dev/null @@ -1,616 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = "1"; - objectVersion = "46"; - objects = { - "OBJ_1" = { - isa = "PBXProject"; - attributes = { - LastSwiftMigration = "9999"; - LastUpgradeCheck = "9999"; - }; - buildConfigurationList = "OBJ_2"; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = "en"; - hasScannedForEncodings = "0"; - knownRegions = ( - "en" - ); - mainGroup = "OBJ_5"; - productRefGroup = "OBJ_13"; - projectDirPath = "."; - targets = ( - "signalrswift::SignalRSwift", - "signalrswift::SwiftPMPackageDescription", - "signalrswift::SignalRSwiftPackageTests::ProductTarget", - "signalrswift::SignalRSwiftTests" - ); - }; - "OBJ_10" = { - isa = "PBXGroup"; - children = ( - "OBJ_11" - ); - name = "Tests"; - path = ""; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_11" = { - isa = "PBXGroup"; - children = ( - "OBJ_12" - ); - name = "SignalRSwiftTests"; - path = "Tests/SignalRSwiftTests"; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_12" = { - isa = "PBXFileReference"; - path = "SignalRSwiftTests.swift"; - sourceTree = ""; - }; - "OBJ_13" = { - isa = "PBXGroup"; - children = ( - "signalrswift::SignalRSwift::Product", - "signalrswift::SignalRSwiftTests::Product" - ); - name = "Products"; - path = ""; - sourceTree = "BUILT_PRODUCTS_DIR"; - }; - "OBJ_16" = { - isa = "PBXFileReference"; - path = "SignalR-Swift"; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_17" = { - isa = "PBXFileReference"; - path = "SignalR-SwiftTests"; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_18" = { - isa = "PBXFileReference"; - path = "SignalR-Swift-Example"; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_19" = { - isa = "PBXFileReference"; - path = "SignalR-Swift.xcworkspace"; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_2" = { - isa = "XCConfigurationList"; - buildConfigurations = ( - "OBJ_3", - "OBJ_4" - ); - defaultConfigurationIsVisible = "0"; - defaultConfigurationName = "Release"; - }; - "OBJ_20" = { - isa = "PBXFileReference"; - path = "Pods"; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_21" = { - isa = "PBXFileReference"; - path = "LICENSE.md"; - sourceTree = ""; - }; - "OBJ_22" = { - isa = "PBXFileReference"; - path = "README.md"; - sourceTree = ""; - }; - "OBJ_23" = { - isa = "PBXFileReference"; - path = "ACKNOWLEDGEMENTS.md"; - sourceTree = ""; - }; - "OBJ_24" = { - isa = "PBXFileReference"; - path = "Podfile"; - sourceTree = ""; - }; - "OBJ_25" = { - isa = "PBXFileReference"; - path = "SignalRSwift.podspec"; - sourceTree = ""; - }; - "OBJ_26" = { - isa = "PBXFileReference"; - path = "Podfile.lock"; - sourceTree = ""; - }; - "OBJ_28" = { - isa = "XCConfigurationList"; - buildConfigurations = ( - "OBJ_29", - "OBJ_30" - ); - defaultConfigurationIsVisible = "0"; - defaultConfigurationName = "Release"; - }; - "OBJ_29" = { - isa = "XCBuildConfiguration"; - buildSettings = { - CURRENT_PROJECT_VERSION = "1"; - DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; - ENABLE_TESTABILITY = "YES"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PLATFORM_DIR)/Developer/Library/Frameworks" - ); - HEADER_SEARCH_PATHS = ( - "$(inherited)" - ); - INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwift_Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = "11.0"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" - ); - MACOSX_DEPLOYMENT_TARGET = "10.13"; - OTHER_CFLAGS = ( - "$(inherited)" - ); - OTHER_LDFLAGS = ( - "$(inherited)" - ); - OTHER_SWIFT_FLAGS = ( - "$(inherited)" - ); - PRODUCT_BUNDLE_IDENTIFIER = "SignalRSwift"; - PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = "YES"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)" - ); - SWIFT_VERSION = "5.0"; - TARGET_NAME = "SignalRSwift"; - TVOS_DEPLOYMENT_TARGET = "11.0"; - WATCHOS_DEPLOYMENT_TARGET = "4.0"; - }; - name = "Debug"; - }; - "OBJ_3" = { - isa = "XCBuildConfiguration"; - buildSettings = { - CLANG_ENABLE_OBJC_ARC = "YES"; - COMBINE_HIDPI_IMAGES = "YES"; - COPY_PHASE_STRIP = "NO"; - DEBUG_INFORMATION_FORMAT = "dwarf"; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_NS_ASSERTIONS = "YES"; - GCC_OPTIMIZATION_LEVEL = "0"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "SWIFT_PACKAGE=1", - "DEBUG=1" - ); - MACOSX_DEPLOYMENT_TARGET = "10.10"; - ONLY_ACTIVE_ARCH = "YES"; - OTHER_SWIFT_FLAGS = ( - "$(inherited)", - "-DXcode" - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = "macosx"; - SUPPORTED_PLATFORMS = ( - "$(AVAILABLE_PLATFORMS)" - ); - SUPPORTS_MACCATALYST = "YES"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)", - "SWIFT_PACKAGE", - "DEBUG" - ); - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - USE_HEADERMAP = "NO"; - }; - name = "Debug"; - }; - "OBJ_30" = { - isa = "XCBuildConfiguration"; - buildSettings = { - CURRENT_PROJECT_VERSION = "1"; - DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; - ENABLE_TESTABILITY = "YES"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PLATFORM_DIR)/Developer/Library/Frameworks" - ); - HEADER_SEARCH_PATHS = ( - "$(inherited)" - ); - INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwift_Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = "11.0"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" - ); - MACOSX_DEPLOYMENT_TARGET = "10.13"; - OTHER_CFLAGS = ( - "$(inherited)" - ); - OTHER_LDFLAGS = ( - "$(inherited)" - ); - OTHER_SWIFT_FLAGS = ( - "$(inherited)" - ); - PRODUCT_BUNDLE_IDENTIFIER = "SignalRSwift"; - PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = "YES"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)" - ); - SWIFT_VERSION = "5.0"; - TARGET_NAME = "SignalRSwift"; - TVOS_DEPLOYMENT_TARGET = "11.0"; - WATCHOS_DEPLOYMENT_TARGET = "4.0"; - }; - name = "Release"; - }; - "OBJ_31" = { - isa = "PBXSourcesBuildPhase"; - files = ( - "OBJ_32" - ); - }; - "OBJ_32" = { - isa = "PBXBuildFile"; - fileRef = "OBJ_9"; - }; - "OBJ_33" = { - isa = "PBXFrameworksBuildPhase"; - files = ( - ); - }; - "OBJ_35" = { - isa = "XCConfigurationList"; - buildConfigurations = ( - "OBJ_36", - "OBJ_37" - ); - defaultConfigurationIsVisible = "0"; - defaultConfigurationName = "Release"; - }; - "OBJ_36" = { - isa = "XCBuildConfiguration"; - buildSettings = { - LD = "/usr/bin/true"; - OTHER_SWIFT_FLAGS = ( - "-swift-version", - "5", - "-I", - "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/ManifestAPI", - "-sdk", - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk", - "-package-description-version", - "5.7.0" - ); - SWIFT_VERSION = "5.0"; - }; - name = "Debug"; - }; - "OBJ_37" = { - isa = "XCBuildConfiguration"; - buildSettings = { - LD = "/usr/bin/true"; - OTHER_SWIFT_FLAGS = ( - "-swift-version", - "5", - "-I", - "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/ManifestAPI", - "-sdk", - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk", - "-package-description-version", - "5.7.0" - ); - SWIFT_VERSION = "5.0"; - }; - name = "Release"; - }; - "OBJ_38" = { - isa = "PBXSourcesBuildPhase"; - files = ( - "OBJ_39" - ); - }; - "OBJ_39" = { - isa = "PBXBuildFile"; - fileRef = "OBJ_6"; - }; - "OBJ_4" = { - isa = "XCBuildConfiguration"; - buildSettings = { - CLANG_ENABLE_OBJC_ARC = "YES"; - COMBINE_HIDPI_IMAGES = "YES"; - COPY_PHASE_STRIP = "YES"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_OPTIMIZATION_LEVEL = "s"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "SWIFT_PACKAGE=1" - ); - MACOSX_DEPLOYMENT_TARGET = "10.10"; - OTHER_SWIFT_FLAGS = ( - "$(inherited)", - "-DXcode" - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = "macosx"; - SUPPORTED_PLATFORMS = ( - "$(AVAILABLE_PLATFORMS)" - ); - SUPPORTS_MACCATALYST = "YES"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)", - "SWIFT_PACKAGE" - ); - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - USE_HEADERMAP = "NO"; - }; - name = "Release"; - }; - "OBJ_41" = { - isa = "XCConfigurationList"; - buildConfigurations = ( - "OBJ_42", - "OBJ_43" - ); - defaultConfigurationIsVisible = "0"; - defaultConfigurationName = "Release"; - }; - "OBJ_42" = { - isa = "XCBuildConfiguration"; - buildSettings = { - }; - name = "Debug"; - }; - "OBJ_43" = { - isa = "XCBuildConfiguration"; - buildSettings = { - }; - name = "Release"; - }; - "OBJ_44" = { - isa = "PBXTargetDependency"; - target = "signalrswift::SignalRSwiftTests"; - }; - "OBJ_46" = { - isa = "XCConfigurationList"; - buildConfigurations = ( - "OBJ_47", - "OBJ_48" - ); - defaultConfigurationIsVisible = "0"; - defaultConfigurationName = "Release"; - }; - "OBJ_47" = { - isa = "XCBuildConfiguration"; - buildSettings = { - CLANG_ENABLE_MODULES = "YES"; - CURRENT_PROJECT_VERSION = "1"; - DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PLATFORM_DIR)/Developer/Library/Frameworks" - ); - HEADER_SEARCH_PATHS = ( - "$(inherited)" - ); - INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = "14.0"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@loader_path/../Frameworks", - "@loader_path/Frameworks" - ); - MACOSX_DEPLOYMENT_TARGET = "11.0"; - OTHER_CFLAGS = ( - "$(inherited)" - ); - OTHER_LDFLAGS = ( - "$(inherited)" - ); - OTHER_SWIFT_FLAGS = ( - "$(inherited)" - ); - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)" - ); - SWIFT_VERSION = "5.0"; - TARGET_NAME = "SignalRSwiftTests"; - TVOS_DEPLOYMENT_TARGET = "14.0"; - WATCHOS_DEPLOYMENT_TARGET = "7.0"; - }; - name = "Debug"; - }; - "OBJ_48" = { - isa = "XCBuildConfiguration"; - buildSettings = { - CLANG_ENABLE_MODULES = "YES"; - CURRENT_PROJECT_VERSION = "1"; - DRIVERKIT_DEPLOYMENT_TARGET = "19.0"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PLATFORM_DIR)/Developer/Library/Frameworks" - ); - HEADER_SEARCH_PATHS = ( - "$(inherited)" - ); - INFOPLIST_FILE = "SignalRSwift.xcodeproj/SignalRSwiftTests_Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = "14.0"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@loader_path/../Frameworks", - "@loader_path/Frameworks" - ); - MACOSX_DEPLOYMENT_TARGET = "11.0"; - OTHER_CFLAGS = ( - "$(inherited)" - ); - OTHER_LDFLAGS = ( - "$(inherited)" - ); - OTHER_SWIFT_FLAGS = ( - "$(inherited)" - ); - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( - "$(inherited)" - ); - SWIFT_VERSION = "5.0"; - TARGET_NAME = "SignalRSwiftTests"; - TVOS_DEPLOYMENT_TARGET = "14.0"; - WATCHOS_DEPLOYMENT_TARGET = "7.0"; - }; - name = "Release"; - }; - "OBJ_49" = { - isa = "PBXSourcesBuildPhase"; - files = ( - "OBJ_50" - ); - }; - "OBJ_5" = { - isa = "PBXGroup"; - children = ( - "OBJ_6", - "OBJ_7", - "OBJ_10", - "OBJ_13", - "OBJ_16", - "OBJ_17", - "OBJ_18", - "OBJ_19", - "OBJ_20", - "OBJ_21", - "OBJ_22", - "OBJ_23", - "OBJ_24", - "OBJ_25", - "OBJ_26" - ); - path = ""; - sourceTree = ""; - }; - "OBJ_50" = { - isa = "PBXBuildFile"; - fileRef = "OBJ_12"; - }; - "OBJ_51" = { - isa = "PBXFrameworksBuildPhase"; - files = ( - "OBJ_52" - ); - }; - "OBJ_52" = { - isa = "PBXBuildFile"; - fileRef = "signalrswift::SignalRSwift::Product"; - }; - "OBJ_53" = { - isa = "PBXTargetDependency"; - target = "signalrswift::SignalRSwift"; - }; - "OBJ_6" = { - isa = "PBXFileReference"; - explicitFileType = "sourcecode.swift"; - path = "Package.swift"; - sourceTree = ""; - }; - "OBJ_7" = { - isa = "PBXGroup"; - children = ( - "OBJ_8" - ); - name = "Sources"; - path = ""; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_8" = { - isa = "PBXGroup"; - children = ( - "OBJ_9" - ); - name = "SignalRSwift"; - path = "Sources/SignalRSwift"; - sourceTree = "SOURCE_ROOT"; - }; - "OBJ_9" = { - isa = "PBXFileReference"; - path = "SignalRSwift.swift"; - sourceTree = ""; - }; - "signalrswift::SignalRSwift" = { - isa = "PBXNativeTarget"; - buildConfigurationList = "OBJ_28"; - buildPhases = ( - "OBJ_31", - "OBJ_33" - ); - dependencies = ( - ); - name = "SignalRSwift"; - productName = "SignalRSwift"; - productReference = "signalrswift::SignalRSwift::Product"; - productType = "com.apple.product-type.framework"; - }; - "signalrswift::SignalRSwift::Product" = { - isa = "PBXFileReference"; - path = "SignalRSwift.framework"; - sourceTree = "BUILT_PRODUCTS_DIR"; - }; - "signalrswift::SignalRSwiftPackageTests::ProductTarget" = { - isa = "PBXAggregateTarget"; - buildConfigurationList = "OBJ_41"; - buildPhases = ( - ); - dependencies = ( - "OBJ_44" - ); - name = "SignalRSwiftPackageTests"; - productName = "SignalRSwiftPackageTests"; - }; - "signalrswift::SignalRSwiftTests" = { - isa = "PBXNativeTarget"; - buildConfigurationList = "OBJ_46"; - buildPhases = ( - "OBJ_49", - "OBJ_51" - ); - dependencies = ( - "OBJ_53" - ); - name = "SignalRSwiftTests"; - productName = "SignalRSwiftTests"; - productReference = "signalrswift::SignalRSwiftTests::Product"; - productType = "com.apple.product-type.bundle.unit-test"; - }; - "signalrswift::SignalRSwiftTests::Product" = { - isa = "PBXFileReference"; - path = "SignalRSwiftTests.xctest"; - sourceTree = "BUILT_PRODUCTS_DIR"; - }; - "signalrswift::SwiftPMPackageDescription" = { - isa = "PBXNativeTarget"; - buildConfigurationList = "OBJ_35"; - buildPhases = ( - "OBJ_38" - ); - dependencies = ( - ); - name = "SignalRSwiftPackageDescription"; - productName = "SignalRSwiftPackageDescription"; - productType = "com.apple.product-type.framework"; - }; - }; - rootObject = "OBJ_1"; -} diff --git a/SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index fe1aa71..0000000 --- a/SignalRSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index a72dc2b..0000000 --- a/SignalRSwift.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded - - - \ No newline at end of file diff --git a/SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme b/SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme deleted file mode 100644 index 428f64a..0000000 --- a/SignalRSwift.xcodeproj/xcshareddata/xcschemes/SignalRSwift-Package.xcscheme +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Sources/SignalRSwift/SignalRSwift.swift b/Sources/SignalRSwift/SignalRSwift.swift deleted file mode 100644 index 74d054e..0000000 --- a/Sources/SignalRSwift/SignalRSwift.swift +++ /dev/null @@ -1,5 +0,0 @@ -public struct SignalRSwift { - - public init() { - } -} diff --git a/Tests/SignalRSwiftTests/SignalRSwiftTests.swift b/Tests/SignalRSwiftTests/SignalRSwiftTests.swift deleted file mode 100644 index 9079543..0000000 --- a/Tests/SignalRSwiftTests/SignalRSwiftTests.swift +++ /dev/null @@ -1,10 +0,0 @@ -import XCTest -@testable import SignalRSwift - -final class SignalRSwiftTests: XCTestCase { - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct - // results. - } -} From 54a592a16f0e4c93c9938462e43a9a152e574d4e Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Wed, 21 Sep 2022 21:01:55 +0700 Subject: [PATCH 21/31] package.swift --- Package.swift | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Package.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..273dd46 --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 5.7 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "SignalRSwift", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "SignalRSwift", + targets: ["SignalRSwift"]), + ], + dependencies: [ + .package(url: "https://github.com/Alamofire/Alamofire", from: "1.0.0"), + .package(url: "https://github.com/kamrankhan07/Starscream", from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "SignalRSwift", + dependencies: []), + .testTarget( + name: "SignalRSwiftTests", + dependencies: ["SignalRSwift"]), + ] +) From 89aff332cda15919c265f6178edbb71e32281b3c Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Wed, 21 Sep 2022 21:05:22 +0700 Subject: [PATCH 22/31] package update --- .../xcode/package.xcworkspace/contents.xcworkspacedata | 7 +++++++ Package.swift | 6 ++++-- SignalR-Swift.xcodeproj/project.pbxproj | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Package.swift b/Package.swift index 273dd46..f13cc4a 100644 --- a/Package.swift +++ b/Package.swift @@ -20,9 +20,11 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "SignalRSwift", - dependencies: []), + dependencies: [], + path: "SignalR-Swift"), .testTarget( name: "SignalRSwiftTests", - dependencies: ["SignalRSwift"]), + dependencies: ["SignalRSwift"], + path: "SignalR-SwiftTests"), ] ) diff --git a/SignalR-Swift.xcodeproj/project.pbxproj b/SignalR-Swift.xcodeproj/project.pbxproj index 0a8f5bf..f684148 100644 --- a/SignalR-Swift.xcodeproj/project.pbxproj +++ b/SignalR-Swift.xcodeproj/project.pbxproj @@ -91,6 +91,7 @@ C9FC2D981E23BC600027FE59 /* ConnectionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionDelegate.swift; sourceTree = ""; }; CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SignalRSwift.podspec; sourceTree = ""; }; CE3269ED23F3B26B00B29F0F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + CEF6816528DB513000649172 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -174,6 +175,7 @@ C9330B291E1FE59A00B1F2D5 /* Products */, CE3269ED23F3B26B00B29F0F /* README.md */, CE3269EC23F3B26B00B29F0F /* SignalRSwift.podspec */, + CEF6816528DB513000649172 /* Package.swift */, 89A6BE56D58C5D1F44B4C1F2 /* Pods */, B7D1214F5724602EDD3E0C77 /* Frameworks */, ); From f0c3c99e86d3dfd1885cd87652be30e459ddf048 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 07:43:56 +0700 Subject: [PATCH 23/31] version update --- Package.swift | 6 +++++- SignalRSwift.podspec | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index f13cc4a..5345414 100644 --- a/Package.swift +++ b/Package.swift @@ -5,6 +5,9 @@ import PackageDescription let package = Package( name: "SignalRSwift", + platforms: [ + .iOS(.v10) + ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( @@ -26,5 +29,6 @@ let package = Package( name: "SignalRSwiftTests", dependencies: ["SignalRSwift"], path: "SignalR-SwiftTests"), - ] + ], + swiftLanguageVersions: [.v5] ) diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index c1589c3..a3b536d 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.0" + s.version = "2.2.1" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From f883249bf963b12823073efd14f7466d6e89e7f0 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 07:46:36 +0700 Subject: [PATCH 24/31] 2.2.2 --- Package.swift | 2 +- SignalRSwift.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 5345414..faea377 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "SignalRSwift", platforms: [ - .iOS(.v10) + .iOS(.v11) ], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index a3b536d..e1a7285 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.1" + s.version = "2.2.2" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 78df753aab8740434947941cbdb1f0d83a262216 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 07:55:15 +0700 Subject: [PATCH 25/31] update pacakge swift file --- Package.swift | 2 +- SignalRSwift.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index faea377..1b8e259 100644 --- a/Package.swift +++ b/Package.swift @@ -23,7 +23,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "SignalRSwift", - dependencies: [], + dependencies: ["Alamofire", "Starscream"], path: "SignalR-Swift"), .testTarget( name: "SignalRSwiftTests", diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index e1a7285..1c22d0c 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.2" + s.version = "2.2.3" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 97a4d45ca6a790e0585de5399443c35922a08ee0 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 08:07:00 +0700 Subject: [PATCH 26/31] updates --- Package.swift | 10 ++-------- SignalRSwift.podspec | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Package.swift b/Package.swift index 1b8e259..37386b5 100644 --- a/Package.swift +++ b/Package.swift @@ -9,7 +9,6 @@ let package = Package( .iOS(.v11) ], products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "SignalRSwift", targets: ["SignalRSwift"]), @@ -19,16 +18,11 @@ let package = Package( .package(url: "https://github.com/kamrankhan07/Starscream", from: "1.0.0"), ], targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "SignalRSwift", dependencies: ["Alamofire", "Starscream"], - path: "SignalR-Swift"), - .testTarget( - name: "SignalRSwiftTests", - dependencies: ["SignalRSwift"], - path: "SignalR-SwiftTests"), + path: "SignalR-Swift", + exclude: ["Info.plist"]) ], swiftLanguageVersions: [.v5] ) diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index 1c22d0c..d889dd0 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.3" + s.version = "2.2.4" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 650d1241e0457e078d9086529a1ef76ae592cd58 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 08:36:28 +0700 Subject: [PATCH 27/31] dependency version update --- Package.swift | 4 ++-- SignalRSwift.podspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 37386b5..3b14e74 100644 --- a/Package.swift +++ b/Package.swift @@ -14,8 +14,8 @@ let package = Package( targets: ["SignalRSwift"]), ], dependencies: [ - .package(url: "https://github.com/Alamofire/Alamofire", from: "1.0.0"), - .package(url: "https://github.com/kamrankhan07/Starscream", from: "1.0.0"), + .package(url: "https://github.com/Alamofire/Alamofire", from: "5.6.2"), + .package(url: "https://github.com/kamrankhan07/Starscream", from: "4.0.5"), ], targets: [ .target( diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index d889dd0..fd1618d 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.4" + s.version = "2.2.5" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 1ae03f1a5c96ca81fd6ddbbcfd3bcece49084d18 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 08:45:20 +0700 Subject: [PATCH 28/31] Remove references --- Package.swift | 7 ++++--- SignalR-Swift/Client/Connection.swift | 1 - SignalR-Swift/Client/Infrastructure/Version.swift | 1 - SignalR-Swift/Client/Protocols/ConnectionProtocol.swift | 1 - SignalRSwift.podspec | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index 3b14e74..659e6b3 100644 --- a/Package.swift +++ b/Package.swift @@ -5,9 +5,10 @@ import PackageDescription let package = Package( name: "SignalRSwift", - platforms: [ - .iOS(.v11) - ], + platforms: [.macOS(.v10_12), + .iOS(.v10), + .tvOS(.v10), + .watchOS(.v3)], products: [ .library( name: "SignalRSwift", diff --git a/SignalR-Swift/Client/Connection.swift b/SignalR-Swift/Client/Connection.swift index a1251d1..02e85c7 100644 --- a/SignalR-Swift/Client/Connection.swift +++ b/SignalR-Swift/Client/Connection.swift @@ -7,7 +7,6 @@ // import Foundation -import UIKit import Alamofire public typealias ConnectionStartedClosure = (() -> ()) diff --git a/SignalR-Swift/Client/Infrastructure/Version.swift b/SignalR-Swift/Client/Infrastructure/Version.swift index 5919f74..de3467f 100644 --- a/SignalR-Swift/Client/Infrastructure/Version.swift +++ b/SignalR-Swift/Client/Infrastructure/Version.swift @@ -7,7 +7,6 @@ // import Foundation -import UIKit public struct Version : Equatable, CustomStringConvertible { let major: UInt diff --git a/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift b/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift index 6cdb1db..a081899 100644 --- a/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift +++ b/SignalR-Swift/Client/Protocols/ConnectionProtocol.swift @@ -7,7 +7,6 @@ // import Foundation -import UIKit import Alamofire public protocol ConnectionProtocol: AnyObject { diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index fd1618d..e21f2e7 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.5" + s.version = "2.2.6" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 9c509b331cc8d36f7dd6fed4f6fe263e835d0c80 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 09:10:33 +0700 Subject: [PATCH 29/31] changes --- Package.resolved | 23 +++++++++++++++++++++++ Package.swift | 8 ++++---- Podfile | 2 +- SignalR-Swift/Client/Connection.swift | 16 ++++++++++++++-- SignalRSwift.podspec | 2 +- 5 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 Package.resolved diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..4b55ef6 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,23 @@ +{ + "pins" : [ + { + "identity" : "alamofire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Alamofire/Alamofire", + "state" : { + "revision" : "8dd85aee02e39dd280c75eef88ffdb86eed4b07b", + "version" : "5.6.2" + } + }, + { + "identity" : "starscream", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kamrankhan07/Starscream", + "state" : { + "revision" : "0cf71ccdb201271ee706b91ff9c5234c1da29b08", + "version" : "4.0.5" + } + } + ], + "version" : 2 +} diff --git a/Package.swift b/Package.swift index 659e6b3..448b2fa 100644 --- a/Package.swift +++ b/Package.swift @@ -5,10 +5,10 @@ import PackageDescription let package = Package( name: "SignalRSwift", - platforms: [.macOS(.v10_12), - .iOS(.v10), - .tvOS(.v10), - .watchOS(.v3)], + platforms: [.macOS(.v10_13), + .iOS(.v11), + .tvOS(.v11), + .watchOS(.v4)], products: [ .library( name: "SignalRSwift", diff --git a/Podfile b/Podfile index cb01dae..130fc53 100644 --- a/Podfile +++ b/Podfile @@ -6,7 +6,7 @@ target 'SignalRSwift' do use_frameworks! # Pods for SignalR-Swift - pod 'Alamofire' + pod 'Alamofire', '~> 5.6.2' pod 'Starscream', :git => 'https://github.com/kamrankhan07/Starscream.git' target 'SignalR-SwiftTests' do diff --git a/SignalR-Swift/Client/Connection.swift b/SignalR-Swift/Client/Connection.swift index 02e85c7..f485976 100644 --- a/SignalR-Swift/Client/Connection.swift +++ b/SignalR-Swift/Client/Connection.swift @@ -8,6 +8,12 @@ import Foundation import Alamofire +#if canImport(UIKit) +import UIKit +#elseif canImport(AppKit) +import AppKit +#else +#endif public typealias ConnectionStartedClosure = (() -> ()) public typealias ConnectionReceivedClosure = ((Any) -> ()) @@ -323,8 +329,14 @@ public class Connection: ConnectionProtocol { if self.assemblyVersion == nil { self.assemblyVersion = Version(major: 2, minor: 0) } - - return "\(client)/\(self.assemblyVersion!) (\(UIDevice.current.localizedModel) \(UIDevice.current.systemVersion))" + + #if os(iOS) || os(watchOS) || os(tvOS) + return "\(client)/\(self.assemblyVersion!) (\(UIDevice.current.localizedModel) \(UIDevice.current.systemVersion))" + #elseif os(macOS) + return "\(client)/\(self.assemblyVersion!) (\(Host.current().name ?? ""))" + #else + return "\(client)/\(self.assemblyVersion!)" + #endif } public func processResponse(response: Data, shouldReconnect: inout Bool, disconnected: inout Bool) { diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index e21f2e7..c781634 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.6" + s.version = "2.2.7" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 48f4f556a05839cb43708ba8f7944a4bdb137890 Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Thu, 22 Sep 2022 13:32:15 +0700 Subject: [PATCH 30/31] swift version change --- Package.swift | 2 +- SignalRSwift.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 448b2fa..a8328e2 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.5 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/SignalRSwift.podspec b/SignalRSwift.podspec index c781634..8178b35 100644 --- a/SignalRSwift.podspec +++ b/SignalRSwift.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SignalRSwift" - s.version = "2.2.7" + s.version = "2.2.8" s.summary = "A SignalR client library for iOS written in Swift" # This description is used to generate tags and improve search results. From 24884f2eef363bcf0e6740c9f93c9548f579cdbf Mon Sep 17 00:00:00 2001 From: Kamran Khan Date: Wed, 5 Oct 2022 13:25:32 +0700 Subject: [PATCH 31/31] update --- .../xcschemes/SignalRSwift.xcscheme | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/SignalRSwift.xcscheme diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/SignalRSwift.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/SignalRSwift.xcscheme new file mode 100644 index 0000000..30e9ab6 --- /dev/null +++ b/.swiftpm/xcode/xcshareddata/xcschemes/SignalRSwift.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +