From d39ed5431c384f5e37bd3ecc1460dc4aec702934 Mon Sep 17 00:00:00 2001 From: Joe Mattiello Date: Fri, 3 Jan 2020 15:42:36 -0500 Subject: [PATCH] Update ReachabilitySwift to 5.0 (#1) * Update Podspec and Podfile to ReachabilitySwift 5 * Pod update * Update ViewController force unwrap to force try * Fix warnings * Swiftlint autocorrect --- Podfile | 2 +- Podfile.lock | 26 +-- .../RxReachability.podspec.json | 10 +- Pods/Manifest.lock | 26 +-- Pods/Pods.xcodeproj/project.pbxproj | 27 ++- Pods/ReachabilitySwift/README.md | 44 +---- .../Sources/Reachability.swift | 178 +++++++++++++----- Pods/RxCocoa/README.md | 12 ++ Pods/RxRelay/README.md | 12 ++ Pods/RxSwift/README.md | 12 ++ .../ReachabilitySwift-Info.plist | 2 +- .../RxCocoa/RxCocoa-Info.plist | 2 +- .../RxReachability/RxReachability-Info.plist | 2 +- .../RxRelay/RxRelay-Info.plist | 2 +- .../RxSwift/RxSwift-Info.plist | 2 +- RxReachability-Example/AppDelegate.swift | 3 - RxReachability-Example/ViewController.swift | 3 +- RxReachability.podspec | 4 +- .../xcshareddata/WorkspaceSettings.xcsettings | 4 +- .../Sources/ObservableType+Reachability.swift | 6 +- RxReachability/Sources/Reachability+Rx.swift | 5 +- 21 files changed, 232 insertions(+), 152 deletions(-) diff --git a/Podfile b/Podfile index 80f8363..632d00b 100644 --- a/Podfile +++ b/Podfile @@ -5,7 +5,7 @@ platform :ios, '8.0' target 'RxReachability' do use_frameworks! - pod 'ReachabilitySwift', '~> 4.3.1' + pod 'ReachabilitySwift', '~> 5.0' pod 'RxSwift', '~> 5' pod 'RxCocoa', '~> 5' diff --git a/Podfile.lock b/Podfile.lock index 834d949..3a51cfa 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,18 +1,18 @@ PODS: - - ReachabilitySwift (4.3.1) - - RxCocoa (5.0.0): + - ReachabilitySwift (5.0.0) + - RxCocoa (5.0.1): - RxRelay (~> 5) - RxSwift (~> 5) - - RxReachability (1.0.0): - - ReachabilitySwift (~> 4.3.1) + - RxReachability (1.1.0): + - ReachabilitySwift (~> 5.0) - RxCocoa (~> 5) - RxSwift (~> 5) - - RxRelay (5.0.0): + - RxRelay (5.0.1): - RxSwift (~> 5) - - RxSwift (5.0.0) + - RxSwift (5.0.1) DEPENDENCIES: - - ReachabilitySwift (~> 4.3.1) + - ReachabilitySwift (~> 5.0) - RxCocoa (~> 5) - RxReachability (from `.`) - RxSwift (~> 5) @@ -29,12 +29,12 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: - ReachabilitySwift: 4032e2f59586e11e3b0ebe15b167abdd587a388b - RxCocoa: fcf32050ac00d801f34a7f71d5e8e7f23026dcd8 - RxReachability: f61218539d155d05d69c9db7edbe81560dc3ac09 - RxRelay: 4f7409406a51a55cd88483f21ed898c234d60f18 - RxSwift: 8b0671caa829a763bbce7271095859121cbd895f + ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 + RxCocoa: e741b9749968e8a143e2b787f1dfbff2b63d0a5c + RxReachability: 3da1c23ba6d93dabc004290cda61dd9e7884422d + RxRelay: 89d54507f4fd4d969e6ec1d4bd7f3673640b4640 + RxSwift: e2dc62b366a3adf6a0be44ba9f405efd4c94e0c4 -PODFILE CHECKSUM: f897c8d548d02bbfa31252354156a75cc96548db +PODFILE CHECKSUM: 9f0c361134aae7fe1d858d3d1c05fdd6da8f2999 COCOAPODS: 1.7.1 diff --git a/Pods/Local Podspecs/RxReachability.podspec.json b/Pods/Local Podspecs/RxReachability.podspec.json index 44a33c9..2fbca44 100644 --- a/Pods/Local Podspecs/RxReachability.podspec.json +++ b/Pods/Local Podspecs/RxReachability.podspec.json @@ -1,6 +1,6 @@ { "name": "RxReachability", - "version": "1.0.0", + "version": "1.1.0", "summary": "RxSwift bindings for Reachability", "description": "RxReachability adds easy to use RxSwift bindings for [ReachabilitySwift](https://github.com/ashleymills/Reachability.swift).\nYou can react to network reachability changes and even retry observables when network comes back up.", "homepage": "https://github.com/RxSwiftCommunity/RxReachability", @@ -15,7 +15,7 @@ }, "source": { "git": "https://github.com/RxSwiftCommunity/RxReachability.git", - "tag": "1.0.0" + "tag": "1.1.0" }, "social_media_url": "https://rxswift.slack.com", "source_files": "RxReachability/Sources/**/*", @@ -25,9 +25,10 @@ "tvos": "9.0" }, "frameworks": "Foundation", + "swift_versions": "5.0", "dependencies": { "ReachabilitySwift": [ - "~> 4.3.1" + "~> 5.0" ], "RxSwift": [ "~> 5" @@ -35,5 +36,6 @@ "RxCocoa": [ "~> 5" ] - } + }, + "swift_version": "5.0" } diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 834d949..3a51cfa 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,18 +1,18 @@ PODS: - - ReachabilitySwift (4.3.1) - - RxCocoa (5.0.0): + - ReachabilitySwift (5.0.0) + - RxCocoa (5.0.1): - RxRelay (~> 5) - RxSwift (~> 5) - - RxReachability (1.0.0): - - ReachabilitySwift (~> 4.3.1) + - RxReachability (1.1.0): + - ReachabilitySwift (~> 5.0) - RxCocoa (~> 5) - RxSwift (~> 5) - - RxRelay (5.0.0): + - RxRelay (5.0.1): - RxSwift (~> 5) - - RxSwift (5.0.0) + - RxSwift (5.0.1) DEPENDENCIES: - - ReachabilitySwift (~> 4.3.1) + - ReachabilitySwift (~> 5.0) - RxCocoa (~> 5) - RxReachability (from `.`) - RxSwift (~> 5) @@ -29,12 +29,12 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: - ReachabilitySwift: 4032e2f59586e11e3b0ebe15b167abdd587a388b - RxCocoa: fcf32050ac00d801f34a7f71d5e8e7f23026dcd8 - RxReachability: f61218539d155d05d69c9db7edbe81560dc3ac09 - RxRelay: 4f7409406a51a55cd88483f21ed898c234d60f18 - RxSwift: 8b0671caa829a763bbce7271095859121cbd895f + ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 + RxCocoa: e741b9749968e8a143e2b787f1dfbff2b63d0a5c + RxReachability: 3da1c23ba6d93dabc004290cda61dd9e7884422d + RxRelay: 89d54507f4fd4d969e6ec1d4bd7f3673640b4640 + RxSwift: e2dc62b366a3adf6a0be44ba9f405efd4c94e0c4 -PODFILE CHECKSUM: f897c8d548d02bbfa31252354156a75cc96548db +PODFILE CHECKSUM: 9f0c361134aae7fe1d858d3d1c05fdd6da8f2999 COCOAPODS: 1.7.1 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 02cdc93..dd9f4af 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -450,7 +450,7 @@ 0BFA632EADA7C99BF1954AF8E1415B45 /* SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SharedSequence.swift; path = RxCocoa/Traits/SharedSequence/SharedSequence.swift; sourceTree = ""; }; 0C5F779B42FCD81B1EEF89318941B9A3 /* NSObject+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx.swift"; path = "RxCocoa/Foundation/NSObject+Rx.swift"; sourceTree = ""; }; 0D220E46EF3F94C814459721C134E0C9 /* RxCocoa.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxCocoa.xcconfig; sourceTree = ""; }; - 0D436D4EDB52D7827982212F7F11F4BB /* Pods_RxReachability_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_RxReachability_Example.framework; path = "Pods-RxReachability-Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 0D436D4EDB52D7827982212F7F11F4BB /* Pods_RxReachability_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RxReachability_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0F9913D8A443A2D1C15E08C6A8CE977E /* Pods-RxReachability-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-RxReachability-umbrella.h"; sourceTree = ""; }; 0FA23E53D642B4C39837FA12D15F8F49 /* CombineLatest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombineLatest.swift; path = RxSwift/Observables/CombineLatest.swift; sourceTree = ""; }; 10B489801584EEF831BE393C1C333AE4 /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+Extensions.swift"; path = "RxSwift/ObservableType+Extensions.swift"; sourceTree = ""; }; @@ -477,7 +477,7 @@ 1F005DE0255699BD7507E5A6F6BABE1B /* ShareReplayScope.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplayScope.swift; path = RxSwift/Observables/ShareReplayScope.swift; sourceTree = ""; }; 211724E1782124D88E4A30092E0A7D4C /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateSchedulerType.swift; path = RxSwift/ImmediateSchedulerType.swift; sourceTree = ""; }; 2155B9D05B531E77E1AC32CA13C8E421 /* RxSwift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxSwift.xcconfig; sourceTree = ""; }; - 21B03CA622E690725A6626C088E1D09F /* Reachability.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Reachability.framework; path = ReachabilitySwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 21B03CA622E690725A6626C088E1D09F /* Reachability.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Reachability.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2399EC37DCD4D4644005BFEC82517C06 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 23ADEB078A9FE1286D80B77BD5E015AE /* BehaviorSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorSubject.swift; path = RxSwift/Subjects/BehaviorSubject.swift; sourceTree = ""; }; 24820DC18036F3BAA6776072A18C0B85 /* UIButton+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIButton+Rx.swift"; path = "RxCocoa/iOS/UIButton+Rx.swift"; sourceTree = ""; }; @@ -496,7 +496,7 @@ 2C6F98DAD0C79A87BAF21FCD04C6EE2B /* Maybe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Maybe.swift; path = RxSwift/Traits/Maybe.swift; sourceTree = ""; }; 2CA9E5EFBCF7DB2CF342159E665C2BF8 /* ReachabilitySwift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ReachabilitySwift.xcconfig; sourceTree = ""; }; 2D8A34644747C46B31165ACD3000C12E /* SkipWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipWhile.swift; path = RxSwift/Observables/SkipWhile.swift; sourceTree = ""; }; - 2D9221444EB4405E2FA7C3E1FEAB96F7 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + 2D9221444EB4405E2FA7C3E1FEAB96F7 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 2DE2084B12F9A50D1F80E9BE28443CD7 /* RxSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-umbrella.h"; sourceTree = ""; }; 2E71EABED443BA639CD3AFB4E39A83B0 /* Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+arity.swift"; path = "RxSwift/Observables/Zip+arity.swift"; sourceTree = ""; }; 2F3C69DA03B0EF7581751F0CE162BD00 /* SerialDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDisposable.swift; path = RxSwift/Disposables/SerialDisposable.swift; sourceTree = ""; }; @@ -506,7 +506,7 @@ 3096B870E536906C6E4F15740FEA7886 /* CombineLatest+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+Collection.swift"; path = "RxSwift/Observables/CombineLatest+Collection.swift"; sourceTree = ""; }; 30EBBFD95368AB61B3468084BB295171 /* UINavigationItem+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UINavigationItem+Rx.swift"; path = "RxCocoa/iOS/UINavigationItem+Rx.swift"; sourceTree = ""; }; 32124FD202EB72583898DCB6FC421598 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedUnsubscribeType.swift; path = RxSwift/Concurrency/SynchronizedUnsubscribeType.swift; sourceTree = ""; }; - 33D561CA1D48033E563863F83A08C439 /* Pods_RxReachability.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_RxReachability.framework; path = "Pods-RxReachability.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33D561CA1D48033E563863F83A08C439 /* Pods_RxReachability.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RxReachability.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34162DA2C26D2520707F89B154AF91E0 /* RxTextViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTextViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift; sourceTree = ""; }; 34A0541F331E3067020981363F095BD3 /* RxPickerViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxPickerViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift; sourceTree = ""; }; 35C2EAA5A80F2551DC5C5CA435DD2212 /* Pods-RxReachability.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-RxReachability.debug.xcconfig"; sourceTree = ""; }; @@ -606,7 +606,7 @@ 7FD460E85E61B24F7B4FC7AED10C428B /* Binder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Binder.swift; path = RxCocoa/Common/Binder.swift; sourceTree = ""; }; 80508C24A42161E69A5D38780F2C9CE5 /* ItemEvents.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ItemEvents.swift; path = RxCocoa/iOS/Events/ItemEvents.swift; sourceTree = ""; }; 8079200FBD40D6AD48D0AA84902FD0BC /* AsSingle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsSingle.swift; path = RxSwift/Observables/AsSingle.swift; sourceTree = ""; }; - 809C5FAB588354C9BA37DC3EAB8CB45C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxSwift.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 809C5FAB588354C9BA37DC3EAB8CB45C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 809D688D4034A9BF50FB72DC96CC691A /* RxCocoa-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxCocoa-prefix.pch"; sourceTree = ""; }; 8256559C876928929B694A8CC64098CC /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxSwift.modulemap; sourceTree = ""; }; 8280D3A86539502C4970B4F6F30B71A3 /* Optional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Optional.swift; path = RxSwift/Observables/Optional.swift; sourceTree = ""; }; @@ -650,7 +650,7 @@ 9B415396416EF4C7A94239E08A29A61D /* Window.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Window.swift; path = RxSwift/Observables/Window.swift; sourceTree = ""; }; 9B917D6DEA054C8F60E59846D69DE152 /* RxSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxSwift-dummy.m"; sourceTree = ""; }; 9D8DD0123225EA85A441EB0ED6500B7B /* UIView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Rx.swift"; path = "RxCocoa/iOS/UIView+Rx.swift"; sourceTree = ""; }; - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 9ED72A595DF99B7351484EA60FF74CA4 /* RxReachability-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxReachability-umbrella.h"; sourceTree = ""; }; A07F29F1B542C126E02AB5C6CEFACD80 /* RxCocoa-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxCocoa-dummy.m"; sourceTree = ""; }; A1482C3C0ACC97FEE9376573D6424998 /* Cancelable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cancelable.swift; path = RxSwift/Cancelable.swift; sourceTree = ""; }; @@ -672,7 +672,7 @@ ACBAA010AF7779486DE73D8FF57C6439 /* RxPickerViewDataSourceType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxPickerViewDataSourceType.swift; path = RxCocoa/iOS/Protocols/RxPickerViewDataSourceType.swift; sourceTree = ""; }; ACF3FC0546D7EF4F1034BA8D4090417D /* SwiftSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = RxSwift/SwiftSupport/SwiftSupport.swift; sourceTree = ""; }; ADBF1382438ABFC1CEA16B5DBFBEB4D0 /* SharedSequence+Operators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SharedSequence+Operators.swift"; path = "RxCocoa/Traits/SharedSequence/SharedSequence+Operators.swift"; sourceTree = ""; }; - AF9340B2C37BF45EF94C9B128A965AD5 /* RxReachability.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = RxReachability.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + AF9340B2C37BF45EF94C9B128A965AD5 /* RxReachability.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = RxReachability.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; B09B1EB62D298184BE905E7259A7A580 /* TakeLast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeLast.swift; path = RxSwift/Observables/TakeLast.swift; sourceTree = ""; }; B13970B4FE6FD3663C3AE823AB604A49 /* NSTextStorage+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSTextStorage+Rx.swift"; path = "RxCocoa/iOS/NSTextStorage+Rx.swift"; sourceTree = ""; }; B2AFCAB79B1BEE228240BD86DA7AF1FC /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; @@ -689,7 +689,7 @@ BAD77CD0CB390BE0D8B044B2528B9D26 /* PrimitiveSequence+Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "PrimitiveSequence+Zip+arity.swift"; path = "RxSwift/Traits/PrimitiveSequence+Zip+arity.swift"; sourceTree = ""; }; BB0C74B5C50841D185853C07EA1D5EF1 /* Pods-RxReachability-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-RxReachability-Example.debug.xcconfig"; sourceTree = ""; }; BC35CE6F3828D994D7D1B6895BB662CF /* DisposeBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBase.swift; path = RxSwift/Disposables/DisposeBase.swift; sourceTree = ""; }; - BC432FD48A5932251F1CAFBC4BF74894 /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxCocoa.framework; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BC432FD48A5932251F1CAFBC4BF74894 /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BCC69BE5EDB9ADA0A0E954BA79C4B64C /* DispatchQueueConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DispatchQueueConfiguration.swift; path = RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift; sourceTree = ""; }; BD06020B94C72C4360738F99332E5D5A /* ObservableConvertibleType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableConvertibleType.swift; path = RxSwift/ObservableConvertibleType.swift; sourceTree = ""; }; BDC072CF9D08FCCAD86DBAB698B6D81D /* Zip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zip.swift; path = RxSwift/Observables/Zip.swift; sourceTree = ""; }; @@ -720,13 +720,13 @@ D2B3E93D8684E4D111BC0C10372892D8 /* WithLatestFrom.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WithLatestFrom.swift; path = RxSwift/Observables/WithLatestFrom.swift; sourceTree = ""; }; D443F10A7F1583E77247EA87225B2CBE /* Observable+Bind.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Bind.swift"; path = "RxCocoa/Common/Observable+Bind.swift"; sourceTree = ""; }; D45FC96D2C07DBD7B0C7E8BCEF8BDB53 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; - D48F5F9AF8B5CD673F1E5EBE20505BFC /* RxReachability.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxReachability.framework; path = RxReachability.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D48F5F9AF8B5CD673F1E5EBE20505BFC /* RxReachability.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxReachability.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D4DC35757D8F20E9C692F7E85349C5FE /* RecursiveScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveScheduler.swift; path = RxSwift/Schedulers/RecursiveScheduler.swift; sourceTree = ""; }; D54161E27F840D64A96FB8B88701AB07 /* HistoricalSchedulerTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalSchedulerTimeConverter.swift; path = RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift; sourceTree = ""; }; D5FDF87CDCBB2677FB24BA67C92904D5 /* Using.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Using.swift; path = RxSwift/Observables/Using.swift; sourceTree = ""; }; D6052C83196DB9B246B9BBDEEB8D0914 /* CombineLatest+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+arity.swift"; path = "RxSwift/Observables/CombineLatest+arity.swift"; sourceTree = ""; }; D62C39EAB679862B0D584AABC060EE23 /* SchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SchedulerType.swift; path = RxSwift/SchedulerType.swift; sourceTree = ""; }; - D62EA0123F0C4025368E9CA314B7EACB /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + D62EA0123F0C4025368E9CA314B7EACB /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; D7059C6D1DEBC475D91684A65DF2F669 /* Skip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Skip.swift; path = RxSwift/Observables/Skip.swift; sourceTree = ""; }; D7BA6CBC7B56BEC9FF44EDFB0427FCA3 /* _RXKVOObserver.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RXKVOObserver.m; path = RxCocoa/Runtime/_RXKVOObserver.m; sourceTree = ""; }; D7E31B5F4AD810C10ACC701A30562D6F /* UIGestureRecognizer+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIGestureRecognizer+Rx.swift"; path = "RxCocoa/iOS/UIGestureRecognizer+Rx.swift"; sourceTree = ""; }; @@ -772,7 +772,7 @@ FA7DBBB73C921C3F74BA09CE0006CE3F /* Date+Dispatch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Date+Dispatch.swift"; path = "RxSwift/Date+Dispatch.swift"; sourceTree = ""; }; FDB16E0E3522E9824DC9B43C9E22F61C /* RxRelay.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxRelay.modulemap; sourceTree = ""; }; FF289242E6027D0C983FD38CB3596CD5 /* BooleanDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BooleanDisposable.swift; path = RxSwift/Disposables/BooleanDisposable.swift; sourceTree = ""; }; - FF8B264DFE802855D5D67E7CDDABFC3C /* RxRelay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxRelay.framework; path = RxRelay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FF8B264DFE802855D5D67E7CDDABFC3C /* RxRelay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxRelay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FFE41BBE9BBA6E35A77E422049EFD4E4 /* ScheduledItemType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItemType.swift; path = RxSwift/Schedulers/Internal/ScheduledItemType.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -864,7 +864,6 @@ B3B248549F203EB5DC5AF7863C5FEC4D /* Reachability.swift */, 9801EFD98432476D18FAC3BAAC8EE531 /* Support Files */, ); - name = ReachabilitySwift; path = ReachabilitySwift; sourceTree = ""; }; @@ -1095,7 +1094,6 @@ 7221BCB9198FFEEBFAFD691EAE5E2293 /* Zip+Collection.swift */, FC081D2595C16A009BEAB274DC003CE1 /* Support Files */, ); - name = RxSwift; path = RxSwift; sourceTree = ""; }; @@ -1136,7 +1134,6 @@ 148BBD1A8ACFEBB8E7F22A9DC4ED47EC /* Utils.swift */, EA6D739AB3A76AEF172E9CE02CD8C44F /* Support Files */, ); - name = RxRelay; path = RxRelay; sourceTree = ""; }; @@ -1293,7 +1290,6 @@ AA083386EC65A4BEF2187235B7A978B0 /* URLSession+Rx.swift */, 03CCBF79CF9721655D3F0381CF5B4EDA /* Support Files */, ); - name = RxCocoa; path = RxCocoa; sourceTree = ""; }; @@ -1584,6 +1580,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = CF1408CF629C7361332E53B88F7BD30C; productRefGroup = 9A8733B4662D221ADDBC6F2DC3B40CBE /* Products */; diff --git a/Pods/ReachabilitySwift/README.md b/Pods/ReachabilitySwift/README.md index 43e00d6..578743c 100644 --- a/Pods/ReachabilitySwift/README.md +++ b/Pods/ReachabilitySwift/README.md @@ -2,7 +2,7 @@ Reachability.swift is a replacement for Apple's Reachability sample, re-written in Swift with closures. -It is compatible with **iOS** (8.0 - 11.0), **OSX** (10.9 - 10.13) and **tvOS** (9.0 - 11.0) +It is compatible with **iOS** (8.0 - 12.0), **OSX** (10.9 - 10.14) and **tvOS** (9.0 - 12.0) Inspired by https://github.com/tonymillion/Reachability @@ -20,46 +20,6 @@ And don't forget to **★** the repo. This increases its visibility and encourag Thanks Ash -# IMPORTANT - -## Version 4.0 breaking changes - -### CocoaPods: - -If you're adding **Reachability.swift** using CocoaPods, note that the framework name has changed from `ReachabilitySwift` to `Reachability` (for consistency with Carthage) - -### Previously: - -```swift -enum NetworkStatus { - case notReachable, reachableViaWiFi, reachableViaWWAN -} -var currentReachabilityStatus: NetworkStatus -``` - -### Now: - -```swift -enum Connection { - case none, wifi, cellular -} -var connection: Connection -``` - -### Other changes: - -- `reachableOnWWAN` has been renamed to `allowsCellularConnection` - -- `reachability.currentReachabilityString` has been deprecated. Use `"\(reachability.connection)"` instead. - -- `isReachable` has been deprecated. Use `connection != .none` instead. - -- `isReachableViaWWAN` has been deprecated. Use `connection == .cellular` instead. - -- The notification for reachability changes has been renamed from `ReachabilityChangedNotification` to `Notification.Name.reachabilityChanged` - -- All closure callbacks and notification are fired on the main queue (including when `startNotifier()` is called) - ## Got a problem? @@ -177,7 +137,7 @@ and print("Reachable via WiFi") case .cellular: print("Reachable via Cellular") - case .none: + case .unavailable: print("Network not reachable") } } diff --git a/Pods/ReachabilitySwift/Sources/Reachability.swift b/Pods/ReachabilitySwift/Sources/Reachability.swift index f4c9ce9..6c8ffa2 100644 --- a/Pods/ReachabilitySwift/Sources/Reachability.swift +++ b/Pods/ReachabilitySwift/Sources/Reachability.swift @@ -29,11 +29,11 @@ import SystemConfiguration import Foundation public enum ReachabilityError: Error { - case FailedToCreateWithAddress(sockaddr_in) - case FailedToCreateWithHostname(String) - case UnableToSetCallback - case UnableToSetDispatchQueue - case UnableToGetInitialFlags + case failedToCreateWithAddress(sockaddr, Int32) + case failedToCreateWithHostname(String, Int32) + case unableToSetCallback(Int32) + case unableToSetDispatchQueue(Int32) + case unableToGetFlags(Int32) } @available(*, unavailable, renamed: "Notification.Name.reachabilityChanged") @@ -61,12 +61,15 @@ public class Reachability { } public enum Connection: CustomStringConvertible { - case none, wifi, cellular + @available(*, deprecated, renamed: "unavailable") + case none + case unavailable, wifi, cellular public var description: String { switch self { case .cellular: return "Cellular" case .wifi: return "WiFi" - case .none: return "No Connection" + case .unavailable: return "No Connection" + case .none: return "unavailable" } } } @@ -99,8 +102,9 @@ public class Reachability { } switch flags?.connection { - case .none?, nil: return .none - case .cellular?: return allowsCellularConnection ? .cellular : .none + case .unavailable?, nil: return .unavailable + case .none?: return .unavailable + case .cellular?: return allowsCellularConnection ? .cellular : .unavailable case .wifi?: return .wifi } } @@ -113,35 +117,49 @@ public class Reachability { #endif }() - fileprivate var notifierRunning = false + fileprivate(set) var notifierRunning = false fileprivate let reachabilityRef: SCNetworkReachability fileprivate let reachabilitySerialQueue: DispatchQueue + fileprivate let notificationQueue: DispatchQueue? fileprivate(set) var flags: SCNetworkReachabilityFlags? { didSet { guard flags != oldValue else { return } - reachabilityChanged() + notifyReachabilityChanged() } } - required public init(reachabilityRef: SCNetworkReachability, queueQoS: DispatchQoS = .default, targetQueue: DispatchQueue? = nil) { + required public init(reachabilityRef: SCNetworkReachability, + queueQoS: DispatchQoS = .default, + targetQueue: DispatchQueue? = nil, + notificationQueue: DispatchQueue? = .main) { self.allowsCellularConnection = true self.reachabilityRef = reachabilityRef self.reachabilitySerialQueue = DispatchQueue(label: "uk.co.ashleymills.reachability", qos: queueQoS, target: targetQueue) + self.notificationQueue = notificationQueue } - public convenience init?(hostname: String, queueQoS: DispatchQoS = .default, targetQueue: DispatchQueue? = nil) { - guard let ref = SCNetworkReachabilityCreateWithName(nil, hostname) else { return nil } - self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue) + public convenience init(hostname: String, + queueQoS: DispatchQoS = .default, + targetQueue: DispatchQueue? = nil, + notificationQueue: DispatchQueue? = .main) throws { + guard let ref = SCNetworkReachabilityCreateWithName(nil, hostname) else { + throw ReachabilityError.failedToCreateWithHostname(hostname, SCError()) + } + self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue) } - public convenience init?(queueQoS: DispatchQoS = .default, targetQueue: DispatchQueue? = nil) { + public convenience init(queueQoS: DispatchQoS = .default, + targetQueue: DispatchQueue? = nil, + notificationQueue: DispatchQueue? = .main) throws { var zeroAddress = sockaddr() zeroAddress.sa_len = UInt8(MemoryLayout.size) zeroAddress.sa_family = sa_family_t(AF_INET) - guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else { return nil } + guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else { + throw ReachabilityError.failedToCreateWithAddress(zeroAddress, SCError()) + } - self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue) + self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue) } deinit { @@ -158,20 +176,46 @@ public extension Reachability { let callback: SCNetworkReachabilityCallBack = { (reachability, flags, info) in guard let info = info else { return } - let reachability = Unmanaged.fromOpaque(info).takeUnretainedValue() - reachability.flags = flags + // `weakifiedReachability` is guaranteed to exist by virtue of our + // retain/release callbacks which we provided to the `SCNetworkReachabilityContext`. + let weakifiedReachability = Unmanaged.fromOpaque(info).takeUnretainedValue() + + // The weak `reachability` _may_ no longer exist if the `Reachability` + // object has since been deallocated but a callback was already in flight. + weakifiedReachability.reachability?.flags = flags } - var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) - context.info = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()) + let weakifiedReachability = ReachabilityWeakifier(reachability: self) + let opaqueWeakifiedReachability = Unmanaged.passUnretained(weakifiedReachability).toOpaque() + + var context = SCNetworkReachabilityContext( + version: 0, + info: UnsafeMutableRawPointer(opaqueWeakifiedReachability), + retain: { (info: UnsafeRawPointer) -> UnsafeRawPointer in + let unmanagedWeakifiedReachability = Unmanaged.fromOpaque(info) + _ = unmanagedWeakifiedReachability.retain() + return UnsafeRawPointer(unmanagedWeakifiedReachability.toOpaque()) + }, + release: { (info: UnsafeRawPointer) -> Void in + let unmanagedWeakifiedReachability = Unmanaged.fromOpaque(info) + unmanagedWeakifiedReachability.release() + }, + copyDescription: { (info: UnsafeRawPointer) -> Unmanaged in + let unmanagedWeakifiedReachability = Unmanaged.fromOpaque(info) + let weakifiedReachability = unmanagedWeakifiedReachability.takeUnretainedValue() + let description = weakifiedReachability.reachability?.description ?? "nil" + return Unmanaged.passRetained(description as CFString) + } + ) + if !SCNetworkReachabilitySetCallback(reachabilityRef, callback, &context) { stopNotifier() - throw ReachabilityError.UnableToSetCallback + throw ReachabilityError.unableToSetCallback(SCError()) } if !SCNetworkReachabilitySetDispatchQueue(reachabilityRef, reachabilitySerialQueue) { stopNotifier() - throw ReachabilityError.UnableToSetDispatchQueue + throw ReachabilityError.unableToSetDispatchQueue(SCError()) } // Perform an initial check @@ -190,7 +234,7 @@ public extension Reachability { // MARK: - *** Connection test methods *** @available(*, deprecated, message: "Please use `connection != .none`") var isReachable: Bool { - return connection != .none + return connection != .unavailable } @available(*, deprecated, message: "Please use `connection == .cellular`") @@ -205,18 +249,7 @@ public extension Reachability { } var description: String { - guard let flags = flags else { return "unavailable flags" } - let W = isRunningOnDevice ? (flags.isOnWWANFlagSet ? "W" : "-") : "X" - let R = flags.isReachableFlagSet ? "R" : "-" - let c = flags.isConnectionRequiredFlagSet ? "c" : "-" - let t = flags.isTransientConnectionFlagSet ? "t" : "-" - let i = flags.isInterventionRequiredFlagSet ? "i" : "-" - let C = flags.isConnectionOnTrafficFlagSet ? "C" : "-" - let D = flags.isConnectionOnDemandFlagSet ? "D" : "-" - let l = flags.isLocalAddressFlagSet ? "l" : "-" - let d = flags.isDirectFlagSet ? "d" : "-" - - return "\(W)\(R) \(c)\(t)\(i)\(C)\(D)\(l)\(d)" + return flags?.description ?? "unavailable flags" } } @@ -227,21 +260,23 @@ fileprivate extension Reachability { var flags = SCNetworkReachabilityFlags() if !SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags) { self.stopNotifier() - throw ReachabilityError.UnableToGetInitialFlags + throw ReachabilityError.unableToGetFlags(SCError()) } self.flags = flags } } - func reachabilityChanged() { - let block = connection != .none ? whenReachable : whenUnreachable - DispatchQueue.main.async { [weak self] in + func notifyReachabilityChanged() { + let notify = { [weak self] in guard let self = self else { return } - block?(self) + self.connection != .unavailable ? self.whenReachable?(self) : self.whenUnreachable?(self) self.notificationCenter.post(name: .reachabilityChanged, object: self) } + + // notify on the configured `notificationQueue`, or the caller's (i.e. `reachabilitySerialQueue`) + notificationQueue?.async(execute: notify) ?? notify() } } @@ -250,13 +285,13 @@ extension SCNetworkReachabilityFlags { typealias Connection = Reachability.Connection var connection: Connection { - guard isReachableFlagSet else { return .none } + guard isReachableFlagSet else { return .unavailable } // If we're reachable, but not on an iOS device (i.e. simulator), we must be on WiFi #if targetEnvironment(simulator) return .wifi #else - var connection = Connection.none + var connection = Connection.unavailable if !isConnectionRequiredFlagSet { connection = .wifi @@ -313,4 +348,59 @@ extension SCNetworkReachabilityFlags { var isConnectionRequiredAndTransientFlagSet: Bool { return intersection([.connectionRequired, .transientConnection]) == [.connectionRequired, .transientConnection] } + + var description: String { + let W = isOnWWANFlagSet ? "W" : "-" + let R = isReachableFlagSet ? "R" : "-" + let c = isConnectionRequiredFlagSet ? "c" : "-" + let t = isTransientConnectionFlagSet ? "t" : "-" + let i = isInterventionRequiredFlagSet ? "i" : "-" + let C = isConnectionOnTrafficFlagSet ? "C" : "-" + let D = isConnectionOnDemandFlagSet ? "D" : "-" + let l = isLocalAddressFlagSet ? "l" : "-" + let d = isDirectFlagSet ? "d" : "-" + + return "\(W)\(R) \(c)\(t)\(i)\(C)\(D)\(l)\(d)" + } +} + +/** + `ReachabilityWeakifier` weakly wraps the `Reachability` class + in order to break retain cycles when interacting with CoreFoundation. + + CoreFoundation callbacks expect a pair of retain/release whenever an + opaque `info` parameter is provided. These callbacks exist to guard + against memory management race conditions when invoking the callbacks. + + #### Race Condition + + If we passed `SCNetworkReachabilitySetCallback` a direct reference to our + `Reachability` class without also providing corresponding retain/release + callbacks, then a race condition can lead to crashes when: + - `Reachability` is deallocated on thread X + - A `SCNetworkReachability` callback(s) is already in flight on thread Y + + #### Retain Cycle + + If we pass `Reachability` to CoreFoundtion while also providing retain/ + release callbacks, we would create a retain cycle once CoreFoundation + retains our `Reachability` class. This fixes the crashes and his how + CoreFoundation expects the API to be used, but doesn't play nicely with + Swift/ARC. This cycle would only be broken after manually calling + `stopNotifier()` — `deinit` would never be called. + + #### ReachabilityWeakifier + + By providing both retain/release callbacks and wrapping `Reachability` in + a weak wrapper, we: + - interact correctly with CoreFoundation, thereby avoiding a crash. + See "Memory Management Programming Guide for Core Foundation". + - don't alter the public API of `Reachability.swift` in any way + - still allow for automatic stopping of the notifier on `deinit`. + */ +private class ReachabilityWeakifier { + weak var reachability: Reachability? + init(reachability: Reachability) { + self.reachability = reachability + } } diff --git a/Pods/RxCocoa/README.md b/Pods/RxCocoa/README.md index 83d2f6c..82f754b 100644 --- a/Pods/RxCocoa/README.md +++ b/Pods/RxCocoa/README.md @@ -177,6 +177,18 @@ github "ReactiveX/RxSwift" ~> 5.0 $ carthage update ``` +#### Carthage as a Static Library + +Carthage defaults to building RxSwift as a Dynamic Library. + +If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage: + +```bash +carthage update RxSwift --platform iOS --no-build +sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj +carthage build RxAlamofire --platform iOS +``` + ### [Swift Package Manager](https://github.com/apple/swift-package-manager) Create a `Package.swift` file. diff --git a/Pods/RxRelay/README.md b/Pods/RxRelay/README.md index 83d2f6c..82f754b 100644 --- a/Pods/RxRelay/README.md +++ b/Pods/RxRelay/README.md @@ -177,6 +177,18 @@ github "ReactiveX/RxSwift" ~> 5.0 $ carthage update ``` +#### Carthage as a Static Library + +Carthage defaults to building RxSwift as a Dynamic Library. + +If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage: + +```bash +carthage update RxSwift --platform iOS --no-build +sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj +carthage build RxAlamofire --platform iOS +``` + ### [Swift Package Manager](https://github.com/apple/swift-package-manager) Create a `Package.swift` file. diff --git a/Pods/RxSwift/README.md b/Pods/RxSwift/README.md index 83d2f6c..82f754b 100644 --- a/Pods/RxSwift/README.md +++ b/Pods/RxSwift/README.md @@ -177,6 +177,18 @@ github "ReactiveX/RxSwift" ~> 5.0 $ carthage update ``` +#### Carthage as a Static Library + +Carthage defaults to building RxSwift as a Dynamic Library. + +If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage: + +```bash +carthage update RxSwift --platform iOS --no-build +sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj +carthage build RxAlamofire --platform iOS +``` + ### [Swift Package Manager](https://github.com/apple/swift-package-manager) Create a `Package.swift` file. diff --git a/Pods/Target Support Files/ReachabilitySwift/ReachabilitySwift-Info.plist b/Pods/Target Support Files/ReachabilitySwift/ReachabilitySwift-Info.plist index 33563de..e2771ff 100644 --- a/Pods/Target Support Files/ReachabilitySwift/ReachabilitySwift-Info.plist +++ b/Pods/Target Support Files/ReachabilitySwift/ReachabilitySwift-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.3.1 + 5.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/RxCocoa/RxCocoa-Info.plist b/Pods/Target Support Files/RxCocoa/RxCocoa-Info.plist index e2771ff..8d87a1a 100644 --- a/Pods/Target Support Files/RxCocoa/RxCocoa-Info.plist +++ b/Pods/Target Support Files/RxCocoa/RxCocoa-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.0.0 + 5.0.1 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/RxReachability/RxReachability-Info.plist b/Pods/Target Support Files/RxReachability/RxReachability-Info.plist index 2243fe6..21a30b4 100644 --- a/Pods/Target Support Files/RxReachability/RxReachability-Info.plist +++ b/Pods/Target Support Files/RxReachability/RxReachability-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.0 + 1.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/RxRelay/RxRelay-Info.plist b/Pods/Target Support Files/RxRelay/RxRelay-Info.plist index e2771ff..8d87a1a 100644 --- a/Pods/Target Support Files/RxRelay/RxRelay-Info.plist +++ b/Pods/Target Support Files/RxRelay/RxRelay-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.0.0 + 5.0.1 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/RxSwift/RxSwift-Info.plist b/Pods/Target Support Files/RxSwift/RxSwift-Info.plist index e2771ff..8d87a1a 100644 --- a/Pods/Target Support Files/RxSwift/RxSwift-Info.plist +++ b/Pods/Target Support Files/RxSwift/RxSwift-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.0.0 + 5.0.1 CFBundleSignature ???? CFBundleVersion diff --git a/RxReachability-Example/AppDelegate.swift b/RxReachability-Example/AppDelegate.swift index 0ebecc2..af7c248 100644 --- a/RxReachability-Example/AppDelegate.swift +++ b/RxReachability-Example/AppDelegate.swift @@ -13,7 +13,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true @@ -41,6 +40,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } - } - diff --git a/RxReachability-Example/ViewController.swift b/RxReachability-Example/ViewController.swift index c1fc96d..edd5c05 100644 --- a/RxReachability-Example/ViewController.swift +++ b/RxReachability-Example/ViewController.swift @@ -16,7 +16,7 @@ class ViewController: UIViewController { @IBOutlet private weak var label: UILabel! - let reachability = Reachability()! + let reachability = try! Reachability() let disposeBag = DisposeBag() override func viewDidLoad() { @@ -38,4 +38,3 @@ class ViewController: UIViewController { reachability.stopNotifier() } } - diff --git a/RxReachability.podspec b/RxReachability.podspec index 7a43aba..5654f3e 100644 --- a/RxReachability.podspec +++ b/RxReachability.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'RxReachability' - s.version = '1.0.0' + s.version = '1.1.0' s.summary = 'RxSwift bindings for Reachability' s.description = <<-DESC @@ -34,7 +34,7 @@ Pod::Spec.new do |s| s.swift_version = '5.0' - s.dependency 'ReachabilitySwift', '~> 4.3.1' + s.dependency 'ReachabilitySwift', '~> 5.0' s.dependency 'RxSwift', '~> 5' s.dependency 'RxCocoa', '~> 5' end diff --git a/RxReachability.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/RxReachability.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index 949b678..f9b0d7c 100644 --- a/RxReachability.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/RxReachability.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -2,7 +2,7 @@ - BuildSystemType - Original + PreviewsEnabled + diff --git a/RxReachability/Sources/ObservableType+Reachability.swift b/RxReachability/Sources/ObservableType+Reachability.swift index f8b50e5..18312d3 100644 --- a/RxReachability/Sources/ObservableType+Reachability.swift +++ b/RxReachability/Sources/ObservableType+Reachability.swift @@ -20,7 +20,7 @@ public extension ObservableType { .timeout(timeout, scheduler: MainScheduler.asyncInstance) } } - + func retryOnConnect( timeout: DispatchTimeInterval, predicate: @escaping (Swift.Error) -> Bool @@ -39,7 +39,7 @@ public extension ObservableType { } } } - + func retryLatestOnConnect( timeout: DispatchTimeInterval, predicate: @escaping (Swift.Error) -> Bool @@ -58,5 +58,5 @@ public extension ObservableType { } } } - + } diff --git a/RxReachability/Sources/Reachability+Rx.swift b/RxReachability/Sources/Reachability+Rx.swift index c62ab08..cc811c5 100644 --- a/RxReachability/Sources/Reachability+Rx.swift +++ b/RxReachability/Sources/Reachability+Rx.swift @@ -31,7 +31,7 @@ public extension Reactive where Base: Reachability { static var isReachable: Observable { return reachabilityChanged - .map { $0.connection != .none } + .map { $0.connection != .unavailable } } static var isConnected: Observable { @@ -66,7 +66,7 @@ public extension Reactive where Base: Reachability { var isReachable: Observable { return reachabilityChanged - .map { $0.connection != .none } + .map { $0.connection != .unavailable } } var isConnected: Observable { @@ -81,4 +81,3 @@ public extension Reactive where Base: Reachability { .map { _ in Void() } } } -