Swiftpack.co - Package - crewos/FetchRequests

FetchRequests

FetchRequests is an eventing library inspired by NSFetchedResultsController and written in Swift.

Build Status CocoaPods Compatible Carthage Compatible Platform Pod License codecov

Features

  • [x] Sort and section a list of items
  • [x] Listen for live updates
  • [x] Animate underlying data changes
  • [x] Fetch associated values in batch
  • [x] Support paginated requests
  • [x] Comprehensive Unit Test Coverage

Usage

FetchRequests can be used for any combination of networking, database, and file queries. It is best when backed by something like a WebSocket where you're expecting your data to live update.

To get started, you create a CWFetchRequest which explains your data access patterns. The CWFetchedResultsController is the interface to access the your data. It will automatically cache your associated values for the lifetime of that controller. If a memory pressure event occurs, it will release its hold on those objects, allowing them to be deinited.

The example app has an UserDefaults-backed storage mechanism. The unit tests have in-memory objects, with NotificationCenter eventing.

Today, it is heavily dependent on the Obj-C runtime, as well as Key-Value Observation. With Swift 5.1 it should be possible to further remove those restrictions.

It currently relies upon a [String: Any] raw data representation. Everything is in place to remove this restriction, but the swift compiler crashes if so.

Requirements

  • iOS 10+ / macOS 10.12+ / tvOS 10+ / watchOS 3+
  • Xcode 10.2+
  • Swift 5+

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation

CocoaPods

Install with CocoaPods by specifying the following in your Podfile:

pod 'FetchRequests', '~> 1.0'

Carthage

Install with Carthage by specify the following in your Cartfile:

github "crewos/FetchRequests" ~> 1.0

Swift Package Manager

Install with Swift Package Manager by adding it to the dependencies value of your Package.swift:

dependencies: [
    .package(url: "https://github.com/crewos/FetchRequests.git", from: "1.0.0")
]

License

FetchRequests is released under the MIT license. See LICENSE for details.

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Used By

Total: 0