├── .gitignore ├── .jazzy.yaml ├── .slather.yml ├── .swift-version ├── .swiftlint.yml ├── .travis.yml ├── CHANGELOG ├── Cartfile.private ├── Cartfile.resolved ├── Configurations ├── Common.xcconfig ├── Environments │ ├── Debug.xcconfig │ ├── Profile.xcconfig │ ├── Release.xcconfig │ └── Test.xcconfig └── Framework.xcconfig ├── LICENSE ├── README.md ├── Reach.playground ├── Contents.swift ├── Sources │ └── Delay.swift └── contents.xcplayground ├── Reach.podspec ├── Reach.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── Reach.xcscheme ├── Reach.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── WorkspaceSettings.xcsettings ├── Source ├── Callback.swift ├── Info.plist ├── Network.swift ├── Reach.h └── Reach.swift ├── Tests ├── Info.plist ├── ReachDelegateMock.swift └── ReachTests.swift ├── docs ├── Classes.html ├── Enums.html ├── Enums │ ├── Network.html │ └── Network │ │ └── Via.html ├── Initializers.html ├── Instance Methods.html ├── Instance Variables.html ├── Protocols.html ├── Protocols │ └── ReachDelegate.html ├── badge.svg ├── css │ ├── highlight.css │ └── jazzy.css ├── docsets │ ├── Reach.docset │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ ├── Documents │ │ │ ├── Classes.html │ │ │ ├── Enums.html │ │ │ ├── Enums │ │ │ │ ├── Network.html │ │ │ │ └── Network │ │ │ │ │ └── Via.html │ │ │ ├── Initializers.html │ │ │ ├── Instance Methods.html │ │ │ ├── Instance Variables.html │ │ │ ├── Protocols.html │ │ │ ├── Protocols │ │ │ │ └── ReachDelegate.html │ │ │ ├── css │ │ │ │ ├── highlight.css │ │ │ │ └── jazzy.css │ │ │ ├── img │ │ │ │ ├── carat.png │ │ │ │ ├── dash.png │ │ │ │ ├── gh.png │ │ │ │ └── spinner.gif │ │ │ ├── index.html │ │ │ └── js │ │ │ │ ├── jazzy.js │ │ │ │ ├── jazzy.search.js │ │ │ │ ├── jquery.min.js │ │ │ │ ├── lunr.min.js │ │ │ │ └── typeahead.jquery.js │ │ │ └── docSet.dsidx │ └── Reach.tgz ├── img │ ├── carat.png │ ├── dash.png │ ├── gh.png │ ├── logo.svg │ └── spinner.gif ├── index.html ├── js │ ├── jazzy.js │ ├── jazzy.search.js │ ├── jquery.min.js │ ├── lunr.min.js │ └── typeahead.jquery.js └── undocumented.json ├── resources └── logo.svg └── scripts ├── setup └── tests /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | Packages/ 39 | Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | Carthage/Checkouts 54 | Carthage/Build 55 | 56 | # fastlane 57 | # 58 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 59 | # screenshots whenever they are needed. 60 | # For more information about the recommended setup visit: 61 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 62 | 63 | fastlane/report.xml 64 | fastlane/Preview.html 65 | fastlane/screenshots 66 | fastlane/test_output -------------------------------------------------------------------------------- /.jazzy.yaml: -------------------------------------------------------------------------------- 1 | module: Reach 2 | author: Sergio Fernández 3 | author_url: https://therapychat.com 4 | github_url: https://github.com/therapychat/Reach 5 | dash_url: https://therapychat.github.io/Reach/Reach.xml 6 | 7 | theme: fullwidth 8 | clean: true 9 | 10 | readme: README.md 11 | 12 | disable_search: true 13 | skip_undocumented: false 14 | hide_documentation_coverage: false 15 | 16 | copyright: '© 2018 [TherapyChat](https://therapychat.com) under [open source license](https://github.com/therapychat/Reach/blob/master/LICENSE).' 17 | swift_version: '4.0.3' 18 | -------------------------------------------------------------------------------- /.slather.yml: -------------------------------------------------------------------------------- 1 | # .slather.yml 2 | 3 | coverage_service: cobertura_xml 4 | workspace: Reach.xcworkspace 5 | xcodeproj: Reach.xcodeproj 6 | scheme: Reach 7 | configuration: Test 8 | output_directory: coverage 9 | ignore: 10 | - ../**/*/Xcode* 11 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - function_parameter_count 3 | - trailing_whitespace 4 | - nesting 5 | - identifier_name 6 | opt_in_rules: 7 | - empty_count 8 | - force_unwrapping 9 | - private_outlet 10 | line_length: 120 11 | type_body_length: 12 | warning: 300 13 | error: 400 14 | variable_name: 15 | excluded: 16 | - id 17 | - URL 18 | excluded: 19 | - Tests/ 20 | - Carthage/ 21 | - Frameworks/ 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode9.2 6 | language: swift 7 | 8 | before_install: 9 | - gem install cocoapods 10 | - scripts/setup 11 | 12 | script: 13 | - scripts/tests 14 | - pod lib lint 15 | 16 | after_success: 17 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | # Reach CHANGELOG 2 | 3 | ## 1.2.0 4 | Change constructor of Reachability. 5 | 6 | ## 1.1.0 7 | Make Reach class available to watchOS. 8 | 9 | ## 1.0.0 10 | 11 | Initial release. -------------------------------------------------------------------------------- /Cartfile.private: -------------------------------------------------------------------------------- 1 | github "Quick/Nimble" -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "Quick/Nimble" "v7.0.3" 2 | -------------------------------------------------------------------------------- /Configurations/Common.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // This file defines common settings that should be enabled for every new 3 | // project. Typically, you want to use Debug, Release, or a similar variant 4 | // instead. 5 | // 6 | 7 | #include "Framework.xcconfig" 8 | 9 | // Disable legacy-compatible header searching 10 | ALWAYS_SEARCH_USER_PATHS = NO 11 | 12 | // Architectures to build 13 | ARCHS = $(ARCHS_STANDARD) 14 | 15 | // Whether to warn when a floating-point value is used as a loop counter 16 | CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES 17 | 18 | // Whether to warn about use of rand() and random() being used instead of arc4random() 19 | CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES 20 | 21 | // Whether to warn about strcpy() and strcat() 22 | CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES 23 | 24 | // Whether to enable module imports 25 | CLANG_ENABLE_MODULES = YES 26 | 27 | // Enable ARC 28 | CLANG_ENABLE_OBJC_ARC = YES 29 | 30 | // Warn about block captures of implicitly autoreleasing parameters. 31 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES 32 | 33 | // Warn about implicit conversions to boolean values that are suspicious. 34 | // For example, writing 'if (foo)' with 'foo' being the name a function will trigger a warning. 35 | CLANG_WARN_BOOL_CONVERSION = YES 36 | 37 | // Warn about suspicious uses of the comma operator. 38 | CLANG_WARN_COMMA = YES 39 | 40 | // Warn about implicit conversions of constant values that cause the constant value to change, 41 | // either through a loss of precision, or entirely in its meaning. 42 | CLANG_WARN_CONSTANT_CONVERSION = YES 43 | 44 | // Whether to warn when overriding deprecated methods 45 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES 46 | 47 | // Warn about direct accesses to the Objective-C 'isa' pointer instead of using a runtime API. 48 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 49 | 50 | // Warn about declaring the same method more than once within the same @interface. 51 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 52 | 53 | // Warn about loop bodies that are suspiciously empty. 54 | CLANG_WARN_EMPTY_BODY = YES 55 | 56 | // Warn about implicit conversions between different kinds of enum values. 57 | // For example, this can catch issues when using the wrong enum flag as an argument to a function or method. 58 | CLANG_WARN_ENUM_CONVERSION = YES 59 | 60 | // Whether to warn on implicit conversions between signed/unsigned types 61 | CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO 62 | 63 | // Warn about implicit conversions between pointers and integers. 64 | // For example, this can catch issues when one incorrectly intermixes using NSNumbers and raw integers. 65 | CLANG_WARN_INT_CONVERSION = YES 66 | 67 | // Warn about non-literal expressions that evaluate to zero being treated as a null pointer. 68 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES 69 | 70 | // Warn about implicit capture of self (e.g. direct ivar access) 71 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 72 | 73 | // Warn about implicit conversions from Objective-C literals to values of incompatible type. 74 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES 75 | 76 | // Don't warn about repeatedly using a weak reference without assigning the weak reference to a strong reference. Too many false positives. 77 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO 78 | 79 | // Warn about classes that unintentionally do not subclass a root class (such as NSObject). 80 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 81 | 82 | //Warn about ranged-based for loops. 83 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES 84 | 85 | // Whether to warn on suspicious implicit conversions 86 | CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES 87 | 88 | // Warn about non-prototype declarations. 89 | CLANG_WARN_STRICT_PROTOTYPES = YES 90 | 91 | // Warn if an API that is newer than the deployment target is used without "if (@available(...))" guards. 92 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES 93 | 94 | // Warn about incorrect uses of nullable values 95 | CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES 96 | 97 | // Warn for missing nullability attributes 98 | CLANG_ANALYZER_NONNULL = YES 99 | 100 | // Warn when a non-localized string is passed to a user-interface method expecting a localized string 101 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES 102 | 103 | // Warn about potentially unreachable code 104 | CLANG_WARN_UNREACHABLE_CODE = YES 105 | 106 | // The format of debugging symbols 107 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 108 | 109 | // Whether to compile assertions in 110 | ENABLE_NS_ASSERTIONS = YES 111 | 112 | // Whether to require objc_msgSend to be cast before invocation 113 | ENABLE_STRICT_OBJC_MSGSEND = YES 114 | 115 | // Which C variant to use 116 | GCC_C_LANGUAGE_STANDARD = gnu99 117 | 118 | // Whether to enable exceptions for Objective-C 119 | GCC_ENABLE_OBJC_EXCEPTIONS = YES 120 | 121 | // Whether to generate debugging symbols 122 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 123 | 124 | // Whether to precompile the prefix header (if one is specified) 125 | GCC_PRECOMPILE_PREFIX_HEADER = YES 126 | 127 | // Whether to enable strict aliasing, meaning that two pointers of different 128 | // types (other than void * or any id type) cannot point to the same memory 129 | // location 130 | GCC_STRICT_ALIASING = YES 131 | 132 | // Whether symbols not explicitly exported are hidden by default (this primarily 133 | // only affects C++ code) 134 | GCC_SYMBOLS_PRIVATE_EXTERN = NO 135 | 136 | // Whether static variables are thread-safe by default 137 | GCC_THREADSAFE_STATICS = NO 138 | 139 | // Which compiler to use 140 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0 141 | 142 | // Whether warnings are treated as errors 143 | GCC_TREAT_WARNINGS_AS_ERRORS = YES 144 | SWIFT_TREAT_WARNINGS_AS_ERRORS = YES 145 | 146 | // Whether to warn about 64-bit values being implicitly shortened to 32 bits 147 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES 148 | 149 | // Whether to warn about fields missing from structure initializers (only if 150 | // designated initializers aren't used) 151 | GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES 152 | 153 | // Whether to warn about missing function prototypes 154 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO 155 | 156 | // Whether to warn about implicit conversions in the signedness of the type 157 | // a pointer is pointing to (e.g., 'int *' getting converted to 'unsigned int *') 158 | GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES 159 | 160 | // Whether to warn when the value returned from a function/method/block does not 161 | // match its return type 162 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 163 | 164 | // Whether to warn on a class not implementing all the required methods of 165 | // a protocol it declares conformance to 166 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES 167 | 168 | // Whether to warn when switching on an enum value, and all possibilities are 169 | // not accounted for 170 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES 171 | 172 | // Whether to warn about the use of four-character constants 173 | GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES 174 | 175 | // Whether to warn about an aggregate data type's initializer not being fully 176 | // bracketed (e.g., array initializer syntax) 177 | GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES 178 | 179 | // Whether to warn about missing braces or parentheses that make the meaning of 180 | // the code ambiguous 181 | GCC_WARN_MISSING_PARENTHESES = YES 182 | 183 | // Whether to warn about unsafe comparisons between values of different 184 | // signedness 185 | GCC_WARN_SIGN_COMPARE = YES 186 | 187 | // Whether to warn about the arguments to printf-style functions not matching 188 | // the format specifiers 189 | GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES 190 | 191 | // Warn if a "@selector(...)" expression referring to an undeclared selector is found 192 | GCC_WARN_UNDECLARED_SELECTOR = YES 193 | 194 | // Warn if a variable might be clobbered by a setjmp call or if an automatic variable is used without prior initialization. 195 | GCC_WARN_UNINITIALIZED_AUTOS = YES 196 | 197 | // Whether to warn about static functions that are unused 198 | GCC_WARN_UNUSED_FUNCTION = YES 199 | 200 | // Whether to warn about labels that are unused 201 | GCC_WARN_UNUSED_LABEL = YES 202 | 203 | // Whether to warn about variables that are never used 204 | GCC_WARN_UNUSED_VARIABLE = YES 205 | 206 | // Whether to run the static analyzer with every build 207 | RUN_CLANG_STATIC_ANALYZER = YES 208 | 209 | // Don't treat unknown warnings as errors, and disable GCC compatibility warnings and unused static const variable warnings 210 | WARNING_CFLAGS = -Wno-error=unknown-warning-option -Wno-gcc-compat -Wno-unused-const-variable 211 | 212 | // This setting is on for new projects as of Xcode ~6.3, though it is still not 213 | // the default. It warns if the same variable is declared in two binaries that 214 | // are linked together. 215 | GCC_NO_COMMON_BLOCKS = YES 216 | 217 | // This warnings detects when a function will recursively call itself on every 218 | // code path though that function. More information can be found here: 219 | // http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20131216/096004.html 220 | CLANG_WARN_INFINITE_RECURSION = YES 221 | 222 | // This warning detects suspicious uses of std::move. 223 | CLANG_WARN_SUSPICIOUS_MOVE = YES 224 | 225 | // Carthage Frameworks 226 | FRAMEWORK_SEARCH_PATHS = $(PROJECT_DIR)/Carthage/Build/iOS/ 227 | 228 | -------------------------------------------------------------------------------- /Configurations/Environments/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // This file defines the base configuration for a Debug build of any project. 3 | // This should be set at the project level for the Debug configuration. 4 | // 5 | 6 | #include "../Common.xcconfig" 7 | 8 | // Whether to strip debugging symbols when copying resources (like included 9 | // binaries) 10 | COPY_PHASE_STRIP = NO 11 | 12 | // The optimization level (0, 1, 2, 3, s) for the produced binary 13 | GCC_OPTIMIZATION_LEVEL = 0 14 | 15 | // Preproccessor definitions to apply to each file compiled 16 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 17 | 18 | // Allow @testable imports 19 | ENABLE_TESTABILITY = YES 20 | 21 | // Whether to enable link-time optimizations (such as inlining across translation 22 | // units) 23 | LLVM_LTO = NO 24 | 25 | // Whether to only build the active architecture 26 | ONLY_ACTIVE_ARCH = YES 27 | 28 | // Other compiler flags 29 | // 30 | // These settings catch some errors in integer arithmetic 31 | OTHER_CFLAGS = -ftrapv 32 | 33 | // Other flags to pass to the Swift compiler 34 | // 35 | // This enables conditional compilation with #if DEBUG 36 | OTHER_SWIFT_FLAGS = -D DEBUG 37 | 38 | // Xcode 8 introduced a new flag for conditional compilation 39 | // 40 | // This enables conditional compilation with #if DEBUG 41 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG 42 | 43 | // Swift compilation mode 44 | SWIFT_COMPILATION_MODE = singlefile 45 | 46 | // Whether to strip debugging symbols when copying the built product to its 47 | // final installation location 48 | STRIP_INSTALLED_PRODUCT = NO 49 | 50 | // The optimization level (-Onone, -O, -Ofast) for the produced Swift binary 51 | SWIFT_OPTIMIZATION_LEVEL = -Onone 52 | 53 | // Disable Developer ID timestamping 54 | OTHER_CODE_SIGN_FLAGS = --timestamp=none 55 | -------------------------------------------------------------------------------- /Configurations/Environments/Profile.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // This file defines the base configuration for an optional profiling-specific 3 | // build of any project. To use these settings, create a Profile configuration 4 | // in your project, and use this file at the project level for the new 5 | // configuration. 6 | // 7 | 8 | // based on the Release configuration, with some stuff related to debugging 9 | // symbols re-enabled 10 | #include "Release.xcconfig" 11 | 12 | // Whether to strip debugging symbols when copying resources (like included 13 | // binaries) 14 | COPY_PHASE_STRIP = NO 15 | 16 | // Whether to only build the active architecture 17 | ONLY_ACTIVE_ARCH = YES 18 | 19 | // Whether to strip debugging symbols when copying the built product to its 20 | // final installation location 21 | STRIP_INSTALLED_PRODUCT = NO 22 | 23 | // Whether to perform App Store validation checks 24 | VALIDATE_PRODUCT = NO 25 | 26 | // Disable Developer ID timestamping 27 | OTHER_CODE_SIGN_FLAGS = --timestamp=none 28 | -------------------------------------------------------------------------------- /Configurations/Environments/Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // This file defines the base configuration for a Release build of any project. 3 | // This should be set at the project level for the Release configuration. 4 | // 5 | 6 | #include "../Common.xcconfig" 7 | 8 | // Whether to strip debugging symbols when copying resources (like included 9 | // binaries) 10 | COPY_PHASE_STRIP = YES 11 | 12 | // The optimization level (0, 1, 2, 3, s) for the produced binary 13 | GCC_OPTIMIZATION_LEVEL = s 14 | 15 | // Preproccessor definitions to apply to each file compiled 16 | GCC_PREPROCESSOR_DEFINITIONS = NDEBUG=1 17 | 18 | // Whether to enable link-time optimizations (such as inlining across translation 19 | // units) 20 | LLVM_LTO = NO 21 | 22 | // Whether to only build the active architecture 23 | ONLY_ACTIVE_ARCH = NO 24 | 25 | // Whether to strip debugging symbols when copying the built product to its 26 | // final installation location 27 | STRIP_INSTALLED_PRODUCT = YES 28 | 29 | // The optimization level (-Onone, -O, -Owholemodule) for the produced Swift binary 30 | SWIFT_OPTIMIZATION_LEVEL = -O 31 | 32 | // Swift compilation mode 33 | SWIFT_COMPILATION_MODE = wholemodule 34 | 35 | // Whether to perform App Store validation checks 36 | VALIDATE_PRODUCT = YES 37 | 38 | -------------------------------------------------------------------------------- /Configurations/Environments/Test.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // This file defines the base configuration for a Test build of any project. 3 | // This should be set at the project level for the Test configuration. 4 | // 5 | 6 | #include "Debug.xcconfig" 7 | 8 | // Sandboxed apps can't be unit tested since they can't load some random 9 | // external bundle. So we disable sandboxing for testing. 10 | CODE_SIGN_ENTITLEMENTS = 11 | 12 | // Allow @testable imports 13 | ENABLE_TESTABILITY = YES 14 | 15 | // Allows use of APIs that are not available 16 | // to app extensions and linking to frameworks 17 | // that have not been built with this setting enabled. 18 | APPLICATION_EXTENSION_API_ONLY = NO 19 | -------------------------------------------------------------------------------- /Configurations/Framework.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // This file defines additional configuration options that are appropriate only 3 | // for a framework. Typically, you want to use a platform-specific variant 4 | // instead. 5 | // 6 | 7 | // Disable code signing for successful device builds with Xcode 8. Frameworks do 8 | // need to be signed, but they don't need to be signed at compile time because 9 | // they'll be re-signed when you include them in your app. 10 | CODE_SIGNING_REQUIRED = NO 11 | CODE_SIGN_IDENTITY = 12 | 13 | // Whether to strip out code that isn't called from anywhere 14 | DEAD_CODE_STRIPPING = NO 15 | 16 | // Whether this framework should define an LLVM module 17 | DEFINES_MODULE = YES 18 | 19 | // Whether function calls should be position-dependent (should always be 20 | // disabled for library code) 21 | GCC_DYNAMIC_NO_PIC = NO 22 | 23 | // Default frameworks to the name of the project, instead of any 24 | // platform-specific target 25 | PRODUCT_NAME = $(PROJECT_NAME) 26 | 27 | // Enables the framework to be included from any location as long as the 28 | // loader’s runpath search paths includes it. For example from an application 29 | // bundle (inside the "Frameworks" folder) or shared folder 30 | INSTALL_PATH = @rpath 31 | LD_DYLIB_INSTALL_NAME = @rpath/$(PRODUCT_NAME).$(WRAPPER_EXTENSION)/$(PRODUCT_NAME) 32 | SKIP_INSTALL = YES 33 | 34 | // Allows use of APIs that are not available 35 | // to app extensions and linking to frameworks 36 | // that have not been built with this setting enabled. 37 | APPLICATION_EXTENSION_API_ONLY = YES 38 | 39 | // Configuration swift version 40 | SWIFT_VERSION = 4.0 41 | 42 | // Always embed Swift std libs 43 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 44 | 45 | // Universal framework 46 | SUPPORTED_PLATFORMS = macosx iphonesimulator iphoneos watchos watchsimulator appletvos appletvsimulator 47 | VALID_ARCHS[sdk=macosx*] = i386 x86_64 48 | VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s 49 | VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64 50 | VALID_ARCHS[sdk=watchos*] = armv7k 51 | VALID_ARCHS[sdk=watchsimulator*] = i386 52 | VALID_ARCHS[sdk=appletvos*] = arm64 53 | VALID_ARCHS[sdk=appletvsimulator*] = x86_64 54 | 55 | // Dynamic linking uses different default copy paths 56 | LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 57 | LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 58 | LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 59 | LD_RUNPATH_SEARCH_PATHS[sdk=watchos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 60 | LD_RUNPATH_SEARCH_PATHS[sdk=watchsimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 61 | LD_RUNPATH_SEARCH_PATHS[sdk=appletvos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 62 | LD_RUNPATH_SEARCH_PATHS[sdk=appletvsimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 63 | 64 | // OSX-specific default settings 65 | FRAMEWORK_VERSION[sdk=macosx*] = A 66 | COMBINE_HIDPI_IMAGES[sdk=macosx*] = YES 67 | 68 | // iOS-specific default settings 69 | TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*] = 1,2 70 | TARGETED_DEVICE_FAMILY[sdk=iphone*] = 1,2 71 | 72 | // TV-specific default settings 73 | TARGETED_DEVICE_FAMILY[sdk=appletvsimulator*] = 3 74 | TARGETED_DEVICE_FAMILY[sdk=appletv*] = 3 75 | 76 | // Watch-specific default settings 77 | TARGETED_DEVICE_FAMILY[sdk=watchsimulator*] = 4 78 | TARGETED_DEVICE_FAMILY[sdk=watch*] = 4 79 | 80 | ENABLE_BITCODE[sdk=macosx*] = NO 81 | ENABLE_BITCODE[sdk=watchsimulator*] = YES 82 | ENABLE_BITCODE[sdk=watch*] = YES 83 | ENABLE_BITCODE[sdk=iphonesimulator*] = YES 84 | ENABLE_BITCODE[sdk=iphone*] = YES 85 | ENABLE_BITCODE[sdk=appletvsimulator*] = YES 86 | ENABLE_BITCODE[sdk=appletv*] = YES 87 | 88 | // iOS-specific deployment target 89 | IPHONEOS_DEPLOYMENT_TARGET = 10.0 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | ![build](https://img.shields.io/travis/TherapyChat/Reach.svg) 4 | ![swift](https://img.shields.io/badge/Swift-4.0-orange.svg) 5 | ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS-333333.svg) 6 | ![cocoapods](https://img.shields.io/cocoapods/v/Reach.svg) 7 | ![carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg) 8 | ![coverage](https://img.shields.io/codecov/c/github/TherapyChat/Reach.svg) 9 | ![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg) 10 | 11 | ## Table of Contents 12 | * [Overview](#overview) 13 | * [Features](#features) 14 | * [Getting Started](#getting-started) 15 | * [Installation](#installation) 16 | * [Author](#author) 17 | * [Contribution](#contribution) 18 | * [License](#license) 19 | * [Changelog](#changelog) 20 | 21 | ## Overview 22 | Reach is a lightweight reachability framework. 23 | We designed Reach to be simple to use and also very flexible. Written on Swift 3.1 and compatible with: 24 | - iOS 8.0 25 | - macOS 10.10 26 | - tvOS 9.0 27 | - watchOS 2.0 28 | 29 | ## Features 30 | - Super friendly API 31 | - Singleton free 32 | - No external dependencies 33 | - Minimal implementation 34 | - Support for `iOS/macOS/tvOS/watchOS/Linux` 35 | - Support for CocoaPods/Carthage/Swift Package Manager 36 | 37 | ## Getting Started 38 | 39 | Reach contains a status property to check the reachability from network. If you want to receive notifications from network changes, you can subscribe to `ReachDelegate` protocol. 40 | 41 | ```swift 42 | let reach = Reach() 43 | 44 | reach.start() 45 | 46 | print(reach.status) 47 | ``` 48 | 49 | You can check the `Reach.playground` to experimental with more examples. If need to see deeply information you can check our [Documentation](https://github.com/therapychat/Reach/docs) 50 | 51 | ## Installation 52 | 53 | ### CocoaPods 54 | 55 | Reach is available through [CocoaPods](http://cocoapods.org). To install 56 | it, simply add the following line to your Podfile: 57 | 58 | ```ruby 59 | platform :ios, '10.0' 60 | use_frameworks! 61 | swift_version = '3.0' 62 | 63 | target 'MyApp' do 64 | pod 'Reach' 65 | end 66 | ``` 67 | ### Carthage 68 | 69 | You can also install it via [Carthage](https://github.com/Carthage/Carthage). To do so, add the following to your Cartfile: 70 | 71 | ```swift 72 | github 'therapychat/Reach' 73 | ``` 74 | 75 | ### Swift Package Manager 76 | 77 | You can use [Swift Package Manager](https://swift.org/package-manager/) and specify dependency in `Package.swift` by adding this: 78 | ``` 79 | .Package(url: "https://github.com/therapychat/Reach.git", majorVersion: 0) 80 | ``` 81 | 82 | ## Author 83 | 84 | Sergio Fernández, fdz.sergio@gmail.com 85 | 86 | ## Contribution 87 | 88 | For the latest version, please check [develop](https://github.com/therapychat/Reach/tree/develop) branch. Changes from this branch will be merged into the [master](https://github.com/therapychat/Reach/tree/master) branch at some point. 89 | 90 | - If you want to contribute, submit a [pull request](https://github.com/therapychat/Reach/pulls) against a development `develop` branch. 91 | - If you found a bug, [open an issue](https://github.com/therapychat/Reach/issues). 92 | - If you have a feature request, [open an issue](https://github.com/therapychat/Reach/issues). 93 | 94 | ## License 95 | 96 | Reach is available under the `Apache License 2.0`. See the [LICENSE](./LICENSE) file for more info. 97 | 98 | 99 | ## Changelog 100 | 101 | See [CHANGELOG](./CHANGELOG) file. -------------------------------------------------------------------------------- /Reach.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Reach 3 | import PlaygroundSupport 4 | 5 | PlaygroundPage.current.needsIndefiniteExecution = true 6 | 7 | //: # Reach 8 | let reach = Reach(with: "github.com") 9 | 10 | //: Start notifiy events 11 | reach.start() 12 | 13 | //: Check network status after 1 second 14 | 15 | delay(1) { 16 | 17 | print(reach.status) 18 | } 19 | -------------------------------------------------------------------------------- /Reach.playground/Sources/Delay.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public func delay(_ duration: TimeInterval, block: @escaping () -> Void) { 4 | DispatchQueue.main.asyncAfter(deadline: .now() + duration, execute: { 5 | block() 6 | }) 7 | } 8 | -------------------------------------------------------------------------------- /Reach.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Reach.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'Reach' 3 | spec.version = '1.2.0' 4 | spec.summary = 'Reachability network library.' 5 | spec.homepage = 'https://github.com/therapychat/Reach' 6 | spec.license = { type: 'Apache License, Version 2.0', file: 'LICENSE' } 7 | spec.authors = { 'Sergio Fernandez' => 'fdzsergio@gmail.com' } 8 | spec.social_media_url = 'https://twitter.com/fdzsergio' 9 | 10 | spec.ios.deployment_target = '8.0' 11 | spec.osx.deployment_target = '10.10' 12 | spec.tvos.deployment_target = '9.0' 13 | spec.watchos.deployment_target = '2.0' 14 | 15 | spec.swift_version = '4.0' 16 | spec.source_files = 'Source/*.swift' 17 | spec.source = { :git => "https://github.com/therapychat/Reach.git", :tag => spec.version.to_s } 18 | 19 | spec.ios.framework = 'SystemConfiguration' 20 | spec.osx.framework = 'SystemConfiguration' 21 | spec.tvos.framework = 'SystemConfiguration' 22 | 23 | end 24 | -------------------------------------------------------------------------------- /Reach.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Reach.xcodeproj/xcshareddata/xcschemes/Reach.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Reach.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Reach.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/Callback.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Reachability.swift 3 | // Reach 4 | // 5 | // Created by sergio on 22/05/2017. 6 | // Copyright © 2017 nc43tech. All rights reserved. 7 | // 8 | 9 | #if !os(watchOS) 10 | 11 | import Foundation 12 | import SystemConfiguration 13 | 14 | func callback(reachability: SCNetworkReachability, flags: SCNetworkReachabilityFlags, info: UnsafeMutableRawPointer?) { 15 | 16 | guard let info = info else { return } 17 | 18 | let reach = Unmanaged.fromOpaque(info).takeUnretainedValue() 19 | 20 | DispatchQueue.main.async { 21 | reach.reachability(change: flags) 22 | } 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Source/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Source/Network.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Network.swift 3 | // Reach 4 | // 5 | // Created by sergio on 22/05/2017. 6 | // Copyright © 2017 nc43tech. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Network reachability 12 | public enum Network { 13 | /// Network is not available 14 | case notReachable 15 | /// Network is available 16 | case reachable(Via) 17 | } 18 | 19 | public extension Network { 20 | 21 | /// Network available 22 | enum Via { 23 | /// Network is available from Wifi 24 | case wifi 25 | /// Network is available from Cellular 26 | case wwan 27 | } 28 | } 29 | 30 | extension Network: Equatable { 31 | 32 | /// Equatable conformance protocol 33 | public static func == (lhs: Network, rhs: Network) -> Bool { 34 | switch (lhs, rhs) { 35 | case (.notReachable, .notReachable): 36 | return true 37 | case (.reachable(.wifi), .reachable(.wifi)): 38 | return true 39 | case (.reachable(.wwan), .reachable(.wwan)): 40 | return true 41 | default: 42 | return false 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/Reach.h: -------------------------------------------------------------------------------- 1 | // 2 | // Reach.h 3 | // Reach 4 | // 5 | // Created by sergio on 02/01/2017. 6 | // Copyright © 2017 nc43tech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Reach. 12 | FOUNDATION_EXPORT double ReachVersionNumber; 13 | 14 | //! Project version string for Reach. 15 | FOUNDATION_EXPORT const unsigned char ReachVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | -------------------------------------------------------------------------------- /Source/Reach.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Reach.swift 3 | // Reach 4 | // 5 | // Created by sergio on 22/05/2017. 6 | // Copyright © 2017 nc43tech. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | #if !os(watchOS) 12 | import SystemConfiguration 13 | #endif 14 | 15 | /// Delegate responsible to notify of changes in `Network` connection 16 | public protocol ReachDelegate: class { 17 | 18 | /// Called when network is available 19 | func networkIsReachable() 20 | 21 | /// Called when network is not available 22 | func networkIsNotReachable() 23 | 24 | /// Always notify from network changes and spicify `Network` type 25 | func networkDidChange(status: Network) 26 | } 27 | 28 | public extension ReachDelegate { 29 | func networkIsReachable() { } 30 | func networkIsNotReachable() { } 31 | func networkDidChange(status: Network) { } 32 | } 33 | 34 | /// Responsible to observe network changes 35 | public final class Reach { 36 | 37 | #if !os(watchOS) 38 | 39 | private let reachability: SCNetworkReachability? 40 | private let queue = DispatchQueue(label: "com.reach.queue", qos: .background) 41 | 42 | #endif 43 | 44 | /// Delegate object to notify events 45 | public weak var delegate: ReachDelegate? 46 | 47 | /// Current status of `Network` 48 | public var status: Network = .notReachable { 49 | didSet { 50 | if status == oldValue { return } 51 | delegate?.networkDidChange(status: status) 52 | switch status { 53 | case .notReachable: 54 | delegate?.networkIsNotReachable() 55 | case .reachable: 56 | delegate?.networkIsReachable() 57 | } 58 | } 59 | } 60 | 61 | // MARK: - Lifecycle 62 | 63 | /// Creates an instance with specific `hostname` 64 | /// 65 | /// - parameter hostname: URL for hostname 66 | /// 67 | public init(with hostname: String) { 68 | #if !os(watchOS) 69 | reachability = SCNetworkReachabilityCreateWithName(nil, hostname) 70 | #endif 71 | } 72 | 73 | /// Creates an instance without specific `hostname` 74 | public init() { 75 | #if !os(watchOS) 76 | var zeroAddress = sockaddr() 77 | zeroAddress.sa_len = UInt8(MemoryLayout.size) 78 | zeroAddress.sa_family = sa_family_t(AF_INET) 79 | 80 | reachability = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) 81 | #endif 82 | } 83 | 84 | deinit { 85 | stop() 86 | } 87 | 88 | // MARK: - Runtime 89 | 90 | /// Function to start observe `Network` changes 91 | public func start() { 92 | #if !os(watchOS) 93 | var context = SCNetworkReachabilityContext(version: 0, 94 | info: nil, 95 | retain: nil, 96 | release: nil, 97 | copyDescription: nil) 98 | 99 | context.info = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()) 100 | 101 | guard let network = reachability else { return } 102 | 103 | SCNetworkReachabilitySetCallback(network, callback, &context) 104 | SCNetworkReachabilitySetDispatchQueue(network, queue) 105 | #endif 106 | } 107 | 108 | /// Function to remove observer on `Network` changes 109 | public func stop() { 110 | #if !os(watchOS) 111 | 112 | guard let network = reachability else { return } 113 | 114 | SCNetworkReachabilitySetCallback(network, nil, nil) 115 | SCNetworkReachabilitySetDispatchQueue(network, nil) 116 | 117 | #endif 118 | } 119 | 120 | #if !os(watchOS) 121 | 122 | /// Change `Network` status 123 | func reachability(change flags: SCNetworkReachabilityFlags) { 124 | var network: Network = .notReachable 125 | 126 | if flags.contains(.reachable) { 127 | network = .reachable(.wifi) 128 | } 129 | 130 | #if os(iOS) 131 | if flags.contains(.isWWAN) { 132 | network = .reachable(.wwan) 133 | } 134 | #endif 135 | 136 | status = network 137 | } 138 | 139 | #endif 140 | } 141 | -------------------------------------------------------------------------------- /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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/ReachDelegateMock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ReachDelegateMock.swift 3 | // Reach 4 | // 5 | // Created by sergio on 22/05/2017. 6 | // Copyright © 2017 nc43tech. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Reach 11 | 12 | final class ReachDelegateMock { 13 | 14 | var isReachable: Bool? 15 | 16 | } 17 | 18 | extension ReachDelegateMock: ReachDelegate { 19 | 20 | func networkDidChange(status: Network) { 21 | switch status { 22 | case .reachable: 23 | isReachable = true 24 | case .notReachable: 25 | isReachable = false 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Tests/ReachTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ReachSpec.swift 3 | // Reach 4 | // 5 | // Created by sergio on 09/01/2017. 6 | // Copyright © 2017 nc43tech. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import XCTest 12 | import Nimble 13 | 14 | @testable import Reach 15 | 16 | final class ReachTests: XCTestCase { 17 | 18 | func testReachableHost() { 19 | 20 | let hostname = "google.com" 21 | 22 | let reach = Reach(with: hostname) 23 | reach.start() 24 | 25 | expect(reach.status).toEventually(equal(.reachable(.wifi))) 26 | } 27 | 28 | func testUnreachableHost() { 29 | 30 | let hostname = "invalid" 31 | 32 | let reach = Reach(with: hostname) 33 | reach.start() 34 | 35 | expect(reach.status).toEventually(equal(Network.notReachable)) 36 | } 37 | 38 | func testDelegateIsCalled() { 39 | 40 | let hostname = "google.com" 41 | 42 | let reach = Reach(with: hostname) 43 | let mock = ReachDelegateMock() 44 | 45 | reach.delegate = mock 46 | reach.start() 47 | 48 | expect(mock.isReachable).toEventually(beTrue()) 49 | } 50 | 51 | func testReachableWithoutHostname() { 52 | 53 | let reach = Reach() 54 | reach.start() 55 | 56 | expect(reach.status).toEventually(equal(Network.notReachable)) 57 | } 58 | 59 | 60 | } 61 | 62 | -------------------------------------------------------------------------------- /docs/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Classes

