Latest 0.5.1
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 3.2

Supported record type

  • Text Record
  • URI Record
  • Smart Poster Record

Usage

  • Text Record
    let record: NFCNDEFPayload = getRecord() // get record using CoreNFC
    let recordType = NFCNDEFWellknown.RecordType(rawData: record.type)
    if recordType == .text {
    let textRecord: NFCNDEFWellknown.TextRecord? = try? recordType.parse(with: record.payload)
    if let text = textRecord?.text {
      print("text: (text)")
    }
    }
  • URI Record

    if recordType == .uri {
    let uriRecord: NFCNDEFWellknown.URIRecord? = try? recordType.parse(with: record.payload)
    if let uri = uriRecord?.uri {
      print("uri: (uri.absoluteString)")
    }
    }
  • Smart Poster Record
    if recordType == .smartPoster {
    let spRecord: NFCNDEFWellknown.SmartPosterRecord? = try? recordType.parse(with: record.payload)
    if let uri = spRecord?.uri {
      print("uri: (uri.absoluteString)")
    }
    }

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.5.1",
    "summary": "Handling NDEF Records library.",
    "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.5.1"
    },
    "source_files": [
        "Sources",
        "Sources/**/*.{swift}"
    ],
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This