Latest 1.0.0
Homepage https://github.com/jw1540/JWMixedList
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Why?

  • ✅ Data agnostic UITableViewControllers
  • ✅ Data agnostic UICollectionViewControllers
  • ✅ Better abstractions layer of abstraction around data sources
  • ✅ Easier to test

If you have ever found yourself writing the following code:

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

    let cell: UICollectionViewCell

    if indexPath.item == 0 {
        cell = collectionView.dequeue(someCell) as! TypeA
        cell.configure()
    } else if indexPath.item == 2 {
        cell = collectionView.dequeue(someCell) as! TypeB
        cell.configure()
    } else {
        fatalError("This is getting long...")
    }

    return cell
}

You might benefit from abstracting out into Item Controllers. You remove all this logic by having some FeedDataType enum, and switching over that.

Check the Example project to see how it’s implemented, and the benefits you might be able to get from it.

Contributing

There are a few things this doesn’t support, and some challenges it faces. If you have solutions, please raise a PR!

Installation

JWMixedList is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'JWMixedList'

Author

Joe Williams

License

JWMixedList is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "JWMixedList",
    "version": "1.0.0",
    "summary": "A mechanism for having mixed data types in one collection view.",
    "description": "UITableViews and UICollectionViews can be difficult to manage when you want multiple data types.nFor example, a collection view that supports both text only cell types, and image only cell types.nJWMixedList allows you to have data agnostic list view controllers, and manager the datanon an item by item basis.",
    "homepage": "https://github.com/jw1540/JWMixedList",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "jw1540": "[email protected]mail.com"
    },
    "source": {
        "git": "https://github.com/jw1540/JWMixedList.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/seph_joe_",
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "3.2",
    "source_files": "JWMixedList/**/*.swift"
}

Pin It on Pinterest

Share This