Swiftpack.co - 1998code/SwiftNFC as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by 1998code.
1998code/SwiftNFC 1.2.0
A super-easy way to Read and Write NFC Tag on SwiftUI.
⭐️ 5
🕓 3 days ago
iOS
.package(url: "https://github.com/1998code/SwiftNFC.git", from: "1.2.0")

SwiftNFC 📱🏷️ - Powerful Read+Write within few lines of Coding

Accelerated by Apple SwiftUI & Backed with CoreNFC

Aims

Provide a super-easy way for Apple Developers to Read and Write NFC Tags on SwiftUI.

Version

GitHub release (latest by date) GitHub release (latest by date including pre-releases)

image

Environment

CleanShot 2023-01-25 at 11 58 02@2x

Xcode Local

Tested on Latest Compatible
iOS 16 > 14

Apple Watch is well-known not supported. iPad / Mac is compatible with CoreNFC but there is no hardware to support this feature. 😂

Xcode Cloud ☁️

Compatible ✅

Xcode Cloud requires Apple Developer Program membership.

Guide

Full Tutorial on Medium

Preparation

  1. Add to your project via Package Manager.
CleanShot 2023-01-25 at 12 23 13@2x
  1. Add Near Field Communication Tag Reading (aka NFC) into the Project's Combilities.
CleanShot 2023-01-25 at 12 30 23@2x
  1. Add NFC Privacy into Info.plist
CleanShot 2023-01-25 at 18 35 58@2x

Basic Usage

  1. Import first.
import SwiftNFC
  1. Add ObservedObject before body or any some View.

Read

@ObservedObject var NFCR = NFCReader()

Write

@ObservedObject var NFCW = NFCWriter()

Functions

func read() {
    NFCR.read()
}
func write() {
    NFCW.msg = NFCR.msg
    NFCW.write()
}

Demo

Path: ./Demo (Xcode Project in SwiftUI)

License

MIT

FAQ

Q1. How can I contribute to the project?
A1. Simply pull a request, and someone will review your code. If everything is okay, your changes will be merged and reflected in the next minor version.
Q2. Can I use it in Educational (includ. Student's Homework, Class's demo) or NGO or Commerical Project?
A2. YES. This project is under license of MIT. Feel free to use it :)

GitHub

link
Stars: 5
Last commit: 3 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Related Packages

Release Notes

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics