Coder Social home page Coder Social logo

swiftdirectorywatcher's Introduction

Swift DirectoryWatcher

CI Status Version License Platform

Directory watcher for iOS and macOS written in Swift.

Usage

Example:

import DirectoryWatcher

class ViewController: UIViewController {
  lazy var url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
  lazy var watcher = DirectoryWatcher(url: url)

  override func viewDidLoad() {
    super.viewDidLoad()
    
    watcher.delegate = self
  }
}

extension ViewController: DirectoryWatcherDelegate {
  func directoryWatcher(_ watcher: DirectoryWatcher, changed: DirectoryChangeSet) {
    print("new files \(changed.newFiles), deleted files \(changed.deletedFiles)")
  }
}

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate DirectoryWatcher into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'DirectoryWatcher', '~> 0.0.4'

Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate DirectoryWatcher into your project manually.

Embedded Framework

Download this repository into a folder at the same level of your project folder. From your Xcode project drag the DirectoryWatcher.xcodeproj file into your project at the top level.

In your project target scroll down to the Embedded Binaries setting and drag DirectoryWatcher.framework from DirectoryWatcher.xcodeproj/Products. The top framework is for macOS, the bottom one is for iOS (they are name identically).

Build your project and you are good to go.

swiftdirectorywatcher's People

Contributors

dworak avatar mirkokiefer avatar ulian-onua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

carabina

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.