This is support library for handling NFC NDEF Records.
- iOS11
- Swift 5.2
- Text Record
- URI Record
- Smart Poster Record
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))")
}
To install it, simply add the following line to your Cartfile
:
github "yshrkt/NFCSupport"
To install it, simply add the following line to your Podfile
:
pod "NFCSupport"
NFCSupport is released under the MIT license. See LICENSE for details.