ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - krzysztofzablocki/KZFileWatchers: A micro-framework for observing file changes, both local and remote. Helpful in building developer tools.
A micro-framework for observing file changes, both local and remote. Helpful in building developer tools. - krzysztofzablocki/KZFileWatchers
Visit Site

GitHub - krzysztofzablocki/KZFileWatchers: A micro-framework for observing file changes, both local and remote. Helpful in building developer tools.

GitHub - krzysztofzablocki/KZFileWatchers: A micro-framework for observing file changes, both local and remote. Helpful in building developer tools.

KZFileWatchers

Demo GIF

CI Status Version License Platform

Wouldn't it be great if we could adjust feeds and configurations of our native apps without having to sit back to Xcode, change code, recompile and navigate back to screen we were at?

One of the basis of building tools that allow us to do just that is the way we observe for data changes, this micro-framework provides you File observers for Local and Remote assets.

This framework provides:

  • FileWatcher.Local useful for observing local file changes, it can also be used to breach Sandbox env for debug simulator builds and e.g. observe file on the developer desktop (like the demo app does).

  • FileWatcher.Remote can be used to observe files on the web, it supports both Etag headers and Last-Modified-Date so you can just put file on Dropbox or real ftp server.

It also supports usage from Objective-C projects. For this, you should consider these following steps:

  1. Add $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) into your projects Library Search Paths in Build Setting section.

  2. Import swift-header by adding @import KZFileWatchers; into any .m file, where you want to use FileWatchers.

  3. Use provided classes for set up file observing like this:

self.fileWatcher = [[LocalFileWatcher alloc] initWithPath:path];
self.fileWatcher.delegate = self;
[self.fileWatcher startWithError:nil];
  1. Implement FileWatcherDelegate in your class for handling file refreshing events. For example:
- (void)refreshDidOccurFrom:(id<FileWatcherProtocol>)fileWatcher type:(enum RefreshResult)type data:(NSData *)data
{
    self.textLabel.text = [[NSString alloc] initWithData:data encoding:kCFStringEncodingUTF8];
}

Installation

KZFileWatchers is available through CocoaPods and Swift Package Manager.

CocoaPods

In order to install KZFileWatchers by using CocoaPods, simply add the following line to your Podfile:

pod "KZFileWatchers"

Last version to support Swift 2.3 is 0.1.2 Last version to support Swift 3.0 is 1.0.4

Swift Package Manager

Installing KZFileWatchers over SwiftPM is only supported since version 1.0.1. You just need to add it as a dependency to your Package.swift manifest:

import PackageDescription

let package = Package(
    name: "YourProject",
    dependencies: [
        .package(url: "https://github.com/krzysztofzablocki/KZFileWatchers.git", from: "1.1.0"),
        // other dependencies
    ],
    targets: [
        .executableTarget(name: "YourApp", dependencies: [
            .product(name: "KZFileWatchers", package: "KZFileWatchers"),
            // other dependencies
        ]
    ]
)

Author

Krzysztof Zabłocki, [email protected]

Contributing

Contributions to KZFileWatchers are welcomed and encouraged! Please see the Contributing guide.

A list of contributors is available through GitHub.

To give clarity of what is expected of our members, KZFileWatchers has adopted the code of conduct defined by the Contributor Covenant. This document is used across many open source communities. For more, see the Code of Conduct.

License

KZFileWatchers is available under the MIT license. See LICENSE for more information.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory