Latest 0.4.0-dev
Homepage https://github.com/jpchmura/JPCDataSourceController
License MIT
Platforms ios 8.0
Dependencies JPCActivityIndicatorButton

PRERELEASE

A structured, OO approach to Table and Collection views. Fetching and showing content from an API made simple.

Table and Collection views populated with content fetched from a web API is essential a large number of apps. Yet I’ve seen many poor implementations of this design. I think Apple’s API for table and collection views tends to lead developers into creating view controllers with a couple thousand lines of code, most of which isn’t really "view controller" responsibilities (I know I’ve done it). This violates the SOLID design principle of single responsibility and makes the code not very reusable. I think it may be best that the data source is never part of the view controller. Leaving the view controller free to handle more appropriate tasks. Here are some of the higlights:

  • DataSourceController class handles the logic to drive table and collection view data sources
  • Data source is divided into Fetch Requests, backing Models, and Cell Factories
  • A state machine in DataSourceController neatly drives Fetching, Preparing Content, and Reloading data
  • Set a list of Models to combine multiple data sources
  • BackgroundView class displays an activity view while loading data and can display helpful error messages when loading fails
  • Animators make it easy to animate changes in content
  • Supports embedded collection views (Like in App Store)
  • Very minimal code required to get up and running
  • Pull to refresh (Coming soon)
  • Infinite scrolling (Coming soon)

Installation

JPCDataSourceController is swift only. You may import it into projects that contain Objective-C code but it is only usable from swift source files.

Cocoapods

use_frameworks!
pod 'JPCDataSourceController', '~> 0.1'

Manual

Copy files from "Source" folder into your project.

Latest podspec

{
    "name": "JPCDataSourceController",
    "version": "0.4.0-dev",
    "summary": "A structured, OO approach to Table and Collection views. Fetching and showing content from an API made simple.",
    "description": "Table and Collection views populated with content fetched from a web API is essential a large number of apps. Yet I've seen many poor implementations of this design.  I think Apple's API for table and collection views tends to lead developers into creating view controllers with a couple thousand lines of code, most of which isn't really "view controller" responsibilities (I know I've done it).  This violates the SOLID design principle of single responsibility and makes the code not very reusable.  I think it may be best that the data source is never part of the view controller.  Leaving the view controller free to handle more appropriate tasks.  Here are some of the higlights:n* DataSourceController class handles the logic to drive table and collection view data sourcesn* Data source is divided into Fetch Requests, backing Models, and Cell Factoriesn* A state machine in DataSourceController neatly drives Fetching, Preparing Content, and Reloading datan* Set a list of Models to combine multiple data sourcesn* BackgroundView class displays an activity view while loading data and can display helpful error messages when loading failsn* Animators make it easy to animate changes in contentn* Supports embedded collection views (Like in App Store)n* Very minimal code required to get up and runningn* Pull to refresh (Coming soon)n* Infinite scrolling (Coming soon)",
    "homepage": "https://github.com/jpchmura/JPCDataSourceController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Jon Chmura",
    "social_media_url": "http://twitter.com/jpchmura",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/jpchmura/JPCDataSourceController.git",
        "branch": "universal-cell-factories"
    },
    "source_files": "Source/*.swift",
    "dependencies": {
        "JPCActivityIndicatorButton": [
            "~> 2.1"
        ]
    }
}

Pin It on Pinterest

Share This