120 |

The following classes are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | Reach 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Responsible to observe network changes

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public final class Reach
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
160 | 161 |
162 |
163 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /docs/Enums.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Enumerations Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Enumerations

120 |

The following enumerations are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | Network 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Network reachability

    143 | 144 | See more 145 |
    146 |
    147 |

    Declaration

    148 |
    149 |

    Swift

    150 |
    public enum Network
    151 | 152 |
    153 |
    154 |
    155 |
    156 |
  • 157 |
158 |
159 |
160 |
161 | 162 |
163 |
164 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /docs/Enums/Network/Via.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Via Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

20 | 21 | Reach Docs 22 | 23 | (100% documented) 24 |

25 | 26 | 27 |

28 | 29 | 30 | View on GitHub 31 | 32 |

33 | 34 |

35 | 36 | 37 | Install in Dash 38 | 39 |

40 |
41 | 42 | 47 | 48 |
49 | 116 |
117 | 118 |
119 |
120 |

Via

121 |
122 |
123 |
enum Via
124 | 125 |
126 |
127 |

Network available

128 | 129 |
130 |
131 | 132 |
133 |
134 |
135 |
    136 |
  • 137 |
    138 | 139 | 140 | 141 | wifi 142 | 143 |
    144 |
    145 |
    146 |
    147 |
    148 |
    149 |

    Network is available from Wifi

    150 | 151 |
    152 |
    153 |

    Declaration

    154 |
    155 |

    Swift

    156 |
    case wifi
    157 | 158 |
    159 |
    160 |
    161 |
    162 |
  • 163 |
