3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_Connectivity_TestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_Connectivity_TestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-Connectivity_Tests/Pods-Connectivity_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Connectivity-iOS" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Connectivity-iOS/Connectivity.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs/OHHTTPStubs.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
8 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Connectivity" -framework "Foundation" -framework "OHHTTPStubs" -framework "SystemConfiguration" -weak_framework "Combine" -weak_framework "Network"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
13 | PODS_ROOT = ${SRCROOT}/Pods
14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-Connectivity_Tests/Pods-Connectivity_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_Connectivity_Tests {
2 | umbrella header "Pods-Connectivity_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-Connectivity_Tests/Pods-Connectivity_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Connectivity-iOS" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Connectivity-iOS/Connectivity.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/OHHTTPStubs/OHHTTPStubs.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift
8 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" -framework "Connectivity" -framework "Foundation" -framework "OHHTTPStubs" -framework "SystemConfiguration" -weak_framework "Combine" -weak_framework "Network"
9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
10 | PODS_BUILD_DIR = ${BUILD_DIR}
11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
13 | PODS_ROOT = ${SRCROOT}/Pods
14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
16 |
--------------------------------------------------------------------------------
/Example/Tests/BackgroundingTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BackgroundingTests.swift
3 | // Connectivity
4 | //
5 | // Created by Ross Butler on 15/09/2020.
6 | // Copyright © 2020 Ross Butler. All rights reserved.
7 | //
8 |
9 | @testable import Connectivity
10 | import OHHTTPStubs
11 | import UIKit
12 | import XCTest
13 |
14 | class BackgroundingTests: XCTestCase {
15 | private let timeout: TimeInterval = 5.0
16 |
17 | func testConnectivityCheckOnApplicationDidBecomeActive() {
18 | stubHost("www.apple.com", withHTMLFrom: "success-response.html")
19 | let connectivity = Connectivity()
20 | connectivity.checkWhenApplicationDidBecomeActive = true
21 | connectivity.framework = .systemConfiguration
22 | connectivity.startNotifier()
23 |
24 | // First notification will be posted on invocation of `startNotifier`.
25 | let connectedNotificationExpectation = expectation(
26 | forNotification: Notification.Name.ConnectivityDidChange,
27 | object: connectivity,
28 | handler: nil
29 | )
30 | wait(for: [connectedNotificationExpectation], timeout: timeout)
31 |
32 | // In order for another notification to be posted the connectivity status will need to change.
33 | stubHost("captive.apple.com", withHTMLFrom: "failure-response.html")
34 | stubHost("www.apple.com", withHTMLFrom: "failure-response.html")
35 |
36 | // Posting `UIApplication.didBecomeActiveNotification` will trigger another check.
37 | NotificationCenter.default.post(name: UIApplication.didBecomeActiveNotification, object: nil)
38 | let disconnectedNotificationExpectation = expectation(
39 | forNotification: Notification.Name.ConnectivityDidChange,
40 | object: connectivity,
41 | handler: nil
42 | )
43 | wait(for: [disconnectedNotificationExpectation], timeout: timeout)
44 | connectivity.stopNotifier()
45 | }
46 |
47 | func testConnectivityDoesNotCheckOnApplicationDidBecomeActive() {
48 | stubHost("www.apple.com", withHTMLFrom: "success-response.html")
49 | let connectivity = Connectivity()
50 | connectivity.checkWhenApplicationDidBecomeActive = false
51 | connectivity.framework = .systemConfiguration
52 | connectivity.startNotifier()
53 |
54 | // First notification will be posted on invocation of `startNotifier`.
55 | let connectedNotificationExpectation = expectation(
56 | forNotification: Notification.Name.ConnectivityDidChange,
57 | object: connectivity,
58 | handler: nil
59 | )
60 | wait(for: [connectedNotificationExpectation], timeout: timeout)
61 |
62 | // In order for another notification to be posted the connectivity status will need to change.
63 | stubHost("captive.apple.com", withHTMLFrom: "failure-response.html")
64 | stubHost("www.apple.com", withHTMLFrom: "failure-response.html")
65 |
66 | // Posting `UIApplication.didBecomeActiveNotification` will trigger another check.
67 | NotificationCenter.default.post(name: UIApplication.didBecomeActiveNotification, object: nil)
68 | let disconnectedNotificationExpectation = expectation(
69 | forNotification: Notification.Name.ConnectivityDidChange,
70 | object: connectivity,
71 | handler: nil
72 | )
73 | disconnectedNotificationExpectation.isInverted = true
74 | wait(for: [disconnectedNotificationExpectation], timeout: timeout / 2)
75 | connectivity.stopNotifier()
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Example/Tests/ConnectivityPercentageTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ConnectivityPercentageTests.swift
3 | // Connectivity
4 | //
5 | // Created by Ross Butler on 10/05/2020.
6 | // Copyright © 2020 Ross Butler. All rights reserved.
7 | //
8 |
9 | @testable import Connectivity
10 | import XCTest
11 |
12 | class ConnectivityPercentageTests: XCTestCase {
13 | func testMidRangeValueApplied() {
14 | let sut = ConnectivityPercentage(50.0)
15 | XCTAssertEqual(sut.value, 50.0)
16 | }
17 |
18 | func testLowerBoundaryValueApplied() {
19 | let sut = ConnectivityPercentage(0.0)
20 | XCTAssertEqual(sut.value, 0.0)
21 | }
22 |
23 | func testUpperBoundaryValueApplied() {
24 | let sut = ConnectivityPercentage(100.0)
25 | XCTAssertEqual(sut.value, 100.0)
26 | }
27 |
28 | func testOutOfLowerBoundValueNotApplied() {
29 | let sut = ConnectivityPercentage(-0.1)
30 | XCTAssertEqual(sut.value, 0.0)
31 | }
32 |
33 | func testOutOfUpperBoundValueNotApplied() {
34 | let sut = ConnectivityPercentage(100.1)
35 | XCTAssertEqual(sut.value, 100.0)
36 | }
37 |
38 | func testConnectivityPercentageCalculatedWithMidRangeUIntValues() {
39 | let sut = ConnectivityPercentage(UInt(2), outOf: UInt(10))
40 | XCTAssertEqual(sut.value, 20.0)
41 | }
42 |
43 | func testConnectivityPercentageCalculatedWithLowerBoundaryUIntValues() {
44 | let sut = ConnectivityPercentage(UInt(0), outOf: UInt(1))
45 | XCTAssertEqual(sut.value, 0.0)
46 | }
47 |
48 | func testConnectivityPercentageCalculatedIsZeroWhenDivisorIsZero() {
49 | let sut = ConnectivityPercentage(UInt(1), outOf: UInt(0))
50 | XCTAssertEqual(sut.value, 0.0)
51 | }
52 |
53 | func testConnectivityPercentageNotLessThanSameValue() {
54 | XCTAssertFalse(ConnectivityPercentage(0.0) < ConnectivityPercentage(0.0))
55 | }
56 |
57 | func testConnectivityPercentageIsLessThanGreaterValue() {
58 | XCTAssertTrue(ConnectivityPercentage(0.0) < ConnectivityPercentage(0.1))
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Example/Tests/ConnectivityStatusTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ConnectivityStatusTests.swift
3 | // Connectivity
4 | //
5 | // Created by Ross Butler on 10/05/2020.
6 | // Copyright © 2020 Ross Butler. All rights reserved.
7 | //
8 |
9 | @testable import Connectivity
10 | import XCTest
11 |
12 | class ConnectivityStatusTests: XCTestCase {
13 | func testDescriptionForConnectedIsCorrect() {
14 | let sut = ConnectivityStatus.connected
15 | XCTAssertEqual(sut.description, "Internet access")
16 | }
17 |
18 | func testDescriptionForCellularWithInternetIsCorrect() {
19 | let sut = ConnectivityStatus.connectedViaCellular
20 | XCTAssertEqual(sut.description, "Cellular with Internet access")
21 | }
22 |
23 | func testDescriptionForCellularWithoutInternetIsCorrect() {
24 | let sut = ConnectivityStatus.connectedViaCellularWithoutInternet
25 | XCTAssertEqual(sut.description, "Cellular without Internet access")
26 | }
27 |
28 | func testDescriptionForWiFiWithInternetIsCorrect() {
29 | let sut = ConnectivityStatus.connectedViaWiFi
30 | XCTAssertEqual(sut.description, "Wi-Fi with Internet access")
31 | }
32 |
33 | func testDescriptionForWiFiWithoutInternetIsCorrect() {
34 | let sut = ConnectivityStatus.connectedViaWiFiWithoutInternet
35 | XCTAssertEqual(sut.description, "Wi-Fi without Internet access")
36 | }
37 |
38 | func testDescriptionForDeterminingIsCorrect() {
39 | let sut = ConnectivityStatus.determining
40 | XCTAssertEqual(sut.description, "Connectivity checks pending")
41 | }
42 |
43 | func testDescriptionForNoConnectionIsCorrect() {
44 | let sut = ConnectivityStatus.notConnected
45 | XCTAssertEqual(sut.description, "No Connection")
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Example/Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/Tests/MockResponseValidator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MockResponseValidator.swift
3 | // Connectivity
4 | //
5 | // Created by Ross Butler on 14/05/2022.
6 | // Copyright © 2022 Ross Butler. All rights reserved.
7 | //
8 |
9 | @testable import Connectivity
10 | import Foundation
11 |
12 | class MockResponseValidator: ResponseValidator {
13 | private let isResponseValid: Bool
14 | private(set) var isResponseValidCalled = false
15 | private(set) var lastData: Data?
16 | private(set) var lastResponse: URLResponse?
17 | private(set) var lastURLRequest: URLRequest?
18 |
19 | init(isResponseValid: Bool = true) {
20 | self.isResponseValid = isResponseValid
21 | }
22 |
23 | func isResponseValid(urlRequest: URLRequest, response: URLResponse?, data: Data?) -> Bool {
24 | isResponseValidCalled = true
25 | lastData = data
26 | lastResponse = response
27 | lastURLRequest = urlRequest
28 | return isResponseValid
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Example/Tests/RegularExpressionResponseValidatorTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ConnectivityResponseRegExValidatorTests.swift
3 | // Connectivity_Example
4 | //
5 | // Created by Ross Butler on 10/24/19.
6 | // Copyright © 2019 Ross Butler. All rights reserved.
7 | //
8 |
9 | @testable import Connectivity
10 | import Foundation
11 | import XCTest
12 |
13 | class RegularExpressionResponseValidatorTests: XCTestCase {
14 | func testRegexStringValidation() throws {
15 | try checkValid(string: "test1234", matchedBy: "test[0-9]+", expectedResult: true)
16 | try checkValid(string: "testa1234", matchedBy: "test[0-9]+", expectedResult: false)
17 | }
18 |
19 | private func checkValid(
20 | string: String,
21 | matchedBy regEx: String,
22 | expectedResult: Bool,
23 | file: StaticString = #filePath,
24 | line: UInt = #line
25 | ) throws {
26 | let data = string.data(using: .utf8)
27 | let url = try XCTUnwrap(URL(string: "https://example.com"))
28 | let urlRequest = URLRequest(url: url)
29 | let validator = ConnectivityResponseRegExValidator(regEx: regEx)
30 | let result = validator.isResponseValid(urlRequest: urlRequest, response: nil, data: data)
31 | let expectedResultStr = expectedResult ? "match" : "not match"
32 | let message = "Expected \"\(string)\" to \(expectedResultStr) \(regEx) via regex"
33 | XCTAssertEqual(result, expectedResult, message, file: file, line: line)
34 | }
35 |
36 | func testResponseInvalidWhenDataIsNil() throws {
37 | let regEx = "test[0-9]+"
38 | let url = try XCTUnwrap(URL(string: "https://example.com"))
39 | let urlRequest = URLRequest(url: url)
40 | let validator = ConnectivityResponseRegExValidator(regEx: regEx)
41 | let responseValid = validator.isResponseValid(urlRequest: urlRequest, response: nil, data: nil)
42 | XCTAssertFalse(responseValid)
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Example/Tests/ResponseValidatorFactoryTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ResponseValidatorFactoryTests.swift
3 | // Connectivity_Tests
4 | //
5 | // Created by Ross Butler on 25/10/2019.
6 | // Copyright © 2019 CocoaPods. All rights reserved.
7 | //
8 |
9 | @testable import Connectivity
10 | import Foundation
11 | import XCTest
12 |
13 | class ResponseValidatorFactoryTests: XCTestCase {
14 | /// Test correct validator is returned for validation mode `.equalsExpectedResponseString`.
15 | func testEqualsExpectedResponseString() {
16 | let responseValidator = ConnectivityResponseContainsStringValidator()
17 | let factory = ResponseValidatorFactory(
18 | validationMode: .equalsExpectedResponseString,
19 | expectedResponse: "expected",
20 | regEx: "",
21 | customValidator: responseValidator
22 | )
23 | let validator = factory.manufacture()
24 | XCTAssert(validator is ConnectivityResponseStringEqualityValidator)
25 | }
26 |
27 | /// Test correct validator is returned for validation mode `.containsExpectedResponseString`.
28 | func testContainsExpectedResponseString() {
29 | let responseValidator = ConnectivityResponseContainsStringValidator()
30 | let factory = ResponseValidatorFactory(
31 | validationMode: .containsExpectedResponseString,
32 | expectedResponse: "expected",
33 | regEx: "",
34 | customValidator: responseValidator
35 | )
36 | let validator = factory.manufacture()
37 | XCTAssert(validator is ConnectivityResponseContainsStringValidator)
38 | }
39 |
40 | /// Test correct validator is returned for validation mode `.matchesRegularExpression`.
41 | func testMatchesRegularExpression() {
42 | let responseValidator = ConnectivityResponseContainsStringValidator()
43 | let factory = ResponseValidatorFactory(
44 | validationMode: .matchesRegularExpression,
45 | expectedResponse: "expected",
46 | regEx: "",
47 | customValidator: responseValidator
48 | )
49 | let validator = factory.manufacture()
50 | XCTAssert(validator is ConnectivityResponseRegExValidator)
51 | }
52 |
53 | /// Test correct validator is returned for validation mode `.custom`.
54 | func testCustomValidatorReturnedForCustomValidationMode() {
55 | let responseValidator = ConnectivityResponseRegExValidator()
56 | let factory = ResponseValidatorFactory(
57 | validationMode: .custom,
58 | expectedResponse: "expected",
59 | regEx: "",
60 | customValidator: responseValidator
61 | )
62 | let validator = factory.manufacture()
63 | XCTAssert(validator === responseValidator)
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Example/Tests/StringEqualityResponseValidatorTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StringEqualityResponseValidatorTests.swift
3 | // Connectivity
4 | //
5 | // Created by Ross Butler on 10/28/19.
6 | // Copyright © 2019 Ross Butler. All rights reserved.
7 | //
8 |
9 | @testable import Connectivity
10 | import Foundation
11 | import OHHTTPStubs
12 | import XCTest
13 |
14 | class StringEqualityResponseValidatorTests: XCTestCase {
15 | private let timeout: TimeInterval = 5.0
16 |
17 | override func tearDown() {
18 | super.tearDown()
19 | HTTPStubs.removeAllStubs()
20 | }
21 |
22 | /// Test response is valid when the response string is equal to the expected response.
23 | func testEqualsExpectedResponseString() {
24 | stubHost("www.apple.com", withHTMLFrom: "string-equality-response.html")
25 | let expectation = XCTestExpectation(description: "Connectivity check succeeds")
26 | let connectivity = Connectivity()
27 | connectivity.responseValidator = ConnectivityResponseStringEqualityValidator(expectedResponse: "Success")
28 | connectivity.validationMode = .custom
29 | let connectivityChanged: (Connectivity) -> Void = { connectivity in
30 | XCTAssert(connectivity.status == .connectedViaWiFi)
31 | expectation.fulfill()
32 | }
33 | connectivity.whenConnected = connectivityChanged
34 | connectivity.whenDisconnected = connectivityChanged
35 | connectivity.startNotifier()
36 | wait(for: [expectation], timeout: timeout)
37 | connectivity.stopNotifier()
38 | }
39 |
40 | /// Test response is invalid when the response string is not equal to the expected response.
41 | func testNotEqualsExpectedResponseString() {
42 | stubHost("www.apple.com", withHTMLFrom: "string-contains-response.html")
43 | let expectation = XCTestExpectation(description: "Connectivity check fails")
44 | let connectivity = Connectivity()
45 | connectivity.responseValidator = ConnectivityResponseStringEqualityValidator(expectedResponse: "Success")
46 | connectivity.validationMode = .custom
47 | let connectivityChanged: (Connectivity) -> Void = { connectivity in
48 | XCTAssert(connectivity.status == .connectedViaWiFiWithoutInternet)
49 | expectation.fulfill()
50 | }
51 | connectivity.whenConnected = connectivityChanged
52 | connectivity.whenDisconnected = connectivityChanged
53 | connectivity.startNotifier()
54 | wait(for: [expectation], timeout: timeout)
55 | connectivity.stopNotifier()
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Example/Tests/failure-response.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Example/Tests/string-contains-response.html:
--------------------------------------------------------------------------------
1 |
2 | Successful
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Example/Tests/string-equality-response.html:
--------------------------------------------------------------------------------
1 | Success
2 |
--------------------------------------------------------------------------------
/Example/Tests/success-response.html:
--------------------------------------------------------------------------------
1 |
2 | Success
3 |
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2017 - 2018 Ross Butler
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.10
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "Connectivity",
6 | platforms: [
7 | .iOS(.v12),
8 | .tvOS(.v12),
9 | .macOS(.v10_13)
10 | ],
11 | products: [
12 | .library(
13 | name: "Connectivity",
14 | targets: ["Connectivity"]
15 | )
16 | ],
17 | targets: [
18 | .target(
19 | name: "Connectivity",
20 | dependencies: ["Reachability"],
21 | path: "Connectivity/Classes",
22 | exclude: ["Reachability"],
23 | swiftSettings: [.define("IMPORT_REACHABILITY")]
24 | ),
25 | .target(
26 | name: "Reachability",
27 | dependencies: [],
28 | path: "Connectivity/Classes/Reachability",
29 | publicHeadersPath: "",
30 | cSettings: [
31 | .headerSearchPath("Connectivity/Classes/Reachability")
32 | ]
33 | )
34 | ]
35 | )
36 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------
/docs/images/add-package.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwbutler/Connectivity/30956aa751170afee0feb340714829dff159b265/docs/images/add-package.png
--------------------------------------------------------------------------------
/docs/images/connectivity-banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwbutler/Connectivity/30956aa751170afee0feb340714829dff159b265/docs/images/connectivity-banner.png
--------------------------------------------------------------------------------
/docs/images/connectivity-large-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwbutler/Connectivity/30956aa751170afee0feb340714829dff159b265/docs/images/connectivity-large-logo.png
--------------------------------------------------------------------------------
/docs/images/connectivity-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwbutler/Connectivity/30956aa751170afee0feb340714829dff159b265/docs/images/connectivity-logo.png
--------------------------------------------------------------------------------
/docs/images/package-options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwbutler/Connectivity/30956aa751170afee0feb340714829dff159b265/docs/images/package-options.png
--------------------------------------------------------------------------------
/docs/presentations/connectivity.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rwbutler/Connectivity/30956aa751170afee0feb340714829dff159b265/docs/presentations/connectivity.pdf
--------------------------------------------------------------------------------
/tools/linting/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "object": {
3 | "pins": [
4 | {
5 | "package": "SwiftFormat",
6 | "repositoryURL": "https://github.com/nicklockwood/SwiftFormat.git",
7 | "state": {
8 | "branch": null,
9 | "revision": "2dcce7fe2d6c245d8d669d394d5be5fe45d582fc",
10 | "version": "0.49.8"
11 | }
12 | }
13 | ]
14 | },
15 | "version": 1
16 | }
17 |
--------------------------------------------------------------------------------
/tools/linting/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.1
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "linting",
6 | platforms: [.macOS(.v10_11)],
7 | dependencies: [
8 | .package(url: "https://github.com/nicklockwood/SwiftFormat.git", from: "0.48.10"),
9 | ],
10 | targets: [.target(name: "linting", path: "")]
11 | )
12 |
--------------------------------------------------------------------------------