Repository: ashleymills/Reachability.swift Branch: master Commit: 21d1dc412cfe Files: 54 Total size: 173.1 KB Directory structure: gitextract_kp0zgfb7/ ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Package.swift ├── README.md ├── Reachability.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata/ │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata/ │ └── xcschemes/ │ └── Reachability.xcscheme ├── ReachabilityAppleTVSample/ │ ├── AppDelegate.swift │ ├── Assets.xcassets/ │ │ ├── App Icon & Top Shelf Image.brandassets/ │ │ │ ├── App Icon - Large.imagestack/ │ │ │ │ ├── Back.imagestacklayer/ │ │ │ │ │ ├── Content.imageset/ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── Contents.json │ │ │ │ ├── Contents.json │ │ │ │ ├── Front.imagestacklayer/ │ │ │ │ │ ├── Content.imageset/ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── Contents.json │ │ │ │ └── Middle.imagestacklayer/ │ │ │ │ ├── Content.imageset/ │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── App Icon - Small.imagestack/ │ │ │ │ ├── Back.imagestacklayer/ │ │ │ │ │ ├── Content.imageset/ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── Contents.json │ │ │ │ ├── Contents.json │ │ │ │ ├── Front.imagestacklayer/ │ │ │ │ │ ├── Content.imageset/ │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── Contents.json │ │ │ │ └── Middle.imagestacklayer/ │ │ │ │ ├── Content.imageset/ │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── Top Shelf Image Wide.imageset/ │ │ │ │ └── Contents.json │ │ │ └── Top Shelf Image.imageset/ │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── LaunchImage.launchimage/ │ │ └── Contents.json │ ├── Base.lproj/ │ │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift ├── ReachabilityMacSample/ │ ├── AppDelegate.swift │ ├── Assets.xcassets/ │ │ └── AppIcon.appiconset/ │ │ └── Contents.json │ ├── Base.lproj/ │ │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift ├── ReachabilitySample/ │ ├── AppDelegate.swift │ ├── Assets.xcassets/ │ │ └── AppIcon.appiconset/ │ │ └── Contents.json │ ├── Base.lproj/ │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets/ │ │ └── AppIcon.appiconset/ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── ReachabilitySwift.podspec ├── SECURITY.md ├── Sources/ │ ├── Info.plist │ ├── PrivacyInfo.xcprivacy │ ├── Reachability.h │ └── Reachability.swift └── Tests/ ├── Info.plist └── ReachabilityTests.swift ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode # build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.xccheckout *.moved-aside DerivedData *.hmap *.ipa *.xcuserstate # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # # Pods/ .DS_Store # Carthage Carthage/Build ================================================ FILE: CHANGELOG.md ================================================ # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [5.0.0] - 2019-10-19 ### Thanks to: - @p4checo - @connorpower ### Changed - `init()` methods now `throw` - `ReachabilityError` contains the error code returned by `SCError(`) after an error occurs. - Renamed error cases to start with lowercase ### Added - Allow configuring the notification `DispatchQueue`, which was previously hardcoded to `DispatchQueue.main`. It is now an optional, which if set to `nil` will use the notifier's internal queue to fire notifications. The default is still `.main` ### Fixed - Fixed a crash which could occur if Reachability was deallocated at the same time a system thread was calling back into Reachability ### Deprecated - To resolve an issue when using optional Reachability vars, `Connection.none` has been deprecated. Use `Connection.unavailable` instead. ## [4.3.1] - 2018-10-18 ### Fixed - Link CoreTelephony.framework required in iOS 12 (@corteggo) ### Changed - Updates for Swift 5.0 (@simonboriis) - `strongSelf` -> `self` (@strawb3rryx7) ## [4.3.0] - 2018-10-01 ### Changed - Updates for Swift 4.2 ## [4.2.1] - 2018-08-30 ### Fixed - Set reachabilty flags if `connection` called before `startNotifier` (https://github.com/ashleymills/Reachability.swift/issues/307) ## [4.2.0] - 2018-08-29 ### Changed - Use a single target for all platforms - Add **ReachabilityTests** target - Remove logging - `Notification.Name.reachabilityChanged` is public - Added optional `queueQoS` and `targetQueue` to `init(reachabilityRef: SCNetworkReachability, queueQoS: DispatchQoS = .default, targetQueue: DispatchQueue? = nil)` - Added optional `queueQoS` and `targetQueue` to `init?(hostname: String, queueQoS: DispatchQoS = .default, targetQueue: DispatchQueue? = nil)` - Added optional `queueQoS` and `targetQueue` to `init?(queueQoS: DispatchQoS = .default, targetQueue: DispatchQueue? = nil)` - Move macOS deployment target to 10.10 ## [4.1.0] - 2017-10-10 ### Changed - Version update only to fix Cocoapods issue ## [4.0.0] - 2017-10-10 ### Changed - `NetworkStatus` renamed `Connection` - `currentReachabilityStatus` renamed `connection` - `isReachableViaWWAN` has been renamed to `isReachableViaCellular` - `reachableOnWWAN` has been renamed to `allowsCellularConnection` - 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) ### Deprecated - `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. ================================================ FILE: CONTRIBUTING.md ================================================ # Stack Overflow **Stack Overflow** is a fantastic resource for programmers, with many active users who are usually able to answer questions much quicker than I can. Tag then with `reachability-swift` [Follow this link](http://stackoverflow.com/questions/ask?tags=reachability-swift) to ask your question on SO # Raising an issue here ### Has someone else raised the issue? Check through currently open AND closed issues. If the issue has already been raised, please comment on the existing one. ### It doesn't work "It doesn't work" doesn't help anyone solve your problem. What doesn't work? + It didn't compile? + It crashed? + It didn't show the correct Reachability state? ### It won't compile If it won't compile, what error messages are you seeing? Include the code that's at fault - a screen shot might help here. ### It crashed If it crashed, include a stack-trace, and the code that's in error. ### Other stuff + What version of Reachability.Swift are you using? + How is it installed? Manually, CocoaPods, Carthage? + Does it occur on device or simulator? Which device? + What OS version are you running on? + How often does it happen? + Are there steps you can take to reproduce it? Help me to help you! Ash ================================================ FILE: LICENSE ================================================ Copyright (c) 2016 Ashley Mills Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Package.swift ================================================ // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "Reachability", products: [ .library( name: "Reachability", targets: ["Reachability"]), ], targets: [ .target( name: "Reachability", dependencies: [], path: "Sources", resources: [.copy("PrivacyInfo.xcprivacy")] ), .testTarget( name: "ReachabilityTests", dependencies: ["Reachability"], path: "Tests"), ] ) ================================================ FILE: README.md ================================================ # Reachability.swift Reachability.swift is a replacement for Apple's Reachability sample, re-written in Swift with closures. 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 ## Supporting **Reachability.swift** Keeping **Reachability.swift** up-to-date is a time consuming task. Making updates, reviewing pull requests, responding to issues and answering emails all take time. Please consider sponsoring me https://github.com/sponsors/ashleymills, it's a great way to say thanks! If you're an iOS developer who's looking for a quick and easy way to create App Store screenshots, please try out my app [Screenshot Producer](https://itunes.apple.com/app/apple-store/id1252374855?pt=215893&ct=reachability&mt=8)… Devices | Layout | Copy | Localize | Export       :------:|:------:|:------:|:------:|:------: ![](http://is2.mzstatic.com/image/thumb/Purple118/v4/64/af/55/64af55bc-2ef0-691c-f5f3-4963685f7f63/source/552x414bb.jpg) | ![](http://is4.mzstatic.com/image/thumb/Purple128/v4/fb/4c/bd/fb4cbd2f-dd04-22ba-4fdf-5ac652693fb8/source/552x414bb.jpg) | ![](http://is1.mzstatic.com/image/thumb/Purple118/v4/5a/4f/cf/5a4fcfdf-ca04-0307-9f2e-83178e8ad90d/source/552x414bb.jpg) | ![](http://is4.mzstatic.com/image/thumb/Purple128/v4/17/ea/56/17ea562e-e045-96e7-fcac-cfaaf4f499fd/source/552x414bb.jpg) | ![](http://is4.mzstatic.com/image/thumb/Purple118/v4/59/9e/dd/599edd50-f05c-f413-8e88-e614731fd828/source/552x414bb.jpg) And don't forget to **★** the repo. This increases its visibility and encourages others to contribute. Thanks Ash ## Got a problem? Please read https://github.com/ashleymills/Reachability.swift/blob/master/CONTRIBUTING.md before raising an issue. ## Installation ### Manual Just drop the **Reachability.swift** file into your project. That's it! ### CocoaPods [CocoaPods][] is a dependency manager for Cocoa projects. To install Reachability.swift with CocoaPods: 1. Make sure CocoaPods is [installed][CocoaPods Installation]. 2. Update your Podfile to include the following: ``` ruby use_frameworks! pod 'ReachabilitySwift' ``` 3. Run `pod install`. [CocoaPods]: https://cocoapods.org [CocoaPods Installation]: https://guides.cocoapods.org/using/getting-started.html#getting-started 4. In your code import Reachability like so: `import Reachability` ### Carthage [Carthage][] is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To install Reachability.swift with Carthage: 1. Install Carthage via [Homebrew][] ```bash $ brew update $ brew install carthage ``` 2. Add `github "ashleymills/Reachability.swift"` to your Cartfile. 3. Run `carthage update`. 4. Drag `Reachability.framework` from the `Carthage/Build/iOS/` directory to the `Linked Frameworks and Libraries` section of your Xcode project’s `General` settings. 5. Add `$(SRCROOT)/Carthage/Build/iOS/Reachability.framework` to `Input Files` of Run Script Phase for Carthage. 6. In your code import Reachability like so: `import Reachability` [Carthage]: https://github.com/Carthage/Carthage [Homebrew]: http://brew.sh [Photo Flipper]: https://itunes.apple.com/app/apple-store/id749627884?pt=215893&ct=GitHubReachability&mt=8 ### Swift Package Manager (SPM) The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. To integrate using Apple's Swift package manager from xcode : 1. File -> Swift Packages -> Add Package Dependency... 2. Enter package URL : https://github.com/ashleymills/Reachability.swift, choose the latest release ## Example - closures NOTE: All closures are run on the **main queue**. ```swift //declare this property where it won't go out of scope relative to your listener let reachability = try! Reachability() reachability.whenReachable = { reachability in if reachability.connection == .wifi { print("Reachable via WiFi") } else { print("Reachable via Cellular") } } reachability.whenUnreachable = { _ in print("Not reachable") } do { try reachability.startNotifier() } catch { print("Unable to start notifier") } ``` and for stopping notifications ```swift reachability.stopNotifier() ``` ## Example - notifications NOTE: All notifications are delivered on the **main queue**. ```swift //declare this property where it won't go out of scope relative to your listener let reachability = try! Reachability() //declare this inside of viewWillAppear NotificationCenter.default.addObserver(self, selector: #selector(reachabilityChanged(note:)), name: .reachabilityChanged, object: reachability) do{ try reachability.startNotifier() }catch{ print("could not start reachability notifier") } ``` and ```swift @objc func reachabilityChanged(note: Notification) { let reachability = note.object as! Reachability switch reachability.connection { case .wifi: print("Reachable via WiFi") case .cellular: print("Reachable via Cellular") case .unavailable: print("Network not reachable") } } ``` and for stopping notifications ```swift reachability.stopNotifier() NotificationCenter.default.removeObserver(self, name: .reachabilityChanged, object: reachability) ``` ## Want to help? Got a bug fix, or a new feature? Create a pull request and go for it! ## Let me know! If you use **Reachability.swift**, please let me know about your app and I'll put a link [here…](https://github.com/ashleymills/Reachability.swift/wiki/Apps-using-Reachability.swift) and tell your friends! Cheers, Ash ================================================ FILE: Reachability.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 00C54B221C09CF68001C3F12 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00C54B211C09CF68001C3F12 /* AppDelegate.swift */; }; 00C54B241C09CF68001C3F12 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00C54B231C09CF68001C3F12 /* ViewController.swift */; }; 00C54B261C09CF68001C3F12 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 00C54B251C09CF68001C3F12 /* Assets.xcassets */; }; 00C54B291C09CF68001C3F12 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 00C54B271C09CF68001C3F12 /* Main.storyboard */; }; 038915562B43EF8500FF33BB /* PrivacyInfo.xcprivacy in CopyFiles */ = {isa = PBXBuildFile; fileRef = 038915522B43EEDF00FF33BB /* PrivacyInfo.xcprivacy */; }; 335AD58E2052EA92000D4D08 /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335AD5882052EA92000D4D08 /* Reachability.swift */; }; 335AD58F2052EA92000D4D08 /* Reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 335AD5892052EA92000D4D08 /* Reachability.h */; settings = {ATTRIBUTES = (Public, ); }; }; 335AD5A22052EB32000D4D08 /* ReachabilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335AD58C2052EA92000D4D08 /* ReachabilityTests.swift */; }; 335AD5A52052EE07000D4D08 /* Reachability.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA7344721BE7678B008AFE69 /* Reachability.framework */; }; 57A45A041C197BE800384AE4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A45A031C197BE800384AE4 /* AppDelegate.swift */; }; 57A45A061C197BE800384AE4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A45A051C197BE800384AE4 /* ViewController.swift */; }; 57A45A091C197BE800384AE4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57A45A071C197BE800384AE4 /* Main.storyboard */; }; 57A45A0B1C197BE800384AE4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 57A45A0A1C197BE800384AE4 /* Assets.xcassets */; }; AA7344931BE76820008AFE69 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7344921BE76820008AFE69 /* AppDelegate.swift */; }; AA7344951BE76820008AFE69 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7344941BE76820008AFE69 /* ViewController.swift */; }; AA7344981BE76820008AFE69 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA7344961BE76820008AFE69 /* Main.storyboard */; }; AA73449A1BE76820008AFE69 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AA7344991BE76820008AFE69 /* Assets.xcassets */; }; AA7344B51BE769D6008AFE69 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA7344B31BE769D6008AFE69 /* LaunchScreen.xib */; }; CA0FDB6E22B6C7C1008CAD21 /* Reachability.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA7344721BE7678B008AFE69 /* Reachability.framework */; }; CA0FDB6F22B6C7C1008CAD21 /* Reachability.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AA7344721BE7678B008AFE69 /* Reachability.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CAC230C51BF2180000F6464E /* Reachability.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA7344721BE7678B008AFE69 /* Reachability.framework */; }; CAC230C61BF2180000F6464E /* Reachability.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AA7344721BE7678B008AFE69 /* Reachability.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CAE85CCD2136B21B00320E68 /* Reachability.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA7344721BE7678B008AFE69 /* Reachability.framework */; }; CAE85CCE2136B21B00320E68 /* Reachability.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AA7344721BE7678B008AFE69 /* Reachability.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 335AD59D2052EB22000D4D08 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = AA7344691BE7678B008AFE69 /* Project object */; proxyType = 1; remoteGlobalIDString = AA7344711BE7678B008AFE69; remoteInfo = Reachability; }; CA0FDB7022B6C7C2008CAD21 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = AA7344691BE7678B008AFE69 /* Project object */; proxyType = 1; remoteGlobalIDString = AA7344711BE7678B008AFE69; remoteInfo = Reachability; }; CAC230C71BF2180000F6464E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = AA7344691BE7678B008AFE69 /* Project object */; proxyType = 1; remoteGlobalIDString = AA7344711BE7678B008AFE69; remoteInfo = Reachability; }; CAE85CCF2136B21B00320E68 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = AA7344691BE7678B008AFE69 /* Project object */; proxyType = 1; remoteGlobalIDString = AA7344711BE7678B008AFE69; remoteInfo = Reachability; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 038915552B43EF7100FF33BB /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 7; files = ( 038915562B43EF8500FF33BB /* PrivacyInfo.xcprivacy in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; 57A45A361C197F4800384AE4 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( CAE85CCE2136B21B00320E68 /* Reachability.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; CA0FDB7222B6C7C2008CAD21 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( CA0FDB6F22B6C7C1008CAD21 /* Reachability.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; CAC230C91BF2180100F6464E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( CAC230C61BF2180000F6464E /* Reachability.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 00C54B1F1C09CF67001C3F12 /* ReachabilityMacSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReachabilityMacSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 00C54B211C09CF68001C3F12 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 00C54B231C09CF68001C3F12 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 00C54B251C09CF68001C3F12 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 00C54B281C09CF68001C3F12 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 00C54B2A1C09CF68001C3F12 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 038915522B43EEDF00FF33BB /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 335AD5882052EA92000D4D08 /* Reachability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = ""; }; 335AD5892052EA92000D4D08 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; 335AD58A2052EA92000D4D08 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 335AD58C2052EA92000D4D08 /* ReachabilityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReachabilityTests.swift; sourceTree = ""; }; 335AD58D2052EA92000D4D08 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 335AD5972052EB22000D4D08 /* ReachabilityTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReachabilityTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57A45A011C197BE800384AE4 /* ReachabilityAppleTVSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReachabilityAppleTVSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 57A45A031C197BE800384AE4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 57A45A051C197BE800384AE4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 57A45A081C197BE800384AE4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 57A45A0A1C197BE800384AE4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57A45A0C1C197BE800384AE4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AA7344721BE7678B008AFE69 /* Reachability.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Reachability.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AA7344901BE76820008AFE69 /* ReachabilitySample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReachabilitySample.app; sourceTree = BUILT_PRODUCTS_DIR; }; AA7344921BE76820008AFE69 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; AA7344941BE76820008AFE69 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; AA7344971BE76820008AFE69 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; AA7344991BE76820008AFE69 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; AA73449E1BE76820008AFE69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AA7344B41BE769D6008AFE69 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; CA1983301F6FD0CD007D2DD1 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; CA6187601F8D21D700FD5234 /* CONTRIBUTING.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; }; CA6187611F8D21D700FD5234 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; CA6187621F8D21D700FD5234 /* ReachabilitySwift.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = ReachabilitySwift.podspec; sourceTree = ""; }; CA6187651F8D220200FD5234 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; CA66930222BACD5E001BB352 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 00C54B321C09D1AA001C3F12 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CA0FDB6E22B6C7C1008CAD21 /* Reachability.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 335AD5942052EB22000D4D08 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 335AD5A52052EE07000D4D08 /* Reachability.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 57A459FE1C197BE800384AE4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CAE85CCD2136B21B00320E68 /* Reachability.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; AA73446E1BE7678B008AFE69 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; AA73448D1BE76820008AFE69 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CAC230C51BF2180000F6464E /* Reachability.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 00C54B201C09CF68001C3F12 /* ReachabilityMacSample */ = { isa = PBXGroup; children = ( 00C54B211C09CF68001C3F12 /* AppDelegate.swift */, 00C54B231C09CF68001C3F12 /* ViewController.swift */, 00C54B251C09CF68001C3F12 /* Assets.xcassets */, 00C54B271C09CF68001C3F12 /* Main.storyboard */, 00C54B2A1C09CF68001C3F12 /* Info.plist */, ); path = ReachabilityMacSample; sourceTree = ""; }; 335AD5872052EA92000D4D08 /* Sources */ = { isa = PBXGroup; children = ( 038915522B43EEDF00FF33BB /* PrivacyInfo.xcprivacy */, 335AD5882052EA92000D4D08 /* Reachability.swift */, 335AD5892052EA92000D4D08 /* Reachability.h */, 335AD58A2052EA92000D4D08 /* Info.plist */, ); path = Sources; sourceTree = ""; }; 335AD58B2052EA92000D4D08 /* Tests */ = { isa = PBXGroup; children = ( 335AD58C2052EA92000D4D08 /* ReachabilityTests.swift */, 335AD58D2052EA92000D4D08 /* Info.plist */, ); path = Tests; sourceTree = ""; }; 335AD5A42052EE07000D4D08 /* Frameworks */ = { isa = PBXGroup; children = ( ); name = Frameworks; sourceTree = ""; }; 57A45A021C197BE800384AE4 /* ReachabilityAppleTVSample */ = { isa = PBXGroup; children = ( 57A45A031C197BE800384AE4 /* AppDelegate.swift */, 57A45A051C197BE800384AE4 /* ViewController.swift */, 57A45A071C197BE800384AE4 /* Main.storyboard */, 57A45A0A1C197BE800384AE4 /* Assets.xcassets */, 57A45A0C1C197BE800384AE4 /* Info.plist */, ); path = ReachabilityAppleTVSample; sourceTree = ""; }; AA7344681BE7678B008AFE69 = { isa = PBXGroup; children = ( CA66930222BACD5E001BB352 /* Package.swift */, CA1983301F6FD0CD007D2DD1 /* README.md */, CA6187651F8D220200FD5234 /* CHANGELOG.md */, CA6187601F8D21D700FD5234 /* CONTRIBUTING.md */, CA6187611F8D21D700FD5234 /* LICENSE */, CA6187621F8D21D700FD5234 /* ReachabilitySwift.podspec */, 335AD5872052EA92000D4D08 /* Sources */, 335AD58B2052EA92000D4D08 /* Tests */, AA7344911BE76820008AFE69 /* ReachabilitySample */, 00C54B201C09CF68001C3F12 /* ReachabilityMacSample */, 57A45A021C197BE800384AE4 /* ReachabilityAppleTVSample */, AA7344731BE7678B008AFE69 /* Products */, 335AD5A42052EE07000D4D08 /* Frameworks */, ); sourceTree = ""; }; AA7344731BE7678B008AFE69 /* Products */ = { isa = PBXGroup; children = ( AA7344721BE7678B008AFE69 /* Reachability.framework */, AA7344901BE76820008AFE69 /* ReachabilitySample.app */, 00C54B1F1C09CF67001C3F12 /* ReachabilityMacSample.app */, 57A45A011C197BE800384AE4 /* ReachabilityAppleTVSample.app */, 335AD5972052EB22000D4D08 /* ReachabilityTests.xctest */, ); name = Products; sourceTree = ""; }; AA7344911BE76820008AFE69 /* ReachabilitySample */ = { isa = PBXGroup; children = ( AA7344921BE76820008AFE69 /* AppDelegate.swift */, AA7344941BE76820008AFE69 /* ViewController.swift */, AA7344961BE76820008AFE69 /* Main.storyboard */, AA7344991BE76820008AFE69 /* Assets.xcassets */, AA7344B31BE769D6008AFE69 /* LaunchScreen.xib */, AA73449E1BE76820008AFE69 /* Info.plist */, ); path = ReachabilitySample; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ AA73446F1BE7678B008AFE69 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 335AD58F2052EA92000D4D08 /* Reachability.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 00C54B1E1C09CF67001C3F12 /* ReachabilityMacSample */ = { isa = PBXNativeTarget; buildConfigurationList = 00C54B2B1C09CF68001C3F12 /* Build configuration list for PBXNativeTarget "ReachabilityMacSample" */; buildPhases = ( 00C54B1B1C09CF67001C3F12 /* Sources */, 00C54B1D1C09CF67001C3F12 /* Resources */, 00C54B321C09D1AA001C3F12 /* Frameworks */, CA0FDB7222B6C7C2008CAD21 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( CA0FDB7122B6C7C2008CAD21 /* PBXTargetDependency */, ); name = ReachabilityMacSample; productName = ReachabilityMacSample; productReference = 00C54B1F1C09CF67001C3F12 /* ReachabilityMacSample.app */; productType = "com.apple.product-type.application"; }; 335AD5962052EB22000D4D08 /* ReachabilityTests */ = { isa = PBXNativeTarget; buildConfigurationList = 335AD59F2052EB22000D4D08 /* Build configuration list for PBXNativeTarget "ReachabilityTests" */; buildPhases = ( 335AD5932052EB22000D4D08 /* Sources */, 335AD5942052EB22000D4D08 /* Frameworks */, 335AD5952052EB22000D4D08 /* Resources */, ); buildRules = ( ); dependencies = ( 335AD59E2052EB22000D4D08 /* PBXTargetDependency */, ); name = ReachabilityTests; productName = ReachabilityTests; productReference = 335AD5972052EB22000D4D08 /* ReachabilityTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 57A45A001C197BE800384AE4 /* ReachabilityAppleTVSample */ = { isa = PBXNativeTarget; buildConfigurationList = 57A45A0F1C197BE800384AE4 /* Build configuration list for PBXNativeTarget "ReachabilityAppleTVSample" */; buildPhases = ( 57A459FD1C197BE800384AE4 /* Sources */, 57A459FE1C197BE800384AE4 /* Frameworks */, 57A459FF1C197BE800384AE4 /* Resources */, 57A45A361C197F4800384AE4 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( CAE85CD02136B21B00320E68 /* PBXTargetDependency */, ); name = ReachabilityAppleTVSample; productName = ReachabilityAppleTVSample; productReference = 57A45A011C197BE800384AE4 /* ReachabilityAppleTVSample.app */; productType = "com.apple.product-type.application"; }; AA7344711BE7678B008AFE69 /* Reachability */ = { isa = PBXNativeTarget; buildConfigurationList = AA7344861BE7678B008AFE69 /* Build configuration list for PBXNativeTarget "Reachability" */; buildPhases = ( AA73446D1BE7678B008AFE69 /* Sources */, 038915552B43EF7100FF33BB /* CopyFiles */, AA73446E1BE7678B008AFE69 /* Frameworks */, AA73446F1BE7678B008AFE69 /* Headers */, AA7344701BE7678B008AFE69 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = Reachability; productName = Reachability; productReference = AA7344721BE7678B008AFE69 /* Reachability.framework */; productType = "com.apple.product-type.framework"; }; AA73448F1BE76820008AFE69 /* ReachabilitySample */ = { isa = PBXNativeTarget; buildConfigurationList = AA7344AA1BE76820008AFE69 /* Build configuration list for PBXNativeTarget "ReachabilitySample" */; buildPhases = ( AA73448C1BE76820008AFE69 /* Sources */, AA73448D1BE76820008AFE69 /* Frameworks */, AA73448E1BE76820008AFE69 /* Resources */, CAC230C91BF2180100F6464E /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( CAC230C81BF2180000F6464E /* PBXTargetDependency */, ); name = ReachabilitySample; productName = ReachabilitySample; productReference = AA7344901BE76820008AFE69 /* ReachabilitySample.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ AA7344691BE7678B008AFE69 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; LastUpgradeCheck = 1110; ORGANIZATIONNAME = "Ashley Mills"; TargetAttributes = { 00C54B1E1C09CF67001C3F12 = { CreatedOnToolsVersion = 7.1.1; LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; 335AD5962052EB22000D4D08 = { CreatedOnToolsVersion = 9.2; LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; 57A45A001C197BE800384AE4 = { CreatedOnToolsVersion = 7.1.1; LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; AA7344711BE7678B008AFE69 = { CreatedOnToolsVersion = 7.1; DevelopmentTeamName = "Joylord Systems Ltd"; LastSwiftMigration = 1000; ProvisioningStyle = Manual; }; AA73448F1BE76820008AFE69 = { CreatedOnToolsVersion = 7.1; LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; }; }; buildConfigurationList = AA73446C1BE7678B008AFE69 /* Build configuration list for PBXProject "Reachability" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = AA7344681BE7678B008AFE69; productRefGroup = AA7344731BE7678B008AFE69 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( AA7344711BE7678B008AFE69 /* Reachability */, 335AD5962052EB22000D4D08 /* ReachabilityTests */, AA73448F1BE76820008AFE69 /* ReachabilitySample */, 00C54B1E1C09CF67001C3F12 /* ReachabilityMacSample */, 57A45A001C197BE800384AE4 /* ReachabilityAppleTVSample */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 00C54B1D1C09CF67001C3F12 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 00C54B261C09CF68001C3F12 /* Assets.xcassets in Resources */, 00C54B291C09CF68001C3F12 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 335AD5952052EB22000D4D08 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 57A459FF1C197BE800384AE4 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 57A45A0B1C197BE800384AE4 /* Assets.xcassets in Resources */, 57A45A091C197BE800384AE4 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; AA7344701BE7678B008AFE69 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; AA73448E1BE76820008AFE69 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( AA7344B51BE769D6008AFE69 /* LaunchScreen.xib in Resources */, AA73449A1BE76820008AFE69 /* Assets.xcassets in Resources */, AA7344981BE76820008AFE69 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 00C54B1B1C09CF67001C3F12 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 00C54B241C09CF68001C3F12 /* ViewController.swift in Sources */, 00C54B221C09CF68001C3F12 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 335AD5932052EB22000D4D08 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 335AD5A22052EB32000D4D08 /* ReachabilityTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 57A459FD1C197BE800384AE4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 57A45A061C197BE800384AE4 /* ViewController.swift in Sources */, 57A45A041C197BE800384AE4 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; AA73446D1BE7678B008AFE69 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 335AD58E2052EA92000D4D08 /* Reachability.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; AA73448C1BE76820008AFE69 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( AA7344951BE76820008AFE69 /* ViewController.swift in Sources */, AA7344931BE76820008AFE69 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 335AD59E2052EB22000D4D08 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = AA7344711BE7678B008AFE69 /* Reachability */; targetProxy = 335AD59D2052EB22000D4D08 /* PBXContainerItemProxy */; }; CA0FDB7122B6C7C2008CAD21 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = AA7344711BE7678B008AFE69 /* Reachability */; targetProxy = CA0FDB7022B6C7C2008CAD21 /* PBXContainerItemProxy */; }; CAC230C81BF2180000F6464E /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = AA7344711BE7678B008AFE69 /* Reachability */; targetProxy = CAC230C71BF2180000F6464E /* PBXContainerItemProxy */; }; CAE85CD02136B21B00320E68 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = AA7344711BE7678B008AFE69 /* Reachability */; targetProxy = CAE85CCF2136B21B00320E68 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 00C54B271C09CF68001C3F12 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 00C54B281C09CF68001C3F12 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 57A45A071C197BE800384AE4 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 57A45A081C197BE800384AE4 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; AA7344961BE76820008AFE69 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( AA7344971BE76820008AFE69 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; AA7344B31BE769D6008AFE69 /* LaunchScreen.xib */ = { isa = PBXVariantGroup; children = ( AA7344B41BE769D6008AFE69 /* Base */, ); name = LaunchScreen.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 00C54B2C1C09CF68001C3F12 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = ReachabilityMacSample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.Reachability.ReachabilityMacSample; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; name = Debug; }; 00C54B2D1C09CF68001C3F12 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = ReachabilityMacSample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.Reachability.ReachabilityMacSample; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; 335AD5A02052EB22000D4D08 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(SRCROOT)/Tests/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.Reachability.ReachabilityTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos iphoneos iphonesimulator"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; }; name = Debug; }; 335AD5A12052EB22000D4D08 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "$(SRCROOT)/Tests/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.Reachability.ReachabilityTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos iphoneos iphonesimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; 57A45A0D1C197BE800384AE4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ReachabilityAppleTVSample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = swift.reachability.ReachabilityAppleTVSample; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; }; name = Debug; }; 57A45A0E1C197BE800384AE4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ReachabilityAppleTVSample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = swift.reachability.ReachabilityAppleTVSample; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = 3; }; name = Release; }; AA7344841BE7678B008AFE69 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; AA7344851BE7678B008AFE69 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; AA7344871BE7678B008AFE69 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; APPLICATION_EXTENSION_API_ONLY = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.Reachability; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = ""; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; }; name = Debug; }; AA7344881BE7678B008AFE69 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; APPLICATION_EXTENSION_API_ONLY = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ENABLE_CODE_COVERAGE = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.Reachability; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; }; name = Release; }; AA7344AB1BE76820008AFE69 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ReachabilitySample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.ReachabilitySample; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; AA7344AC1BE76820008AFE69 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ReachabilitySample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.ReachabilitySample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 00C54B2B1C09CF68001C3F12 /* Build configuration list for PBXNativeTarget "ReachabilityMacSample" */ = { isa = XCConfigurationList; buildConfigurations = ( 00C54B2C1C09CF68001C3F12 /* Debug */, 00C54B2D1C09CF68001C3F12 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 335AD59F2052EB22000D4D08 /* Build configuration list for PBXNativeTarget "ReachabilityTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 335AD5A02052EB22000D4D08 /* Debug */, 335AD5A12052EB22000D4D08 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 57A45A0F1C197BE800384AE4 /* Build configuration list for PBXNativeTarget "ReachabilityAppleTVSample" */ = { isa = XCConfigurationList; buildConfigurations = ( 57A45A0D1C197BE800384AE4 /* Debug */, 57A45A0E1C197BE800384AE4 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; AA73446C1BE7678B008AFE69 /* Build configuration list for PBXProject "Reachability" */ = { isa = XCConfigurationList; buildConfigurations = ( AA7344841BE7678B008AFE69 /* Debug */, AA7344851BE7678B008AFE69 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; AA7344861BE7678B008AFE69 /* Build configuration list for PBXNativeTarget "Reachability" */ = { isa = XCConfigurationList; buildConfigurations = ( AA7344871BE7678B008AFE69 /* Debug */, AA7344881BE7678B008AFE69 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; AA7344AA1BE76820008AFE69 /* Build configuration list for PBXNativeTarget "ReachabilitySample" */ = { isa = XCConfigurationList; buildConfigurations = ( AA7344AB1BE76820008AFE69 /* Debug */, AA7344AC1BE76820008AFE69 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = AA7344691BE7678B008AFE69 /* Project object */; } ================================================ FILE: Reachability.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: Reachability.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: Reachability.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded ================================================ FILE: Reachability.xcodeproj/xcshareddata/xcschemes/Reachability.xcscheme ================================================ ================================================ FILE: ReachabilityAppleTVSample/AppDelegate.swift ================================================ // // AppDelegate.swift // ReachabilityAppleTVSample // // Created by Stefan Schmitt on 10/12/15. // Copyright © 2015 Ashley Mills. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { return true } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json ================================================ { "layers" : [ { "filename" : "Front.imagestacklayer" }, { "filename" : "Middle.imagestacklayer" }, { "filename" : "Back.imagestacklayer" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json ================================================ { "layers" : [ { "filename" : "Front.imagestacklayer" }, { "filename" : "Middle.imagestacklayer" }, { "filename" : "Back.imagestacklayer" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json ================================================ { "assets" : [ { "size" : "1280x768", "idiom" : "tv", "filename" : "App Icon - Large.imagestack", "role" : "primary-app-icon" }, { "size" : "400x240", "idiom" : "tv", "filename" : "App Icon - Small.imagestack", "role" : "primary-app-icon" }, { "size" : "2320x720", "idiom" : "tv", "filename" : "Top Shelf Image Wide.imageset", "role" : "top-shelf-image-wide" }, { "size" : "1920x720", "idiom" : "tv", "filename" : "Top Shelf Image.imageset", "role" : "top-shelf-image" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "tv", "scale" : "1x" }, { "idiom" : "tv", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Assets.xcassets/LaunchImage.launchimage/Contents.json ================================================ { "images" : [ { "orientation" : "landscape", "idiom" : "tv", "extent" : "full-screen", "minimum-system-version" : "11.0", "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "tv", "extent" : "full-screen", "minimum-system-version" : "9.0", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityAppleTVSample/Base.lproj/Main.storyboard ================================================ ================================================ FILE: ReachabilityAppleTVSample/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 5.0.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS UIMainStoryboardFile Main UIRequiredDeviceCapabilities arm64 ================================================ FILE: ReachabilityAppleTVSample/ViewController.swift ================================================ // // ViewController.swift // ReachabilityAppleTVSample // // Created by Stefan Schmitt on 10/12/15. // Copyright © 2015 Ashley Mills. All rights reserved. // import UIKit import Reachability class ViewController: UIViewController { @IBOutlet weak var networkStatus: UILabel! @IBOutlet weak var hostNameLabel: UILabel! var reachability: Reachability? let hostNames = [nil, "google.com", "invalidhost"] var hostIndex = 0 override func viewDidLoad() { super.viewDidLoad() startHost(at: 0) } func startHost(at index: Int) { stopNotifier() setupReachability(hostNames[index], useClosures: true) startNotifier() DispatchQueue.main.asyncAfter(deadline: .now() + 5) { self.startHost(at: (index + 1) % 3) } } func setupReachability(_ hostName: String?, useClosures: Bool) { let reachability: Reachability? if let hostName = hostName { reachability = try? Reachability(hostname: hostName) hostNameLabel.text = hostName } else { reachability = try? Reachability() hostNameLabel.text = "No host name" } self.reachability = reachability print("--- set up with host name: \(hostNameLabel.text!)") if useClosures { reachability?.whenReachable = { reachability in self.updateLabelColourWhenReachable(reachability) } reachability?.whenUnreachable = { reachability in self.updateLabelColourWhenNotReachable(reachability) } } else { NotificationCenter.default.addObserver( self, selector: #selector(ViewController.reachabilityChanged(_:)), name: .reachabilityChanged, object: reachability ) } } func startNotifier() { print("--- start notifier") do { try reachability?.startNotifier() } catch { networkStatus.textColor = .red networkStatus.text = "Unable to start\nnotifier" return } } func stopNotifier() { print("--- stop notifier") reachability?.stopNotifier() NotificationCenter.default.removeObserver(self, name: .reachabilityChanged, object: nil) reachability = nil } func updateLabelColourWhenReachable(_ reachability: Reachability) { print("\(reachability.description) - \(reachability.connection)") if reachability.connection == .wifi { self.networkStatus.textColor = .green } else { self.networkStatus.textColor = .blue } self.networkStatus.text = "\(reachability.connection)" } func updateLabelColourWhenNotReachable(_ reachability: Reachability) { print("\(reachability.description) - \(reachability.connection)") self.networkStatus.textColor = .red self.networkStatus.text = "\(reachability.connection)" } @objc func reachabilityChanged(_ note: Notification) { let reachability = note.object as! Reachability if reachability.connection != .none { updateLabelColourWhenReachable(reachability) } else { updateLabelColourWhenNotReachable(reachability) } } deinit { stopNotifier() } } ================================================ FILE: ReachabilityMacSample/AppDelegate.swift ================================================ // // AppDelegate.swift // ReachabilityMacSample // // Created by Reda Lemeden on 28/11/2015. // Copyright © 2015 Ashley Mills. All rights reserved. // import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { } func applicationWillTerminate(_ aNotification: Notification) { } } ================================================ FILE: ReachabilityMacSample/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "mac", "size" : "16x16", "scale" : "1x" }, { "idiom" : "mac", "size" : "16x16", "scale" : "2x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "1x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "2x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "1x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "2x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "1x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "2x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "1x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilityMacSample/Base.lproj/Main.storyboard ================================================ Default Left to Right Right to Left Default Left to Right Right to Left ================================================ FILE: ReachabilityMacSample/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIconFile CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 5.0.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright © 2015 Ashley Mills. All rights reserved. NSMainStoryboardFile Main NSPrincipalClass NSApplication ================================================ FILE: ReachabilityMacSample/ViewController.swift ================================================ // // ViewController.swift // ReachabilityMacSample // // Created by Reda Lemeden on 28/11/2015. // Copyright © 2015 Ashley Mills. All rights reserved. // import Cocoa import Reachability class ViewController: NSViewController { @IBOutlet weak var networkStatus: NSTextField! @IBOutlet weak var hostNameLabel: NSTextField! var reachability: Reachability? let hostNames = [nil, "google.com", "invalidhost"] var hostIndex = 0 override func viewDidLoad() { super.viewDidLoad() view.wantsLayer = true startHost(at: 0) } func startHost(at index: Int) { stopNotifier() setupReachability(hostNames[index], useClosures: true) startNotifier() DispatchQueue.main.asyncAfter(deadline: .now() + 5) { self.startHost(at: (index + 1) % 3) } } func setupReachability(_ hostName: String?, useClosures: Bool) { let reachability: Reachability? if let hostName = hostName { reachability = try? Reachability(hostname: hostName) hostNameLabel.stringValue = hostName } else { reachability = try? Reachability() hostNameLabel.stringValue = "No host name" } self.reachability = reachability print("--- set up with host name: \(hostNameLabel.stringValue)") if useClosures { reachability?.whenReachable = { reachability in self.updateLabelColourWhenReachable(reachability) } reachability?.whenUnreachable = { reachability in self.updateLabelColourWhenNotReachable(reachability) } } else { NotificationCenter.default.addObserver( self, selector: #selector(ViewController.reachabilityChanged(_:)), name: .reachabilityChanged, object: reachability ) } } func startNotifier() { print("--- start notifier") do { try reachability?.startNotifier() } catch { networkStatus.textColor = .red networkStatus.stringValue = "Unable to start\nnotifier" return } } func stopNotifier() { print("--- stop notifier") reachability?.stopNotifier() NotificationCenter.default.removeObserver(self, name: .reachabilityChanged, object: nil) reachability = nil } func updateLabelColourWhenReachable(_ reachability: Reachability) { print("\(reachability.description) - \(reachability.connection.description)") if reachability.connection == .wifi { self.networkStatus.textColor = .green } else { self.networkStatus.textColor = .blue } self.networkStatus.stringValue = "\(reachability.connection)" } func updateLabelColourWhenNotReachable(_ reachability: Reachability) { print("\(reachability.description) - \(reachability.connection)") self.networkStatus.textColor = .red self.networkStatus.stringValue = "\(reachability.connection)" } @objc func reachabilityChanged(_ note: Notification) { let reachability = note.object as! Reachability if reachability.connection != .unavailable { updateLabelColourWhenReachable(reachability) } else { updateLabelColourWhenNotReachable(reachability) } } } ================================================ FILE: ReachabilitySample/AppDelegate.swift ================================================ // // AppDelegate.swift // Reachability Sample // // Created by Ashley Mills on 22/09/2014. // Copyright (c) 2014 Joylord Systems. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { return true } } ================================================ FILE: ReachabilitySample/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "1x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "2x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" }, { "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" }, { "idiom" : "ios-marketing", "size" : "1024x1024", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilitySample/Base.lproj/LaunchScreen.xib ================================================ ================================================ FILE: ReachabilitySample/Base.lproj/Main.storyboard ================================================ ================================================ FILE: ReachabilitySample/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: ReachabilitySample/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 5.0.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: ReachabilitySample/ViewController.swift ================================================ // // ViewController.swift // Reachability Sample // // Created by Ashley Mills on 22/09/2014. // Copyright (c) 2014 Joylord Systems. All rights reserved. // import UIKit import Reachability class ViewController: UIViewController { @IBOutlet weak var networkStatus: UILabel! @IBOutlet weak var hostNameLabel: UILabel! var reachability: Reachability? let hostNames = [nil, "google.com", "invalidhost"] var hostIndex = 0 override func viewDidLoad() { super.viewDidLoad() startHost(at: 0) } func startHost(at index: Int) { stopNotifier() setupReachability(hostNames[index], useClosures: true) startNotifier() DispatchQueue.main.asyncAfter(deadline: .now() + 5) { self.startHost(at: (index + 1) % 3) } } func setupReachability(_ hostName: String?, useClosures: Bool) { let reachability: Reachability? if let hostName = hostName { reachability = try? Reachability(hostname: hostName) hostNameLabel.text = hostName } else { reachability = try? Reachability() hostNameLabel.text = "No host name" } self.reachability = reachability print("--- set up with host name: \(hostNameLabel.text!)") if useClosures { reachability?.whenReachable = { reachability in self.updateLabelColourWhenReachable(reachability) } reachability?.whenUnreachable = { reachability in self.updateLabelColourWhenNotReachable(reachability) } } else { NotificationCenter.default.addObserver( self, selector: #selector(reachabilityChanged(_:)), name: .reachabilityChanged, object: reachability ) } } func startNotifier() { print("--- start notifier") do { try reachability?.startNotifier() } catch { networkStatus.textColor = .red networkStatus.text = "Unable to start\nnotifier" return } } func stopNotifier() { print("--- stop notifier") reachability?.stopNotifier() NotificationCenter.default.removeObserver(self, name: .reachabilityChanged, object: nil) reachability = nil } func updateLabelColourWhenReachable(_ reachability: Reachability) { print("\(reachability.description) - \(reachability.connection)") if reachability.connection == .wifi { self.networkStatus.textColor = .green } else { self.networkStatus.textColor = .blue } self.networkStatus.text = "\(reachability.connection)" } func updateLabelColourWhenNotReachable(_ reachability: Reachability) { print("\(reachability.description) - \(reachability.connection)") self.networkStatus.textColor = .red self.networkStatus.text = "\(reachability.connection)" } @objc func reachabilityChanged(_ note: Notification) { let reachability = note.object as! Reachability if reachability.connection != .unavailable { updateLabelColourWhenReachable(reachability) } else { updateLabelColourWhenNotReachable(reachability) } } deinit { stopNotifier() } } ================================================ FILE: ReachabilitySwift.podspec ================================================ Pod::Spec.new do |s| s.name = 'ReachabilitySwift' s.version = '5.2.4' s.module_name = 'Reachability' s.homepage = 'https://github.com/ashleymills/Reachability.swift' s.authors = { 'Ashley Mills' => 'ashleymills@mac.com' } s.summary = 'Replacement for Apple\'s Reachability re-written in Swift with callbacks.' s.license = { :type => 'MIT' } # Source Info s.ios.deployment_target = "12.0" s.osx.deployment_target = "10.13" s.tvos.deployment_target = "9.0" s.source = { :git => 'https://github.com/ashleymills/Reachability.swift.git', :tag => 'v'+s.version.to_s } s.source_files = 'Sources/Reachability.swift' s.resource_bundles = {"ReachabilitySwift" => ["Sources/PrivacyInfo.xcprivacy"]} s.framework = 'SystemConfiguration' s.ios.framework = 'CoreTelephony' s.requires_arc = true s.swift_version = '5.0' end ================================================ FILE: SECURITY.md ================================================ # Security Policy ## Supported Versions Use this section to tell people about which versions of your project are currently being supported with security updates. | Version | Supported | | ------- | ------------------ | | 5.1.x | :white_check_mark: | | 5.0.x | :x: | | 4.0.x | :white_check_mark: | | < 4.0 | :x: | ## Reporting a Vulnerability Use this section to tell people how to report a vulnerability. Tell them where to go, how often they can expect to get an update on a reported vulnerability, what to expect if the vulnerability is accepted or declined, etc. ================================================ FILE: Sources/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 5.0.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Sources/PrivacyInfo.xcprivacy ================================================ NSPrivacyTracking ================================================ FILE: Sources/Reachability.h ================================================ // // Reachability.h // Reachability // // Created by Yuki Nagai on 11/2/15. // Copyright © 2015 Ashley Mills. All rights reserved. // #import //! Project version number for Reachability. FOUNDATION_EXPORT double ReachabilityVersionNumber; //! Project version string for Reachability. FOUNDATION_EXPORT const unsigned char ReachabilityVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import ================================================ FILE: Sources/Reachability.swift ================================================ /* Copyright (c) 2014, Ashley Mills All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import SystemConfiguration import Foundation public enum ReachabilityError: Error { case failedToCreateWithAddress(sockaddr, Int32) case failedToCreateWithHostname(String, Int32) case unableToSetCallback(Int32) case unableToSetDispatchQueue(Int32) case unableToGetFlags(Int32) } @available(*, unavailable, renamed: "Notification.Name.reachabilityChanged") public let ReachabilityChangedNotification = NSNotification.Name("ReachabilityChangedNotification") public extension Notification.Name { static let reachabilityChanged = Notification.Name("reachabilityChanged") } public class Reachability { public typealias NetworkReachable = (Reachability) -> () public typealias NetworkUnreachable = (Reachability) -> () @available(*, unavailable, renamed: "Connection") public enum NetworkStatus: CustomStringConvertible { case notReachable, reachableViaWiFi, reachableViaWWAN public var description: String { switch self { case .reachableViaWWAN: return "Cellular" case .reachableViaWiFi: return "WiFi" case .notReachable: return "No Connection" } } } public enum Connection: CustomStringConvertible { case unavailable, wifi, cellular public var description: String { switch self { case .cellular: return "Cellular" case .wifi: return "WiFi" case .unavailable: return "No Connection" } } @available(*, deprecated, renamed: "unavailable") public static let none: Connection = .unavailable } public var whenReachable: NetworkReachable? public var whenUnreachable: NetworkUnreachable? @available(*, deprecated, renamed: "allowsCellularConnection") public let reachableOnWWAN: Bool = true /// Set to `false` to force Reachability.connection to .none when on cellular connection (default value `true`) public var allowsCellularConnection: Bool // The notification center on which "reachability changed" events are being posted public var notificationCenter: NotificationCenter = NotificationCenter.default @available(*, deprecated, renamed: "connection.description") public var currentReachabilityString: String { return "\(connection)" } @available(*, unavailable, renamed: "connection") public var currentReachabilityStatus: Connection { return connection } public var connection: Connection { if flags == nil { try? setReachabilityFlags() } switch flags?.connection { case .unavailable?, nil: return .unavailable case .cellular?: return allowsCellularConnection ? .cellular : .unavailable case .wifi?: return .wifi } } fileprivate var isRunningOnDevice: Bool = { #if targetEnvironment(simulator) return false #else return true #endif }() 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 } notifyReachabilityChanged() } } 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, 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, 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 { throw ReachabilityError.failedToCreateWithAddress(zeroAddress, SCError()) } self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue) } deinit { stopNotifier() } } public extension Reachability { // MARK: - *** Notifier methods *** func startNotifier() throws { guard !notifierRunning else { return } let callback: SCNetworkReachabilityCallBack = { (reachability, flags, info) in guard let info = info else { return } // `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 } 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(SCError()) } if !SCNetworkReachabilitySetDispatchQueue(reachabilityRef, reachabilitySerialQueue) { stopNotifier() throw ReachabilityError.unableToSetDispatchQueue(SCError()) } // Perform an initial check try setReachabilityFlags() notifierRunning = true } func stopNotifier() { defer { notifierRunning = false } SCNetworkReachabilitySetCallback(reachabilityRef, nil, nil) SCNetworkReachabilitySetDispatchQueue(reachabilityRef, nil) } // MARK: - *** Connection test methods *** @available(*, deprecated, message: "Please use `connection != .none`") var isReachable: Bool { return connection != .unavailable } @available(*, deprecated, message: "Please use `connection == .cellular`") var isReachableViaWWAN: Bool { // Check we're not on the simulator, we're REACHABLE and check we're on WWAN return connection == .cellular } @available(*, deprecated, message: "Please use `connection == .wifi`") var isReachableViaWiFi: Bool { return connection == .wifi } var description: String { return flags?.description ?? "unavailable flags" } } fileprivate extension Reachability { func setReachabilityFlags() throws { try reachabilitySerialQueue.sync { [unowned self] in var flags = SCNetworkReachabilityFlags() if !SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags) { self.stopNotifier() throw ReachabilityError.unableToGetFlags(SCError()) } self.flags = flags } } func notifyReachabilityChanged() { let notify = { [weak self] in guard let self = self else { return } 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() } } extension SCNetworkReachabilityFlags { typealias Connection = Reachability.Connection var connection: Connection { 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.unavailable if !isConnectionRequiredFlagSet { connection = .wifi } if isConnectionOnTrafficOrDemandFlagSet { if !isInterventionRequiredFlagSet { connection = .wifi } } if isOnWWANFlagSet { connection = .cellular } return connection #endif } var isOnWWANFlagSet: Bool { #if os(iOS) return contains(.isWWAN) #else return false #endif } var isReachableFlagSet: Bool { return contains(.reachable) } var isConnectionRequiredFlagSet: Bool { return contains(.connectionRequired) } var isInterventionRequiredFlagSet: Bool { return contains(.interventionRequired) } var isConnectionOnTrafficFlagSet: Bool { return contains(.connectionOnTraffic) } var isConnectionOnDemandFlagSet: Bool { return contains(.connectionOnDemand) } var isConnectionOnTrafficOrDemandFlagSet: Bool { return !intersection([.connectionOnTraffic, .connectionOnDemand]).isEmpty } var isTransientConnectionFlagSet: Bool { return contains(.transientConnection) } var isLocalAddressFlagSet: Bool { return contains(.isLocalAddress) } var isDirectFlagSet: Bool { return contains(.isDirect) } 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 } } ================================================ FILE: Tests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: Tests/ReachabilityTests.swift ================================================ // // ReachabilityTests.swift // ReachabilityTests // // Created by Ashley Mills on 23/11/2015. // Copyright © 2015 Ashley Mills. All rights reserved. // import XCTest @testable import Reachability class ReachabilityTests: XCTestCase { func testValidHost() { let validHostName = "google.com" guard let reachability = try? Reachability(hostname: validHostName) else { return XCTFail("Unable to create reachability") } let expected = expectation(description: "Check valid host") reachability.whenReachable = { reachability in print("Pass: \(validHostName) is reachable - \(reachability)") // Only fulfill the expectation on host reachable expected.fulfill() } reachability.whenUnreachable = { reachability in print("\(validHostName) is initially unreachable - \(reachability)") // Expectation isn't fulfilled here, so wait will time out if this is the only closure called } do { try reachability.startNotifier() } catch { return XCTFail("Unable to start notifier") } waitForExpectations(timeout: 5, handler: nil) reachability.stopNotifier() } func testInvalidHost() { // Testing with an invalid host will initially show as reachable, but then the callback // gets fired a second time reporting the host as unreachable let invalidHostName = "invalidhost" guard let reachability = try? Reachability(hostname: invalidHostName) else { return XCTFail("Unable to create reachability") } let expected = expectation(description: "Check invalid host") reachability.whenReachable = { reachability in print("\(invalidHostName) is initially reachable - \(reachability)") } reachability.whenUnreachable = { reachability in print("Pass: \(invalidHostName) is unreachable - \(reachability))") expected.fulfill() } do { try reachability.startNotifier() } catch { return XCTFail("Unable to start notifier") } waitForExpectations(timeout: 5, handler: nil) reachability.stopNotifier() } }