164 |
165 |
166 |
    167 |
  • 168 |
    169 | 170 | 171 | 172 | wwan 173 | 174 |
    175 |
    176 |
    177 |
    178 |
    179 |
    180 |

    Network is available from Cellular

    181 | 182 |
    183 |
    184 |

    Declaration

    185 |
    186 |

    Swift

    187 |
    case wwan
    188 | 189 |
    190 |
    191 |
    192 |
    193 |
  • 194 |
195 |
196 |
197 |
198 | 199 |
200 |
201 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /docs/Initializers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Initializers Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Initializers

120 |

The following initializers are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | init(with:) 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Creates an instance with specific hostname

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public init(with hostname: String)
    150 | 151 |
    152 |
    153 |
    154 |

    Parameters

    155 | 156 | 157 | 158 | 163 | 168 | 169 | 170 |
    159 | 160 | hostname 161 | 162 | 164 |
    165 |

    URL for hostname

    166 |
    167 |
    171 |
    172 |
    173 |
    174 |
  • 175 |
  • 176 |
    177 | 178 | 179 | 180 | init() 181 | 182 |
    183 |
    184 |
    185 |
    186 |
    187 |
    188 |

    Creates an instance without specific hostname

    189 | 190 |
    191 |
    192 |

    Declaration

    193 |
    194 |

    Swift

    195 |
    public init()
    196 | 197 |
    198 |
    199 |
    200 |
    201 |
  • 202 |
