Go to file
Yoshihiro Kato 695e80472f Updates to 0.7.1
- fixes package.swift
2020-07-06 17:16:50 +09:00
Example/NFCSample Updates to 0.7.1 2020-07-06 17:16:50 +09:00
NFCSupport.xcodeproj Updates to 0.7.0 2020-05-26 06:31:41 +09:00
Sources/NFCSupport Updates to 0.7.0 2020-05-26 06:31:41 +09:00
Tests initial commit 2017-08-12 02:17:50 +09:00
.gitignore initial commit 2017-08-12 02:17:50 +09:00
.swift-version Updates to 0.7.0 2020-05-26 06:31:41 +09:00
.travis.yml fixes simulator version of travis.yml 2020-05-26 06:43:27 +09:00
LICENSE initial commit 2017-08-12 02:17:50 +09:00
NFCSupport.podspec Updates to 0.7.1 2020-07-06 17:16:50 +09:00
Package.swift Fixes Package.swift 2020-07-06 17:08:56 +09:00
README.md Updates to 0.7.0 2020-05-26 06:31:41 +09:00

README.md

NFCSupport

Xcode Swift platforms Travis CI

This is support library for handling NFC NDEF Records.

Environment

  • iOS11
  • Swift 5.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