Git Product home page Git Product logo

nfcbulkwriter's Introduction

SimplyNFC

Simply read and write NFC tags with iPhone (iOS 14.0+)

GitHub license Platform Swift

Installation

Swift package manager

Go to File | Swift Packages | Add Package Dependency... in Xcode and search for ยซย SimplyNFCย ยป

Cathage

You can use Carthage to install SimplyNFC by adding it to your Cartfile.

github "yanngodeau/SimplyNFC"

Manual

  1. Put SimplyNFC repo somewhere in your project directory.
  2. In Xcode, add SimplyNFC.xcodeproj to your project
  3. On your app's target, add the SimplyNFC framework:
    1. as an embedded binary on the General tab.
    2. as a target dependency on the Build Phases tab.

Usage

Read tag

Reading NCFNDEFMessage from tag

import SimplyNFC

let nfcManager = NFCManager()
nfcManager.read { manager in
    // Session did become active
    manager.setMessage("๐Ÿ‘€ Place iPhone near the tag to read")
} didDetect: { manager, result in
    switch result {
    case .failure:
        manager.setMessage("๐Ÿ‘Ž Failed to read tag")
    case .success:
        manager.setMessage("๐Ÿ™Œ Tag read successfully")
   }
}

Write on tag

Writing NFCNDEFMessage on tag

import SimplyNFC

let nfcManager = NFCManager()
nfcManager.write(message: ndefMessage) { manager in
    // Session did become active
    manager.setMessage("๐Ÿ‘€ Place iPhone near the tag to be written on")
} didDetect: { manager, result in
    switch result {
    case .failure:
        manager.setMessage("๐Ÿ‘Ž Failed to write tag")
    case .success:
        manager.setMessage("๐Ÿ™Œ Tag successfully written")
   }
}

Contribute

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

License

SimplyNFC is distributed under the MIT License.

Author

Based on code by @tattn

nfcbulkwriter's People

Contributors

yanngodeau avatar 1998code avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.