203 |
204 |
205 |
206 | 207 |
208 |
209 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /docs/Instance Methods.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Instance Methods Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Instance Methods

120 |

The following instance methods are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | start() 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Function to start observe Network changes

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public func start()
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
  • 157 |
    158 | 159 | 160 | 161 | stop() 162 | 163 |
    164 |
    165 |
    166 |
    167 |
    168 |
    169 |

    Function to remove observer on Network changes

    170 | 171 |
    172 |
    173 |

    Declaration

    174 |
    175 |

    Swift

    176 |
    public func stop()
    177 | 178 |
    179 |
    180 |
    181 |
    182 |
  • 183 |
  • 184 |
    185 | 186 | 187 | 188 | reachability(change:) 189 | 190 |
    191 |
    192 |
    193 |
    194 |
    195 |
    196 |

    Change Network status

    197 | 198 |
    199 |
    200 |

    Declaration

    201 |
    202 |

    Swift

    203 |
    func reachability(change flags: SCNetworkReachabilityFlags)
    204 | 205 |
    206 |
    207 |
    208 |
    209 |
  • 210 |
211 |
212 |
213 |
214 | 215 |
216 |
217 | 221 | 222 | 223 | 224 | -------------------------------------------------------------------------------- /docs/Instance Variables.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Instance Variables Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Instance Variables

