Latest 0.6.0
Homepage https://github.com/yshrkt/NFCSupport
License MIT
Platforms ios 11.0
Authors

Xcode
Swift
platforms
Travis CI

This is support library for handling NFC NDEF Records.

Environment

  • iOS11
  • Swift 4.2

Supported record type

  • Text Record
  • URI Record
  • Smart Poster Record

Usage

guard let result = try? NFCNDEFWellknown.parse(type: record.type, payload: record.payload) else {
    print("can not parse record")
    return
}

switch result {
case let .text(record):
    print("text: (record.text)")
case let .uri(record):
    print("uri: (record.uri?.absoluteString ?? "")")
case let .smartPoster(record):
    print("title: (record.titleRecords.first?.text ?? "") uri: (record.uri?.absoluteString ?? "")")
case let .unsupported(type):
    print("unsupported record type ((type))")
}

Installation

Carthage

To install it, simply add the following line to your Cartfile:

github "yshrkt/NFCSupport"

CocoaPods

To install it, simply add the following line to your Podfile:

pod "NFCSupport"

Licence

NFCSupport is released under the MIT license. See LICENSE for details.

Author

yshrkt

Latest podspec

{
    "name": "NFCSupport",
    "version": "0.6.0",
    "summary": "Handling NDEF Records library.",
    "swift_version": "4.2",
    "description": "NFCSupport is support library for handling NFC NDEF Records.",
    "homepage": "https://github.com/yshrkt/NFCSupport",
    "license": "MIT",
    "authors": {
        "Yoshihiro Kato": "[email protected]"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source": {
        "git": "https://github.com/yshrkt/NFCSupport.git",
        "tag": "0.6.0"
    },
    "source_files": [
        "Sources",
        "Sources/**/*.{swift}"
    ]
}

Pin It on Pinterest

Share This