diff --git a/.gitignore b/.gitignore index 9c3f821..a2e8f00 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ Carthage/Build # CocoaPods Pods +Example/Birdsong.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Birdsong.podspec b/Birdsong.podspec index 4fa65e4..b825ad1 100644 --- a/Birdsong.podspec +++ b/Birdsong.podspec @@ -7,9 +7,9 @@ Pod::Spec.new do |s| s.author = { 'Simon Manning' => 'https://github.com/sjrmanning' } s.social_media_url = 'https://twitter.com/sjrmanning' s.source = { :git => 'https://github.com/sjrmanning/Birdsong.git', :tag => s.version.to_s } - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.10' s.tvos.deployment_target = '9.0' s.source_files = 'Source/**/*' - s.dependency 'Starscream', '3.0.2' + s.dependency 'Starscream', '3.1.0' end diff --git a/Example/Birdsong.xcodeproj/project.pbxproj b/Example/Birdsong.xcodeproj/project.pbxproj index 5357b23..bb157d7 100644 --- a/Example/Birdsong.xcodeproj/project.pbxproj +++ b/Example/Birdsong.xcodeproj/project.pbxproj @@ -30,7 +30,7 @@ 0E3796FC89AB0C2AFCBBC66B /* Pods_Birdsong_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Birdsong_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2F656ACE77B9220D4FA5AA3F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 3FDEA1DF5861851FD051F1F9 /* Pods_Birdsong_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Birdsong_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 473E2D38760B4DA1DDBAF6DD /* Birdsong.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Birdsong.podspec; path = ../Birdsong.podspec; sourceTree = ""; }; + 473E2D38760B4DA1DDBAF6DD /* Birdsong.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Birdsong.podspec; path = ../Birdsong.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 5D40F13EA17DC65021D49E6E /* Pods-Birdsong_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Birdsong_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Birdsong_Tests/Pods-Birdsong_Tests.release.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* Birdsong_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Birdsong_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -168,7 +168,6 @@ 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, 9CE1991E1F6192BB50714C1B /* [CP] Embed Pods Frameworks */, - BE77FC74F235E75957F753B6 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -187,8 +186,6 @@ 607FACE11AFB9204008FA782 /* Sources */, 607FACE21AFB9204008FA782 /* Frameworks */, 607FACE31AFB9204008FA782 /* Resources */, - DBE71177C04F62C013D9A65E /* [CP] Embed Pods Frameworks */, - ACB9F40620DF0D3283D0DA63 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -207,16 +204,16 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -226,6 +223,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -266,7 +264,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Birdsong/Birdsong.framework", "${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework", ); @@ -277,52 +275,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - ACB9F40620DF0D3283D0DA63 /* [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-Birdsong_Tests/Pods-Birdsong_Tests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - BE77FC74F235E75957F753B6 /* [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-Birdsong_Example/Pods-Birdsong_Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - DBE71177C04F62C013D9A65E /* [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-Birdsong_Tests/Pods-Birdsong_Tests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Birdsong_Example/Pods-Birdsong_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; E5A7D5FF01CFE605A464C460 /* [CP] Check Pods Manifest.lock */ = { @@ -407,6 +360,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -415,12 +369,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -448,7 +404,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -460,6 +416,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -468,12 +425,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -494,7 +453,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -509,12 +468,13 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Birdsong/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -525,12 +485,13 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Birdsong/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -550,8 +511,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -567,8 +528,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Example/Birdsong.xcodeproj/xcshareddata/xcschemes/Birdsong-Example.xcscheme b/Example/Birdsong.xcodeproj/xcshareddata/xcschemes/Birdsong-Example.xcscheme index 2f8c034..2e0e21c 100644 --- a/Example/Birdsong.xcodeproj/xcshareddata/xcschemes/Birdsong-Example.xcscheme +++ b/Example/Birdsong.xcodeproj/xcshareddata/xcschemes/Birdsong-Example.xcscheme @@ -1,6 +1,6 @@ Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { self.window = UIWindow(frame: UIScreen.main.bounds) self.window!.backgroundColor = UIColor.white self.window!.makeKeyAndVisible() diff --git a/Example/Birdsong/ViewController.swift b/Example/Birdsong/ViewController.swift index d252f51..13d7f5b 100644 --- a/Example/Birdsong/ViewController.swift +++ b/Example/Birdsong/ViewController.swift @@ -48,8 +48,8 @@ class ViewController: UIViewController { width: viewSize.width * 0.8, height: 100) - sendMessageButton.setTitle("Send message", for: UIControlState()) - sendMessageButton.setTitleColor(UIColor.red, for: UIControlState()) + sendMessageButton.setTitle("Send message", for: UIControl.State()) + sendMessageButton.setTitleColor(UIColor.red, for: UIControl.State()) sendMessageButton.addTarget(self, action: #selector(sendMessage), for: .touchUpInside) diff --git a/Example/Podfile b/Example/Podfile index f0d3da7..45830c5 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -7,12 +7,4 @@ target 'Birdsong_Example' do inherit! :search_paths end - post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - puts "[post install] " << target.name << ":" << config.name << " set SWIFT_VERSION to 3.0" - config.build_settings['SWIFT_VERSION'] = '3.0' - end - end - end end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index c6dc603..6cc5d17 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,19 +1,23 @@ PODS: - - Birdsong (0.5.2): - - Starscream (= 3.0.2) - - Starscream (3.0.2) + - Birdsong (0.6.1): + - Starscream (= 3.1.0) + - Starscream (3.1.0) DEPENDENCIES: - Birdsong (from `../`) +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Starscream + EXTERNAL SOURCES: Birdsong: - :path: ../ + :path: "../" SPEC CHECKSUMS: - Birdsong: 71f36b17508bd4c10419a2f9db53fa2625caa43c - Starscream: b512c62f6706421221b5ceb2ba01a9f58aca5bea + Birdsong: ccd865dac4e05e495846367ed7f2d810d9558d51 + Starscream: 08172b481e145289c4930cb567230fb55897cfa4 -PODFILE CHECKSUM: fd31310a2947ba719ecd745ba9c1838097125604 +PODFILE CHECKSUM: 722cbca4358a62b46f06250f5942a254480667ad -COCOAPODS: 1.3.1 +COCOAPODS: 1.6.1 diff --git a/Source/Channel.swift b/Source/Channel.swift index 0b19077..fcd2c2b 100644 --- a/Source/Channel.swift +++ b/Source/Channel.swift @@ -11,8 +11,8 @@ import Foundation open class Channel { // MARK: - Properties - open let topic: String - open let params: Socket.Payload + public let topic: String + public let params: Socket.Payload fileprivate weak var socket: Socket? fileprivate(set) open var state: State diff --git a/Source/Presence.swift b/Source/Presence.swift index 8aa9c30..61a0343 100644 --- a/Source/Presence.swift +++ b/Source/Presence.swift @@ -78,7 +78,7 @@ public final class Presence { // Otherwise, we need to find the phx_ref keys to delete. let metas = entry["metas"] as? [Meta] - if let refsToDelete = metas?.flatMap({ $0["phx_ref"] as? String }) { + if let refsToDelete = metas?.compactMap({ $0["phx_ref"] as? String }) { existing = existing.filter { if let phxRef = $0["phx_ref"] as? String { return !refsToDelete.contains(phxRef) diff --git a/Source/Response.swift b/Source/Response.swift index 9e5ef7e..069f391 100644 --- a/Source/Response.swift +++ b/Source/Response.swift @@ -9,10 +9,10 @@ import Foundation open class Response { - open let ref: String - open let topic: String - open let event: String - open let payload: Socket.Payload + public let ref: String + public let topic: String + public let event: String + public let payload: Socket.Payload init?(data: Data) { do {