120 |

The following instance variables are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | delegate 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Delegate object to notify events

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public weak var delegate: ReachDelegate?
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
  • 157 |
    158 | 159 | 160 | 161 | status 162 | 163 |
    164 |
    165 |
    166 |
    167 |
    168 |
    169 |

    Current status of Network

    170 | 171 |
    172 |
    173 |

    Declaration

    174 |
    175 |

    Swift

    176 |
    public var status: Network = .notReachable
    177 | 178 |
    179 |
    180 |
    181 |
    182 |
  • 183 |
184 |
185 |
186 |
187 | 188 |
189 |
190 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /docs/Protocols.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Protocols Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Protocols

120 |

The following protocols are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | ReachDelegate 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Delegate responsible to notify of changes in Network connection

    143 | 144 | See more 145 |
    146 |
    147 |

    Declaration

    148 |
    149 |

    Swift

    150 |
    public protocol ReachDelegate: class
    151 | 152 |
    153 |
    154 |
    155 |
    156 |
  • 157 |
158 |
159 |
160 |
161 | 162 |
163 |
164 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | documentation 17 | 18 | 19 | documentation 20 | 21 | 22 | 100% 23 | 24 | 25 | 100% 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/css/jazzy.css: -------------------------------------------------------------------------------- 1 | *, *:before, *:after { 2 | box-sizing: inherit; } 3 | 4 | body { 5 | margin: 0; 6 | background: #fff; 7 | color: #333; 8 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; 9 | letter-spacing: .2px; 10 | -webkit-font-smoothing: antialiased; 11 | box-sizing: border-box; } 12 | 13 | h1 { 14 | font-size: 2rem; 15 | font-weight: 700; 16 | margin: 1.275em 0 0.6em; } 17 | 18 | h2 { 19 | font-size: 1.75rem; 20 | font-weight: 700; 21 | margin: 1.275em 0 0.3em; } 22 | 23 | h3 { 24 | font-size: 1.5rem; 25 | font-weight: 700; 26 | margin: 1em 0 0.3em; } 27 | 28 | h4 { 29 | font-size: 1.25rem; 30 | font-weight: 700; 31 | margin: 1.275em 0 0.85em; } 32 | 33 | h5 { 34 | font-size: 1rem; 35 | font-weight: 700; 36 | margin: 1.275em 0 0.85em; } 37 | 38 | h6 { 39 | font-size: 1rem; 40 | font-weight: 700; 41 | margin: 1.275em 0 0.85em; 42 | color: #777; } 43 | 44 | p { 45 | margin: 0 0 1em; } 46 | 47 | ul, ol { 48 | padding: 0 0 0 2em; 49 | margin: 0 0 0.85em; } 50 | 51 | blockquote { 52 | margin: 0 0 0.85em; 53 | padding: 0 15px; 54 | color: #858585; 55 | border-left: 4px solid #e5e5e5; } 56 | 57 | img { 58 | max-width: 100%; } 59 | 60 | a { 61 | color: #4183c4; 62 | text-decoration: none; } 63 | a:hover, a:focus { 64 | outline: 0; 65 | text-decoration: underline; } 66 | 67 | table { 68 | background: #fff; 69 | width: 100%; 70 | border-collapse: collapse; 71 | border-spacing: 0; 72 | overflow: auto; 73 | margin: 0 0 0.85em; } 74 | 75 | tr:nth-child(2n) { 76 | background-color: #fbfbfb; } 77 | 78 | th, td { 79 | padding: 6px 13px; 80 | border: 1px solid #ddd; } 81 | 82 | pre { 83 | margin: 0 0 1.275em; 84 | padding: .85em 1em; 85 | overflow: auto; 86 | background: #f7f7f7; 87 | font-size: .85em; 88 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } 89 | 90 | code { 91 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } 92 | 93 | p > code, li > code { 94 | background: #f7f7f7; 95 | padding: .2em; } 96 | p > code:before, p > code:after, li > code:before, li > code:after { 97 | letter-spacing: -.2em; 98 | content: "\00a0"; } 99 | 100 | pre code { 101 | padding: 0; 102 | white-space: pre; } 103 | 104 | .content-wrapper { 105 | display: flex; 106 | flex-direction: column; } 107 | @media (min-width: 768px) { 108 | .content-wrapper { 109 | flex-direction: row; } } 110 | 111 | .header { 112 | display: flex; 113 | padding: 8px; 114 | font-size: 0.875em; 115 | background: #444; 116 | color: #999; } 117 | 118 | .header-col { 119 | margin: 0; 120 | padding: 0 8px; } 121 | 122 | .header-col--primary { 123 | flex: 1; } 124 | 125 | .header-link { 126 | color: #fff; } 127 | 128 | .header-icon { 129 | padding-right: 6px; 130 | vertical-align: -4px; 131 | height: 16px; } 132 | 133 | .breadcrumbs { 134 | font-size: 0.875em; 135 | padding: 8px 16px; 136 | margin: 0; 137 | background: #fbfbfb; 138 | border-bottom: 1px solid #ddd; } 139 | 140 | .carat { 141 | height: 10px; 142 | margin: 0 5px; } 143 | 144 | .navigation { 145 | order: 2; } 146 | @media (min-width: 768px) { 147 | .navigation { 148 | order: 1; 149 | width: 25%; 150 | max-width: 300px; 151 | padding-bottom: 64px; 152 | overflow: hidden; 153 | word-wrap: normal; 154 | background: #fbfbfb; 155 | border-right: 1px solid #ddd; } } 156 | 157 | .nav-groups { 158 | list-style-type: none; 159 | padding-left: 0; } 160 | 161 | .nav-group-name { 162 | border-bottom: 1px solid #ddd; 163 | padding: 8px 0 8px 16px; } 164 | 165 | .nav-group-name-link { 166 | color: #333; } 167 | 168 | .nav-group-tasks { 169 | margin: 8px 0; 170 | padding: 0 0 0 8px; } 171 | 172 | .nav-group-task { 173 | font-size: 1em; 174 | list-style-type: none; 175 | white-space: nowrap; } 176 | 177 | .nav-group-task-link { 178 | color: #808080; } 179 | 180 | .main-content { 181 | order: 1; } 182 | @media (min-width: 768px) { 183 | .main-content { 184 | order: 2; 185 | flex: 1; 186 | padding-bottom: 60px; } } 187 | 188 | .section { 189 | padding: 0 32px; 190 | border-bottom: 1px solid #ddd; } 191 | 192 | .section-content { 193 | max-width: 834px; 194 | margin: 0 auto; 195 | padding: 16px 0; } 196 | 197 | .section-name { 198 | color: #666; 199 | display: block; } 200 | 201 | .declaration .highlight { 202 | overflow-x: initial; 203 | padding: 8px 0; 204 | margin: 0; 205 | background-color: transparent; 206 | border: none; } 207 | 208 | .task-group-section { 209 | border-top: 1px solid #ddd; } 210 | 211 | .task-group { 212 | padding-top: 0px; } 213 | 214 | .task-name-container a[name]:before { 215 | content: ""; 216 | display: block; } 217 | 218 | .item-container { 219 | padding: 0; } 220 | 221 | .item { 222 | padding-top: 8px; 223 | width: 100%; 224 | list-style-type: none; } 225 | .item a[name]:before { 226 | content: ""; 227 | display: block; } 228 | .item .token { 229 | padding-left: 3px; 230 | margin-left: 0px; 231 | font-size: 1rem; } 232 | .item .declaration-note { 233 | font-size: .85em; 234 | color: #808080; 235 | font-style: italic; } 236 | 237 | .pointer-container { 238 | border-bottom: 1px solid #ddd; 239 | left: -23px; 240 | padding-bottom: 13px; 241 | position: relative; 242 | width: 110%; } 243 | 244 | .pointer { 245 | left: 21px; 246 | top: 7px; 247 | display: block; 248 | position: absolute; 249 | width: 12px; 250 | height: 12px; 251 | border-left: 1px solid #ddd; 252 | border-top: 1px solid #ddd; 253 | background: #fff; 254 | transform: rotate(45deg); } 255 | 256 | .height-container { 257 | display: none; 258 | position: relative; 259 | width: 100%; 260 | overflow: hidden; } 261 | .height-container .section { 262 | background: #fff; 263 | border: 1px solid #ddd; 264 | border-top-width: 0; 265 | padding-top: 10px; 266 | padding-bottom: 5px; 267 | padding: 8px 16px; } 268 | 269 | .aside, .language { 270 | padding: 6px 12px; 271 | margin: 12px 0; 272 | border-left: 5px solid #dddddd; 273 | overflow-y: hidden; } 274 | .aside .aside-title, .language .aside-title { 275 | font-size: 9px; 276 | letter-spacing: 2px; 277 | text-transform: uppercase; 278 | padding-bottom: 0; 279 | margin: 0; 280 | color: #aaa; 281 | -webkit-user-select: none; } 282 | .aside p:last-child, .language p:last-child { 283 | margin-bottom: 0; } 284 | 285 | .language { 286 | border-left: 5px solid #cde9f4; } 287 | .language .aside-title { 288 | color: #4183c4; } 289 | 290 | .aside-warning { 291 | border-left: 5px solid #ff6666; } 292 | .aside-warning .aside-title { 293 | color: #ff0000; } 294 | 295 | .graybox { 296 | border-collapse: collapse; 297 | width: 100%; } 298 | .graybox p { 299 | margin: 0; 300 | word-break: break-word; 301 | min-width: 50px; } 302 | .graybox td { 303 | border: 1px solid #ddd; 304 | padding: 5px 25px 5px 10px; 305 | vertical-align: middle; } 306 | .graybox tr td:first-of-type { 307 | text-align: right; 308 | padding: 7px; 309 | vertical-align: top; 310 | word-break: normal; 311 | width: 40px; } 312 | 313 | .slightly-smaller { 314 | font-size: 0.9em; } 315 | 316 | .footer { 317 | padding: 8px 16px; 318 | background: #444; 319 | color: #ddd; 320 | font-size: 0.8em; } 321 | .footer p { 322 | margin: 8px 0; } 323 | .footer a { 324 | color: #fff; } 325 | 326 | html.dash .header, html.dash .breadcrumbs, html.dash .navigation { 327 | display: none; } 328 | html.dash .height-container { 329 | display: block; } 330 | 331 | form[role=search] input { 332 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; 333 | font-size: 14px; 334 | line-height: 24px; 335 | padding: 0 10px; 336 | margin: 0; 337 | border: none; 338 | border-radius: 1em; } 339 | .loading form[role=search] input { 340 | background: white url(../img/spinner.gif) center right 4px no-repeat; } 341 | form[role=search] .tt-menu { 342 | margin: 0; 343 | min-width: 300px; 344 | background: #fbfbfb; 345 | color: #333; 346 | border: 1px solid #ddd; } 347 | form[role=search] .tt-highlight { 348 | font-weight: bold; } 349 | form[role=search] .tt-suggestion { 350 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; 351 | padding: 0 8px; } 352 | form[role=search] .tt-suggestion span { 353 | display: table-cell; 354 | white-space: nowrap; } 355 | form[role=search] .tt-suggestion .doc-parent-name { 356 | width: 100%; 357 | text-align: right; 358 | font-weight: normal; 359 | font-size: 0.9em; 360 | padding-left: 16px; } 361 | form[role=search] .tt-suggestion:hover, 362 | form[role=search] .tt-suggestion.tt-cursor { 363 | cursor: pointer; 364 | background-color: #4183c4; 365 | color: #fff; } 366 | form[role=search] .tt-suggestion:hover .doc-parent-name, 367 | form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { 368 | color: #fff; } 369 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy.reach 7 | CFBundleName 8 | Reach 9 | DocSetPlatformFamily 10 | reach 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Classes

120 |

The following classes are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | Reach 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Responsible to observe network changes

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public final class Reach
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
160 | 161 |
162 |
163 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/Enums.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Enumerations Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Enumerations

120 |

The following enumerations are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | Network 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Network reachability

    143 | 144 | See more 145 |
    146 |
    147 |

    Declaration

    148 |
    149 |

    Swift

    150 |
    public enum Network
    151 | 152 |
    153 |
    154 |
    155 |
    156 |
  • 157 |
158 |
159 |
160 |
161 | 162 |
163 |
164 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/Enums/Network/Via.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Via Enumeration Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

20 | 21 | Reach Docs 22 | 23 | (100% documented) 24 |

25 | 26 | 27 |

28 | 29 | 30 | View on GitHub 31 | 32 |

33 | 34 |

35 | 36 | 37 | Install in Dash 38 | 39 |

40 |
41 | 42 | 47 | 48 |
49 | 116 |
117 | 118 |
119 |
120 |

Via

121 |
122 |
123 |
enum Via
124 | 125 |
126 |
127 |

Network available

128 | 129 |
130 |
131 | 132 |
133 |
134 |
135 |
    136 |
  • 137 |
    138 | 139 | 140 | 141 | wifi 142 | 143 |
    144 |
    145 |
    146 |
    147 |
    148 |
    149 |

    Network is available from Wifi

    150 | 151 |
    152 |
    153 |

    Declaration

    154 |
    155 |

    Swift

    156 |
    case wifi
    157 | 158 |
    159 |
    160 |
    161 |
    162 |
  • 163 |
164 |
165 |
166 |
    167 |
  • 168 |
    169 | 170 | 171 | 172 | wwan 173 | 174 |
    175 |
    176 |
    177 |
    178 |
    179 |
    180 |

    Network is available from Cellular

    181 | 182 |
    183 |
    184 |

    Declaration

    185 |
    186 |

    Swift

    187 |
    case wwan
    188 | 189 |
    190 |
    191 |
    192 |
    193 |
  • 194 |
195 |
196 |
197 |
198 | 199 |
200 |
201 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/Initializers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Initializers Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Initializers

120 |

The following initializers are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | init(with:) 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Creates an instance with specific hostname

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public init(with hostname: String)
    150 | 151 |
    152 |
    153 |
    154 |

    Parameters

    155 | 156 | 157 | 158 | 163 | 168 | 169 | 170 |
    159 | 160 | hostname 161 | 162 | 164 |
    165 |

    URL for hostname

    166 |
    167 |
    171 |
    172 |
    173 |
    174 |
  • 175 |
  • 176 |
    177 | 178 | 179 | 180 | init() 181 | 182 |
    183 |
    184 |
    185 |
    186 |
    187 |
    188 |

    Creates an instance without specific hostname

    189 | 190 |
    191 |
    192 |

    Declaration

    193 |
    194 |

    Swift

    195 |
    public init()
    196 | 197 |
    198 |
    199 |
    200 |
    201 |
  • 202 |
203 |
204 |
205 |
206 | 207 |
208 |
209 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/Instance Methods.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Instance Methods Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Instance Methods

120 |

The following instance methods are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | start() 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Function to start observe Network changes

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public func start()
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
  • 157 |
    158 | 159 | 160 | 161 | stop() 162 | 163 |
    164 |
    165 |
    166 |
    167 |
    168 |
    169 |

    Function to remove observer on Network changes

    170 | 171 |
    172 |
    173 |

    Declaration

    174 |
    175 |

    Swift

    176 |
    public func stop()
    177 | 178 |
    179 |
    180 |
    181 |
    182 |
  • 183 |
  • 184 |
    185 | 186 | 187 | 188 | reachability(change:) 189 | 190 |
    191 |
    192 |
    193 |
    194 |
    195 |
    196 |

    Change Network status

    197 | 198 |
    199 |
    200 |

    Declaration

    201 |
    202 |

    Swift

    203 |
    func reachability(change flags: SCNetworkReachabilityFlags)
    204 | 205 |
    206 |
    207 |
    208 |
    209 |
  • 210 |
211 |
212 |
213 |
214 | 215 |
216 |
217 | 221 | 222 | 223 | 224 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/Instance Variables.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Instance Variables Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Instance Variables

120 |

The following instance variables are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | delegate 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Delegate object to notify events

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public weak var delegate: ReachDelegate?
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
  • 157 |
    158 | 159 | 160 | 161 | status 162 | 163 |
    164 |
    165 |
    166 |
    167 |
    168 |
    169 |

    Current status of Network

    170 | 171 |
    172 |
    173 |

    Declaration

    174 |
    175 |

    Swift

    176 |
    public var status: Network = .notReachable
    177 | 178 |
    179 |
    180 |
    181 |
    182 |
  • 183 |
184 |
185 |
186 |
187 | 188 |
189 |
190 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/Protocols.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Protocols Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 |

Protocols

120 |

The following protocols are available globally.

121 | 122 |
123 |
124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | ReachDelegate 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Delegate responsible to notify of changes in Network connection

    143 | 144 | See more 145 |
    146 |
    147 |

    Declaration

    148 |
    149 |

    Swift

    150 |
    public protocol ReachDelegate: class
    151 | 152 |
    153 |
    154 |
    155 |
    156 |
  • 157 |
158 |
159 |
160 |
161 | 162 |
163 |
164 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/css/jazzy.css: -------------------------------------------------------------------------------- 1 | *, *:before, *:after { 2 | box-sizing: inherit; } 3 | 4 | body { 5 | margin: 0; 6 | background: #fff; 7 | color: #333; 8 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; 9 | letter-spacing: .2px; 10 | -webkit-font-smoothing: antialiased; 11 | box-sizing: border-box; } 12 | 13 | h1 { 14 | font-size: 2rem; 15 | font-weight: 700; 16 | margin: 1.275em 0 0.6em; } 17 | 18 | h2 { 19 | font-size: 1.75rem; 20 | font-weight: 700; 21 | margin: 1.275em 0 0.3em; } 22 | 23 | h3 { 24 | font-size: 1.5rem; 25 | font-weight: 700; 26 | margin: 1em 0 0.3em; } 27 | 28 | h4 { 29 | font-size: 1.25rem; 30 | font-weight: 700; 31 | margin: 1.275em 0 0.85em; } 32 | 33 | h5 { 34 | font-size: 1rem; 35 | font-weight: 700; 36 | margin: 1.275em 0 0.85em; } 37 | 38 | h6 { 39 | font-size: 1rem; 40 | font-weight: 700; 41 | margin: 1.275em 0 0.85em; 42 | color: #777; } 43 | 44 | p { 45 | margin: 0 0 1em; } 46 | 47 | ul, ol { 48 | padding: 0 0 0 2em; 49 | margin: 0 0 0.85em; } 50 | 51 | blockquote { 52 | margin: 0 0 0.85em; 53 | padding: 0 15px; 54 | color: #858585; 55 | border-left: 4px solid #e5e5e5; } 56 | 57 | img { 58 | max-width: 100%; } 59 | 60 | a { 61 | color: #4183c4; 62 | text-decoration: none; } 63 | a:hover, a:focus { 64 | outline: 0; 65 | text-decoration: underline; } 66 | 67 | table { 68 | background: #fff; 69 | width: 100%; 70 | border-collapse: collapse; 71 | border-spacing: 0; 72 | overflow: auto; 73 | margin: 0 0 0.85em; } 74 | 75 | tr:nth-child(2n) { 76 | background-color: #fbfbfb; } 77 | 78 | th, td { 79 | padding: 6px 13px; 80 | border: 1px solid #ddd; } 81 | 82 | pre { 83 | margin: 0 0 1.275em; 84 | padding: .85em 1em; 85 | overflow: auto; 86 | background: #f7f7f7; 87 | font-size: .85em; 88 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } 89 | 90 | code { 91 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } 92 | 93 | p > code, li > code { 94 | background: #f7f7f7; 95 | padding: .2em; } 96 | p > code:before, p > code:after, li > code:before, li > code:after { 97 | letter-spacing: -.2em; 98 | content: "\00a0"; } 99 | 100 | pre code { 101 | padding: 0; 102 | white-space: pre; } 103 | 104 | .content-wrapper { 105 | display: flex; 106 | flex-direction: column; } 107 | @media (min-width: 768px) { 108 | .content-wrapper { 109 | flex-direction: row; } } 110 | 111 | .header { 112 | display: flex; 113 | padding: 8px; 114 | font-size: 0.875em; 115 | background: #444; 116 | color: #999; } 117 | 118 | .header-col { 119 | margin: 0; 120 | padding: 0 8px; } 121 | 122 | .header-col--primary { 123 | flex: 1; } 124 | 125 | .header-link { 126 | color: #fff; } 127 | 128 | .header-icon { 129 | padding-right: 6px; 130 | vertical-align: -4px; 131 | height: 16px; } 132 | 133 | .breadcrumbs { 134 | font-size: 0.875em; 135 | padding: 8px 16px; 136 | margin: 0; 137 | background: #fbfbfb; 138 | border-bottom: 1px solid #ddd; } 139 | 140 | .carat { 141 | height: 10px; 142 | margin: 0 5px; } 143 | 144 | .navigation { 145 | order: 2; } 146 | @media (min-width: 768px) { 147 | .navigation { 148 | order: 1; 149 | width: 25%; 150 | max-width: 300px; 151 | padding-bottom: 64px; 152 | overflow: hidden; 153 | word-wrap: normal; 154 | background: #fbfbfb; 155 | border-right: 1px solid #ddd; } } 156 | 157 | .nav-groups { 158 | list-style-type: none; 159 | padding-left: 0; } 160 | 161 | .nav-group-name { 162 | border-bottom: 1px solid #ddd; 163 | padding: 8px 0 8px 16px; } 164 | 165 | .nav-group-name-link { 166 | color: #333; } 167 | 168 | .nav-group-tasks { 169 | margin: 8px 0; 170 | padding: 0 0 0 8px; } 171 | 172 | .nav-group-task { 173 | font-size: 1em; 174 | list-style-type: none; 175 | white-space: nowrap; } 176 | 177 | .nav-group-task-link { 178 | color: #808080; } 179 | 180 | .main-content { 181 | order: 1; } 182 | @media (min-width: 768px) { 183 | .main-content { 184 | order: 2; 185 | flex: 1; 186 | padding-bottom: 60px; } } 187 | 188 | .section { 189 | padding: 0 32px; 190 | border-bottom: 1px solid #ddd; } 191 | 192 | .section-content { 193 | max-width: 834px; 194 | margin: 0 auto; 195 | padding: 16px 0; } 196 | 197 | .section-name { 198 | color: #666; 199 | display: block; } 200 | 201 | .declaration .highlight { 202 | overflow-x: initial; 203 | padding: 8px 0; 204 | margin: 0; 205 | background-color: transparent; 206 | border: none; } 207 | 208 | .task-group-section { 209 | border-top: 1px solid #ddd; } 210 | 211 | .task-group { 212 | padding-top: 0px; } 213 | 214 | .task-name-container a[name]:before { 215 | content: ""; 216 | display: block; } 217 | 218 | .item-container { 219 | padding: 0; } 220 | 221 | .item { 222 | padding-top: 8px; 223 | width: 100%; 224 | list-style-type: none; } 225 | .item a[name]:before { 226 | content: ""; 227 | display: block; } 228 | .item .token { 229 | padding-left: 3px; 230 | margin-left: 0px; 231 | font-size: 1rem; } 232 | .item .declaration-note { 233 | font-size: .85em; 234 | color: #808080; 235 | font-style: italic; } 236 | 237 | .pointer-container { 238 | border-bottom: 1px solid #ddd; 239 | left: -23px; 240 | padding-bottom: 13px; 241 | position: relative; 242 | width: 110%; } 243 | 244 | .pointer { 245 | left: 21px; 246 | top: 7px; 247 | display: block; 248 | position: absolute; 249 | width: 12px; 250 | height: 12px; 251 | border-left: 1px solid #ddd; 252 | border-top: 1px solid #ddd; 253 | background: #fff; 254 | transform: rotate(45deg); } 255 | 256 | .height-container { 257 | display: none; 258 | position: relative; 259 | width: 100%; 260 | overflow: hidden; } 261 | .height-container .section { 262 | background: #fff; 263 | border: 1px solid #ddd; 264 | border-top-width: 0; 265 | padding-top: 10px; 266 | padding-bottom: 5px; 267 | padding: 8px 16px; } 268 | 269 | .aside, .language { 270 | padding: 6px 12px; 271 | margin: 12px 0; 272 | border-left: 5px solid #dddddd; 273 | overflow-y: hidden; } 274 | .aside .aside-title, .language .aside-title { 275 | font-size: 9px; 276 | letter-spacing: 2px; 277 | text-transform: uppercase; 278 | padding-bottom: 0; 279 | margin: 0; 280 | color: #aaa; 281 | -webkit-user-select: none; } 282 | .aside p:last-child, .language p:last-child { 283 | margin-bottom: 0; } 284 | 285 | .language { 286 | border-left: 5px solid #cde9f4; } 287 | .language .aside-title { 288 | color: #4183c4; } 289 | 290 | .aside-warning { 291 | border-left: 5px solid #ff6666; } 292 | .aside-warning .aside-title { 293 | color: #ff0000; } 294 | 295 | .graybox { 296 | border-collapse: collapse; 297 | width: 100%; } 298 | .graybox p { 299 | margin: 0; 300 | word-break: break-word; 301 | min-width: 50px; } 302 | .graybox td { 303 | border: 1px solid #ddd; 304 | padding: 5px 25px 5px 10px; 305 | vertical-align: middle; } 306 | .graybox tr td:first-of-type { 307 | text-align: right; 308 | padding: 7px; 309 | vertical-align: top; 310 | word-break: normal; 311 | width: 40px; } 312 | 313 | .slightly-smaller { 314 | font-size: 0.9em; } 315 | 316 | .footer { 317 | padding: 8px 16px; 318 | background: #444; 319 | color: #ddd; 320 | font-size: 0.8em; } 321 | .footer p { 322 | margin: 8px 0; } 323 | .footer a { 324 | color: #fff; } 325 | 326 | html.dash .header, html.dash .breadcrumbs, html.dash .navigation { 327 | display: none; } 328 | html.dash .height-container { 329 | display: block; } 330 | 331 | form[role=search] input { 332 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; 333 | font-size: 14px; 334 | line-height: 24px; 335 | padding: 0 10px; 336 | margin: 0; 337 | border: none; 338 | border-radius: 1em; } 339 | .loading form[role=search] input { 340 | background: white url(../img/spinner.gif) center right 4px no-repeat; } 341 | form[role=search] .tt-menu { 342 | margin: 0; 343 | min-width: 300px; 344 | background: #fbfbfb; 345 | color: #333; 346 | border: 1px solid #ddd; } 347 | form[role=search] .tt-highlight { 348 | font-weight: bold; } 349 | form[role=search] .tt-suggestion { 350 | font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; 351 | padding: 0 8px; } 352 | form[role=search] .tt-suggestion span { 353 | display: table-cell; 354 | white-space: nowrap; } 355 | form[role=search] .tt-suggestion .doc-parent-name { 356 | width: 100%; 357 | text-align: right; 358 | font-weight: normal; 359 | font-size: 0.9em; 360 | padding-left: 16px; } 361 | form[role=search] .tt-suggestion:hover, 362 | form[role=search] .tt-suggestion.tt-cursor { 363 | cursor: pointer; 364 | background-color: #4183c4; 365 | color: #fff; } 366 | form[role=search] .tt-suggestion:hover .doc-parent-name, 367 | form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { 368 | color: #fff; } 369 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/docsets/Reach.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/docsets/Reach.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/docsets/Reach.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/docsets/Reach.docset/Contents/Resources/Documents/img/spinner.gif -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | $content = link.parent().parent().next(); 27 | $content.slideToggle(animationDuration); 28 | 29 | // Keeps the document from jumping to the hash. 30 | var href = $(this).attr('href'); 31 | if (history.pushState) { 32 | history.pushState({}, '', href); 33 | } else { 34 | location.hash = href; 35 | } 36 | event.preventDefault(); 37 | }); 38 | 39 | // Dumb down quotes within code blocks that delimit strings instead of quotations 40 | // https://github.com/realm/jazzy/issues/714 41 | $("code q").replaceWith(function () { 42 | return ["\"", $(this).contents(), "\""]; 43 | }); 44 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/Documents/js/jazzy.search.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var searchIndex = lunr(function() { 3 | this.ref('url'); 4 | this.field('name'); 5 | }); 6 | 7 | var $typeahead = $('[data-typeahead]'); 8 | var $form = $typeahead.parents('form'); 9 | var searchURL = $form.attr('action'); 10 | 11 | function displayTemplate(result) { 12 | return result.name; 13 | } 14 | 15 | function suggestionTemplate(result) { 16 | var t = '
'; 17 | t += '' + result.name + ''; 18 | if (result.parent_name) { 19 | t += '' + result.parent_name + ''; 20 | } 21 | t += '
'; 22 | return t; 23 | } 24 | 25 | $typeahead.one('focus', function() { 26 | $form.addClass('loading'); 27 | 28 | $.getJSON(searchURL).then(function(searchData) { 29 | $.each(searchData, function (url, doc) { 30 | searchIndex.add({url: url, name: doc.name}); 31 | }); 32 | 33 | $typeahead.typeahead( 34 | { 35 | highlight: true, 36 | minLength: 3 37 | }, 38 | { 39 | limit: 10, 40 | display: displayTemplate, 41 | templates: { suggestion: suggestionTemplate }, 42 | source: function(query, sync) { 43 | var results = searchIndex.search(query).map(function(result) { 44 | var doc = searchData[result.ref]; 45 | doc.url = result.ref; 46 | return doc; 47 | }); 48 | sync(results); 49 | } 50 | } 51 | ); 52 | $form.removeClass('loading'); 53 | $typeahead.trigger('focus'); 54 | }); 55 | }); 56 | 57 | var baseURL = searchURL.slice(0, -"search.json".length); 58 | 59 | $typeahead.on('typeahead:select', function(e, result) { 60 | window.location = baseURL + result.url; 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /docs/docsets/Reach.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/docsets/Reach.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /docs/docsets/Reach.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/docsets/Reach.tgz -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/img/dash.png -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/img/gh.png -------------------------------------------------------------------------------- /docs/img/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TherapyChat/Reach/7fbdbd558a846e29d85d2f26fae6a034bd864465/docs/img/spinner.gif -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Reach Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Reach Docs 21 | 22 | (100% documented) 23 |

24 | 25 | 26 |

27 | 28 | 29 | View on GitHub 30 | 31 |

32 | 33 |

34 | 35 | 36 | Install in Dash 37 | 38 |

39 |
40 | 41 | 46 | 47 |
48 | 115 |
116 | 117 |
118 |
119 | 120 |

121 |

Table of Contents

122 | 123 | 133 |

Overview

134 | 135 |

Reach is a lightweight reachability framework. 136 | We designed Reach to be simple to use and also very flexible. Written on Swift 3.1 and compatible with:

137 | 138 |
    139 |
  • iOS 8.0
  • 140 |
  • macOS 10.10
  • 141 |
  • tvOS 9.0
  • 142 |
  • watchOS 2.0
  • 143 |
144 |

Features

145 | 146 |
    147 |
  • Super friendly API
  • 148 |
  • Singleton free
  • 149 |
  • No external dependencies
  • 150 |
  • Minimal implementation
  • 151 |
  • Support for iOS/macOS/tvOS/watchOS/Linux
  • 152 |
  • Support for CocoaPods/Carthage/Swift Package Manager
  • 153 |
154 |

Getting Started

155 | 156 |

Reach contains a status property to check the reachability from network. If you want to receive notifications from network changes, you can subscribe to ReachDelegate protocol.

157 |
let reach = Reach()
158 | 
159 | reach.start()
160 | 
161 | print(reach.status)
162 | 
163 | 164 |

You can check the Reach.playground to experimental with more examples. If need to see deeply information you can check our Documentation

165 |

Installation

166 |

CocoaPods

167 | 168 |

Reach is available through CocoaPods. To install 169 | it, simply add the following line to your Podfile:

170 |
platform :ios, '10.0'
171 | use_frameworks!
172 | swift_version = '3.0'
173 | 
174 | target 'MyApp' do
175 |   pod 'Reach'
176 | end
177 | 
178 |

Carthage

179 | 180 |

You can also install it via Carthage. To do so, add the following to your Cartfile:

181 |
github 'therapychat/Reach'
182 | 
183 |

Swift Package Manager

184 | 185 |

You can use Swift Package Manager and specify dependency in Package.swift by adding this:

186 |
.Package(url: "https://github.com/therapychat/Reach.git", majorVersion: 0)
187 | 
188 |

Author

189 | 190 |

Sergio Fernández, fdz.sergio@gmail.com

191 |

Contribution

192 | 193 |

For the latest version, please check develop branch. Changes from this branch will be merged into the master branch at some point.

194 | 195 |
    196 |
  • If you want to contribute, submit a pull request against a development develop branch.
  • 197 |
  • If you found a bug, open an issue.
  • 198 |
  • If you have a feature request, open an issue.
  • 199 |
200 |

License

201 | 202 |

Reach is available under the Apache License 2.0. See the LICENSE file for more info.

203 |

Changelog

204 | 205 |

See CHANGELOG file.

206 | 207 |
208 |
209 | 210 | 211 |
212 |
213 | 217 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | $content = link.parent().parent().next(); 27 | $content.slideToggle(animationDuration); 28 | 29 | // Keeps the document from jumping to the hash. 30 | var href = $(this).attr('href'); 31 | if (history.pushState) { 32 | history.pushState({}, '', href); 33 | } else { 34 | location.hash = href; 35 | } 36 | event.preventDefault(); 37 | }); 38 | 39 | // Dumb down quotes within code blocks that delimit strings instead of quotations 40 | // https://github.com/realm/jazzy/issues/714 41 | $("code q").replaceWith(function () { 42 | return ["\"", $(this).contents(), "\""]; 43 | }); 44 | -------------------------------------------------------------------------------- /docs/js/jazzy.search.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var searchIndex = lunr(function() { 3 | this.ref('url'); 4 | this.field('name'); 5 | }); 6 | 7 | var $typeahead = $('[data-typeahead]'); 8 | var $form = $typeahead.parents('form'); 9 | var searchURL = $form.attr('action'); 10 | 11 | function displayTemplate(result) { 12 | return result.name; 13 | } 14 | 15 | function suggestionTemplate(result) { 16 | var t = '
'; 17 | t += '' + result.name + ''; 18 | if (result.parent_name) { 19 | t += '' + result.parent_name + ''; 20 | } 21 | t += '
'; 22 | return t; 23 | } 24 | 25 | $typeahead.one('focus', function() { 26 | $form.addClass('loading'); 27 | 28 | $.getJSON(searchURL).then(function(searchData) { 29 | $.each(searchData, function (url, doc) { 30 | searchIndex.add({url: url, name: doc.name}); 31 | }); 32 | 33 | $typeahead.typeahead( 34 | { 35 | highlight: true, 36 | minLength: 3 37 | }, 38 | { 39 | limit: 10, 40 | display: displayTemplate, 41 | templates: { suggestion: suggestionTemplate }, 42 | source: function(query, sync) { 43 | var results = searchIndex.search(query).map(function(result) { 44 | var doc = searchData[result.ref]; 45 | doc.url = result.ref; 46 | return doc; 47 | }); 48 | sync(results); 49 | } 50 | } 51 | ); 52 | $form.removeClass('loading'); 53 | $typeahead.trigger('focus'); 54 | }); 55 | }); 56 | 57 | var baseURL = searchURL.slice(0, -"search.json".length); 58 | 59 | $typeahead.on('typeahead:select', function(e, result) { 60 | window.location = baseURL + result.url; 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /docs/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Users/Aurelio/Developer/versus/frameworks/reach" 6 | } -------------------------------------------------------------------------------- /resources/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if ! command -v carthage > /dev/null; then 4 | printf 'Carthage is not installed.\n' 5 | printf 'See https://github.com/Carthage/Carthage for install instructions.\n' 6 | exit 1 7 | fi 8 | 9 | carthage update --platform iOS -------------------------------------------------------------------------------- /scripts/tests: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | xcodebuild -workspace Reach.xcworkspace -scheme Reach -configuration Test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X' -enableCodeCoverage YES build-for-testing test-without-building | xcpretty 4 | # slather coverage 5 | --------------------------------------------------------------------------------