├── .gitignore ├── Cartfile ├── Cartfile.resolved ├── LICENSE ├── README.md ├── RxCoreNFC.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcshareddata │ └── xcschemes │ │ └── RxCoreNFC.xcscheme └── xcuserdata │ └── maxim.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── RxCoreNFC ├── Info.plist ├── NFCNDEFReaderSession+Rx.swift └── RxCoreNFC.h └── RxCoreNFCTests ├── Info.plist └── RxCoreNFCTests.swift /.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 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | Carthage 69 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "ReactiveX/RxSwift" ~> 3.6.1 2 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "ReactiveX/RxSwift" "3.6.1" 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) RxSwiftCommunity 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RxCoreNFC 2 | RxCoreNFC (based on RxSwift) 3 | 4 | Basic usage. 5 | 6 | ```swift 7 | let session = NFCNDEFReaderSession.rx.session() // .session(invalidateAfterFirstRead: false) 8 | session 9 | .flatMapLatest { (session) -> Observable<[NFCNDEFMessage]> in 10 | return session.message 11 | } 12 | .subscribe { (event) in 13 | switch event { 14 | case .next(let messages): 15 | // handle '[NFCNDEFMessage]' 16 | break 17 | case .error(let error): 18 | // handle error 19 | break 20 | case .completed: 21 | // only happens when 'invalidateAfterFirstRead = true' (default), or after user cancellation 22 | break 23 | } 24 | } 25 | .disposed(by: disposeBag) 26 | ``` 27 | 28 | Carthage setup. 29 | 30 | ``` 31 | github "RxSwiftCommunity/RxCoreNFC" ~> 0.0.4 32 | 33 | ``` 34 | 35 | // TODO: NFCISO15693ReaderSession 36 | 37 | Copyright (c) RxSwiftCommunity 38 | -------------------------------------------------------------------------------- /RxCoreNFC.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 94BCD8CF1F9FD7430019D21F /* RxCoreNFC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94BCD8C51F9FD7420019D21F /* RxCoreNFC.framework */; }; 11 | 94BCD8D41F9FD7430019D21F /* RxCoreNFCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94BCD8D31F9FD7430019D21F /* RxCoreNFCTests.swift */; }; 12 | 94BCD8D61F9FD7430019D21F /* RxCoreNFC.h in Headers */ = {isa = PBXBuildFile; fileRef = 94BCD8C81F9FD7420019D21F /* RxCoreNFC.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 94BCD8EA1F9FDD740019D21F /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94BCD8E41F9FDB7F0019D21F /* RxSwift.framework */; }; 14 | 94BCD8EC1F9FDFA30019D21F /* NFCNDEFReaderSession+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94BCD8EB1F9FDFA30019D21F /* NFCNDEFReaderSession+Rx.swift */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | 94BCD8D01F9FD7430019D21F /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = 94BCD8BC1F9FD7420019D21F /* Project object */; 21 | proxyType = 1; 22 | remoteGlobalIDString = 94BCD8C41F9FD7420019D21F; 23 | remoteInfo = RxCoreNFC; 24 | }; 25 | /* End PBXContainerItemProxy section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 94BCD8C51F9FD7420019D21F /* RxCoreNFC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxCoreNFC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 94BCD8C81F9FD7420019D21F /* RxCoreNFC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RxCoreNFC.h; sourceTree = ""; }; 30 | 94BCD8C91F9FD7420019D21F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 94BCD8CE1F9FD7430019D21F /* RxCoreNFCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RxCoreNFCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 94BCD8D31F9FD7430019D21F /* RxCoreNFCTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RxCoreNFCTests.swift; sourceTree = ""; }; 33 | 94BCD8D51F9FD7430019D21F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 94BCD8DF1F9FDACC0019D21F /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 35 | 94BCD8E01F9FDAEC0019D21F /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 36 | 94BCD8E11F9FDAFB0019D21F /* Cartfile.resolved */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile.resolved; sourceTree = ""; }; 37 | 94BCD8E21F9FDAFC0019D21F /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; 38 | 94BCD8E41F9FDB7F0019D21F /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = ../../Carthage/Build/iOS/RxSwift.framework; sourceTree = ""; }; 39 | 94BCD8EB1F9FDFA30019D21F /* NFCNDEFReaderSession+Rx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NFCNDEFReaderSession+Rx.swift"; sourceTree = ""; }; 40 | 94BCD8EF1F9FE19A0019D21F /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = ../../Carthage/Build/iOS/RxCocoa.framework; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 94BCD8C11F9FD7420019D21F /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 94BCD8EA1F9FDD740019D21F /* RxSwift.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | 94BCD8CB1F9FD7430019D21F /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | 94BCD8CF1F9FD7430019D21F /* RxCoreNFC.framework in Frameworks */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | 94BCD8BB1F9FD7420019D21F = { 64 | isa = PBXGroup; 65 | children = ( 66 | 94BCD8E21F9FDAFC0019D21F /* Cartfile */, 67 | 94BCD8E11F9FDAFB0019D21F /* Cartfile.resolved */, 68 | 94BCD8E01F9FDAEC0019D21F /* LICENSE */, 69 | 94BCD8DF1F9FDACC0019D21F /* README.md */, 70 | 94BCD8C71F9FD7420019D21F /* RxCoreNFC */, 71 | 94BCD8D21F9FD7430019D21F /* RxCoreNFCTests */, 72 | 94BCD8C61F9FD7420019D21F /* Products */, 73 | 94BCD8E31F9FDB7F0019D21F /* Frameworks */, 74 | ); 75 | sourceTree = ""; 76 | }; 77 | 94BCD8C61F9FD7420019D21F /* Products */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 94BCD8C51F9FD7420019D21F /* RxCoreNFC.framework */, 81 | 94BCD8CE1F9FD7430019D21F /* RxCoreNFCTests.xctest */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 94BCD8C71F9FD7420019D21F /* RxCoreNFC */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 94BCD8EB1F9FDFA30019D21F /* NFCNDEFReaderSession+Rx.swift */, 90 | 94BCD8C81F9FD7420019D21F /* RxCoreNFC.h */, 91 | 94BCD8C91F9FD7420019D21F /* Info.plist */, 92 | ); 93 | path = RxCoreNFC; 94 | sourceTree = ""; 95 | }; 96 | 94BCD8D21F9FD7430019D21F /* RxCoreNFCTests */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 94BCD8D31F9FD7430019D21F /* RxCoreNFCTests.swift */, 100 | 94BCD8D51F9FD7430019D21F /* Info.plist */, 101 | ); 102 | path = RxCoreNFCTests; 103 | sourceTree = ""; 104 | }; 105 | 94BCD8E31F9FDB7F0019D21F /* Frameworks */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 94BCD8EF1F9FE19A0019D21F /* RxCocoa.framework */, 109 | 94BCD8E41F9FDB7F0019D21F /* RxSwift.framework */, 110 | ); 111 | name = Frameworks; 112 | sourceTree = ""; 113 | }; 114 | /* End PBXGroup section */ 115 | 116 | /* Begin PBXHeadersBuildPhase section */ 117 | 94BCD8C21F9FD7420019D21F /* Headers */ = { 118 | isa = PBXHeadersBuildPhase; 119 | buildActionMask = 2147483647; 120 | files = ( 121 | 94BCD8D61F9FD7430019D21F /* RxCoreNFC.h in Headers */, 122 | ); 123 | runOnlyForDeploymentPostprocessing = 0; 124 | }; 125 | /* End PBXHeadersBuildPhase section */ 126 | 127 | /* Begin PBXNativeTarget section */ 128 | 94BCD8C41F9FD7420019D21F /* RxCoreNFC */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 94BCD8D91F9FD7430019D21F /* Build configuration list for PBXNativeTarget "RxCoreNFC" */; 131 | buildPhases = ( 132 | 94BCD8C01F9FD7420019D21F /* Sources */, 133 | 94BCD8C11F9FD7420019D21F /* Frameworks */, 134 | 94BCD8C21F9FD7420019D21F /* Headers */, 135 | 94BCD8C31F9FD7420019D21F /* Resources */, 136 | 94BCD8E61F9FDB940019D21F /* Carthage */, 137 | 94BCD8E71F9FDB970019D21F /* Delete Nested Framework(s) */, 138 | ); 139 | buildRules = ( 140 | ); 141 | dependencies = ( 142 | ); 143 | name = RxCoreNFC; 144 | productName = RxCoreNFC; 145 | productReference = 94BCD8C51F9FD7420019D21F /* RxCoreNFC.framework */; 146 | productType = "com.apple.product-type.framework"; 147 | }; 148 | 94BCD8CD1F9FD7430019D21F /* RxCoreNFCTests */ = { 149 | isa = PBXNativeTarget; 150 | buildConfigurationList = 94BCD8DC1F9FD7430019D21F /* Build configuration list for PBXNativeTarget "RxCoreNFCTests" */; 151 | buildPhases = ( 152 | 94BCD8CA1F9FD7430019D21F /* Sources */, 153 | 94BCD8CB1F9FD7430019D21F /* Frameworks */, 154 | 94BCD8CC1F9FD7430019D21F /* Resources */, 155 | ); 156 | buildRules = ( 157 | ); 158 | dependencies = ( 159 | 94BCD8D11F9FD7430019D21F /* PBXTargetDependency */, 160 | ); 161 | name = RxCoreNFCTests; 162 | productName = RxCoreNFCTests; 163 | productReference = 94BCD8CE1F9FD7430019D21F /* RxCoreNFCTests.xctest */; 164 | productType = "com.apple.product-type.bundle.unit-test"; 165 | }; 166 | /* End PBXNativeTarget section */ 167 | 168 | /* Begin PBXProject section */ 169 | 94BCD8BC1F9FD7420019D21F /* Project object */ = { 170 | isa = PBXProject; 171 | attributes = { 172 | LastSwiftUpdateCheck = 0900; 173 | LastUpgradeCheck = 0900; 174 | ORGANIZATIONNAME = "Maxim Volgin"; 175 | TargetAttributes = { 176 | 94BCD8C41F9FD7420019D21F = { 177 | CreatedOnToolsVersion = 9.0.1; 178 | LastSwiftMigration = 0900; 179 | ProvisioningStyle = Automatic; 180 | }; 181 | 94BCD8CD1F9FD7430019D21F = { 182 | CreatedOnToolsVersion = 9.0.1; 183 | ProvisioningStyle = Automatic; 184 | }; 185 | }; 186 | }; 187 | buildConfigurationList = 94BCD8BF1F9FD7420019D21F /* Build configuration list for PBXProject "RxCoreNFC" */; 188 | compatibilityVersion = "Xcode 8.0"; 189 | developmentRegion = en; 190 | hasScannedForEncodings = 0; 191 | knownRegions = ( 192 | en, 193 | ); 194 | mainGroup = 94BCD8BB1F9FD7420019D21F; 195 | productRefGroup = 94BCD8C61F9FD7420019D21F /* Products */; 196 | projectDirPath = ""; 197 | projectRoot = ""; 198 | targets = ( 199 | 94BCD8C41F9FD7420019D21F /* RxCoreNFC */, 200 | 94BCD8CD1F9FD7430019D21F /* RxCoreNFCTests */, 201 | ); 202 | }; 203 | /* End PBXProject section */ 204 | 205 | /* Begin PBXResourcesBuildPhase section */ 206 | 94BCD8C31F9FD7420019D21F /* Resources */ = { 207 | isa = PBXResourcesBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | 94BCD8CC1F9FD7430019D21F /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXShellScriptBuildPhase section */ 223 | 94BCD8E61F9FDB940019D21F /* Carthage */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputPaths = ( 229 | "$(SRCROOT)/Carthage/Build/iOS/RxSwift.framework", 230 | ); 231 | name = Carthage; 232 | outputPaths = ( 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | shellPath = /bin/sh; 236 | shellScript = "/usr/local/bin/carthage copy-frameworks"; 237 | }; 238 | 94BCD8E71F9FDB970019D21F /* Delete Nested Framework(s) */ = { 239 | isa = PBXShellScriptBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | ); 243 | inputPaths = ( 244 | ); 245 | name = "Delete Nested Framework(s)"; 246 | outputPaths = ( 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | shellPath = /bin/sh; 250 | shellScript = "cd \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\"\nif [[ -d \"Frameworks\" ]]; then\nrm -fr Frameworks\nfi"; 251 | }; 252 | /* End PBXShellScriptBuildPhase section */ 253 | 254 | /* Begin PBXSourcesBuildPhase section */ 255 | 94BCD8C01F9FD7420019D21F /* Sources */ = { 256 | isa = PBXSourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | 94BCD8EC1F9FDFA30019D21F /* NFCNDEFReaderSession+Rx.swift in Sources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | 94BCD8CA1F9FD7430019D21F /* Sources */ = { 264 | isa = PBXSourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | 94BCD8D41F9FD7430019D21F /* RxCoreNFCTests.swift in Sources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | /* End PBXSourcesBuildPhase section */ 272 | 273 | /* Begin PBXTargetDependency section */ 274 | 94BCD8D11F9FD7430019D21F /* PBXTargetDependency */ = { 275 | isa = PBXTargetDependency; 276 | target = 94BCD8C41F9FD7420019D21F /* RxCoreNFC */; 277 | targetProxy = 94BCD8D01F9FD7430019D21F /* PBXContainerItemProxy */; 278 | }; 279 | /* End PBXTargetDependency section */ 280 | 281 | /* Begin XCBuildConfiguration section */ 282 | 94BCD8D71F9FD7430019D21F /* Debug */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ALWAYS_SEARCH_USER_PATHS = NO; 286 | CLANG_ANALYZER_NONNULL = YES; 287 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 288 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 289 | CLANG_CXX_LIBRARY = "libc++"; 290 | CLANG_ENABLE_MODULES = YES; 291 | CLANG_ENABLE_OBJC_ARC = YES; 292 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 293 | CLANG_WARN_BOOL_CONVERSION = YES; 294 | CLANG_WARN_COMMA = YES; 295 | CLANG_WARN_CONSTANT_CONVERSION = YES; 296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 297 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 298 | CLANG_WARN_EMPTY_BODY = YES; 299 | CLANG_WARN_ENUM_CONVERSION = YES; 300 | CLANG_WARN_INFINITE_RECURSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 303 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 304 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 305 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 306 | CLANG_WARN_STRICT_PROTOTYPES = YES; 307 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 308 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 309 | CLANG_WARN_UNREACHABLE_CODE = YES; 310 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 311 | CODE_SIGN_IDENTITY = "iPhone Developer"; 312 | COPY_PHASE_STRIP = NO; 313 | CURRENT_PROJECT_VERSION = 1; 314 | DEBUG_INFORMATION_FORMAT = dwarf; 315 | ENABLE_STRICT_OBJC_MSGSEND = YES; 316 | ENABLE_TESTABILITY = YES; 317 | GCC_C_LANGUAGE_STANDARD = gnu11; 318 | GCC_DYNAMIC_NO_PIC = NO; 319 | GCC_NO_COMMON_BLOCKS = YES; 320 | GCC_OPTIMIZATION_LEVEL = 0; 321 | GCC_PREPROCESSOR_DEFINITIONS = ( 322 | "DEBUG=1", 323 | "$(inherited)", 324 | ); 325 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 326 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 327 | GCC_WARN_UNDECLARED_SELECTOR = YES; 328 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 329 | GCC_WARN_UNUSED_FUNCTION = YES; 330 | GCC_WARN_UNUSED_VARIABLE = YES; 331 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 332 | MTL_ENABLE_DEBUG_INFO = YES; 333 | ONLY_ACTIVE_ARCH = YES; 334 | SDKROOT = iphoneos; 335 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 336 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 337 | VERSIONING_SYSTEM = "apple-generic"; 338 | VERSION_INFO_PREFIX = ""; 339 | }; 340 | name = Debug; 341 | }; 342 | 94BCD8D81F9FD7430019D21F /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_ANALYZER_NONNULL = YES; 347 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 348 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 349 | CLANG_CXX_LIBRARY = "libc++"; 350 | CLANG_ENABLE_MODULES = YES; 351 | CLANG_ENABLE_OBJC_ARC = YES; 352 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_COMMA = YES; 355 | CLANG_WARN_CONSTANT_CONVERSION = YES; 356 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 357 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 358 | CLANG_WARN_EMPTY_BODY = YES; 359 | CLANG_WARN_ENUM_CONVERSION = YES; 360 | CLANG_WARN_INFINITE_RECURSION = YES; 361 | CLANG_WARN_INT_CONVERSION = YES; 362 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 363 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 364 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 365 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 366 | CLANG_WARN_STRICT_PROTOTYPES = YES; 367 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 368 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 369 | CLANG_WARN_UNREACHABLE_CODE = YES; 370 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 371 | CODE_SIGN_IDENTITY = "iPhone Developer"; 372 | COPY_PHASE_STRIP = NO; 373 | CURRENT_PROJECT_VERSION = 1; 374 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 375 | ENABLE_NS_ASSERTIONS = NO; 376 | ENABLE_STRICT_OBJC_MSGSEND = YES; 377 | GCC_C_LANGUAGE_STANDARD = gnu11; 378 | GCC_NO_COMMON_BLOCKS = YES; 379 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 380 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 381 | GCC_WARN_UNDECLARED_SELECTOR = YES; 382 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 383 | GCC_WARN_UNUSED_FUNCTION = YES; 384 | GCC_WARN_UNUSED_VARIABLE = YES; 385 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 386 | MTL_ENABLE_DEBUG_INFO = NO; 387 | SDKROOT = iphoneos; 388 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 389 | VALIDATE_PRODUCT = YES; 390 | VERSIONING_SYSTEM = "apple-generic"; 391 | VERSION_INFO_PREFIX = ""; 392 | }; 393 | name = Release; 394 | }; 395 | 94BCD8DA1F9FD7430019D21F /* Debug */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | CLANG_ENABLE_MODULES = YES; 399 | CODE_SIGN_IDENTITY = ""; 400 | CODE_SIGN_STYLE = Automatic; 401 | DEFINES_MODULE = YES; 402 | DYLIB_COMPATIBILITY_VERSION = 1; 403 | DYLIB_CURRENT_VERSION = 1; 404 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 405 | FRAMEWORK_SEARCH_PATHS = ( 406 | "$(inherited)", 407 | "$(PROJECT_DIR)/Carthage/Build/iOS", 408 | ); 409 | INFOPLIST_FILE = RxCoreNFC/Info.plist; 410 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 411 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 413 | PRODUCT_BUNDLE_IDENTIFIER = maxvol.RxCoreNFC; 414 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 415 | SKIP_INSTALL = YES; 416 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 417 | SWIFT_VERSION = 4.0; 418 | TARGETED_DEVICE_FAMILY = "1,2"; 419 | }; 420 | name = Debug; 421 | }; 422 | 94BCD8DB1F9FD7430019D21F /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | CLANG_ENABLE_CODE_COVERAGE = NO; 426 | CLANG_ENABLE_MODULES = YES; 427 | CODE_SIGN_IDENTITY = ""; 428 | CODE_SIGN_STYLE = Automatic; 429 | DEFINES_MODULE = YES; 430 | DYLIB_COMPATIBILITY_VERSION = 1; 431 | DYLIB_CURRENT_VERSION = 1; 432 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 433 | FRAMEWORK_SEARCH_PATHS = ( 434 | "$(inherited)", 435 | "$(PROJECT_DIR)/Carthage/Build/iOS", 436 | ); 437 | INFOPLIST_FILE = RxCoreNFC/Info.plist; 438 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 439 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 440 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 441 | PRODUCT_BUNDLE_IDENTIFIER = maxvol.RxCoreNFC; 442 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 443 | SKIP_INSTALL = YES; 444 | SWIFT_VERSION = 4.0; 445 | TARGETED_DEVICE_FAMILY = "1,2"; 446 | }; 447 | name = Release; 448 | }; 449 | 94BCD8DD1F9FD7430019D21F /* Debug */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 453 | CODE_SIGN_STYLE = Automatic; 454 | INFOPLIST_FILE = RxCoreNFCTests/Info.plist; 455 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 456 | PRODUCT_BUNDLE_IDENTIFIER = maxvol.RxCoreNFCTests; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | SWIFT_VERSION = 4.0; 459 | TARGETED_DEVICE_FAMILY = "1,2"; 460 | }; 461 | name = Debug; 462 | }; 463 | 94BCD8DE1F9FD7430019D21F /* Release */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 467 | CODE_SIGN_STYLE = Automatic; 468 | INFOPLIST_FILE = RxCoreNFCTests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = maxvol.RxCoreNFCTests; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | SWIFT_VERSION = 4.0; 473 | TARGETED_DEVICE_FAMILY = "1,2"; 474 | }; 475 | name = Release; 476 | }; 477 | /* End XCBuildConfiguration section */ 478 | 479 | /* Begin XCConfigurationList section */ 480 | 94BCD8BF1F9FD7420019D21F /* Build configuration list for PBXProject "RxCoreNFC" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 94BCD8D71F9FD7430019D21F /* Debug */, 484 | 94BCD8D81F9FD7430019D21F /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | 94BCD8D91F9FD7430019D21F /* Build configuration list for PBXNativeTarget "RxCoreNFC" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 94BCD8DA1F9FD7430019D21F /* Debug */, 493 | 94BCD8DB1F9FD7430019D21F /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | 94BCD8DC1F9FD7430019D21F /* Build configuration list for PBXNativeTarget "RxCoreNFCTests" */ = { 499 | isa = XCConfigurationList; 500 | buildConfigurations = ( 501 | 94BCD8DD1F9FD7430019D21F /* Debug */, 502 | 94BCD8DE1F9FD7430019D21F /* Release */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | /* End XCConfigurationList section */ 508 | }; 509 | rootObject = 94BCD8BC1F9FD7420019D21F /* Project object */; 510 | } 511 | -------------------------------------------------------------------------------- /RxCoreNFC.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RxCoreNFC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RxCoreNFC.xcodeproj/xcshareddata/xcschemes/RxCoreNFC.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 | 66 | 67 | 73 | 74 | 75 | 76 | 77 | 78 | 84 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /RxCoreNFC.xcodeproj/xcuserdata/maxim.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RxCoreNFC.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /RxCoreNFC/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | 0.0.4 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /RxCoreNFC/NFCNDEFReaderSession+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NFCNDEFReaderSession+Rx.swift 3 | // RxCoreNFC 4 | // 5 | // Created by Maxim Volgin on 24/10/2017. 6 | // Copyright (c) RxSwiftCommunity. All rights reserved. 7 | // 8 | 9 | import CoreNFC 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | import RxCocoa 13 | #endif 14 | 15 | final class RxNFCNDEFReaderSessionDelegate: NSObject, NFCNDEFReaderSessionDelegate { 16 | 17 | typealias Observer = AnyObserver<[NFCNDEFMessage]> 18 | 19 | var observer: Observer? 20 | 21 | public func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: Error) { 22 | if let nfcReaderError = error as? NFCReaderError { 23 | switch nfcReaderError.code { 24 | case NFCReaderError.readerSessionInvalidationErrorUserCanceled: 25 | fallthrough 26 | case NFCReaderError.readerSessionInvalidationErrorFirstNDEFTagRead: 27 | observer?.on(.completed) 28 | return 29 | default: 30 | break 31 | } 32 | } 33 | observer?.on(.error(error)) 34 | } 35 | 36 | public func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) { 37 | observer?.on(.next(messages)) 38 | } 39 | 40 | } 41 | 42 | public struct RxNFCNDEFReaderSession { 43 | 44 | private let delegate: RxNFCNDEFReaderSessionDelegate 45 | private let session: NFCNDEFReaderSession 46 | 47 | public let message: Observable<[NFCNDEFMessage]> 48 | 49 | public init(invalidateAfterFirstRead: Bool) { 50 | let delegate = RxNFCNDEFReaderSessionDelegate() 51 | let session = NFCNDEFReaderSession(delegate: delegate, queue: nil, invalidateAfterFirstRead: invalidateAfterFirstRead) 52 | self.message = Observable 53 | .create { observer in 54 | delegate.observer = observer 55 | return Disposables.create() 56 | } 57 | .do(onSubscribed: { 58 | session.begin() 59 | }) 60 | self.session = session 61 | self.delegate = delegate 62 | } 63 | 64 | } 65 | 66 | extension Reactive where Base: NFCNDEFReaderSession { 67 | 68 | static public func session(invalidateAfterFirstRead: Bool = true) -> Observable { 69 | return Observable 70 | .create { observer in 71 | let session = RxNFCNDEFReaderSession(invalidateAfterFirstRead: invalidateAfterFirstRead) 72 | observer.on(.next(session)) 73 | return Disposables.create() 74 | } 75 | .share(replay: 1, scope: .whileConnected) 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /RxCoreNFC/RxCoreNFC.h: -------------------------------------------------------------------------------- 1 | // 2 | // RxCoreNFC.h 3 | // RxCoreNFC 4 | // 5 | // Created by Maxim Volgin on 24/10/2017. 6 | // Copyright (c) RxSwiftCommunity. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for RxCoreNFC. 12 | FOUNDATION_EXPORT double RxCoreNFCVersionNumber; 13 | 14 | //! Project version string for RxCoreNFC. 15 | FOUNDATION_EXPORT const unsigned char RxCoreNFCVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /RxCoreNFCTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /RxCoreNFCTests/RxCoreNFCTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxCoreNFCTests.swift 3 | // RxCoreNFCTests 4 | // 5 | // Created by Maxim Volgin on 24/10/2017. 6 | // Copyright (c) RxSwiftCommunity. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import RxCoreNFC 11 | 12 | class RxCoreNFCTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------