Skip to content

tapptitude/tapptitude-swift

Repository files navigation

Tapptitude Swift

alt text alt text alt text

Tapptitude Swift is a Xcode library to speed up iOS development for usual scenario. Dispaying a scrollable list with multiple kinds of cells, handling loading more data for you. Support for empty view and reloading data is also present.

Installation

CocoaPods is a dependency manager for Cocoa projects. To integrate tapptitude-swift into your Xcode project using CocoaPods, specify it in your Podfile

use_frameworks!
pod 'Tapptitude', :git => 'https://github.com/tapptitude/tapptitude-swift'

Contains

  • CollectionFeedController
  • CollectionCellController
  • TableFeedController
  • TableCellController
  • DataSource
  • SectionedDataSource
  • GroupedByDataSource
  • FilteredDataSource
  • SwipeToEditOnCollection

Usage

CollectionFeedController

Create Model class and UICollectionViewCell

class MyCell: UICollectionViewCell {
    //code
}

class MyClass {
    //parameters
}

Create Cell Controller

import Tapptitude

class MyCellController: CollectionCellController<MyClass, MyCell> {

    init() {
        //create cell with full width and height = 100
        super.init(cellSize: CGSize(width: -1, height: 100))
    }

    override func configureCell(_ cell: MyCell, for content: MyClass, at indexPath: IndexPath) {
        //configure your cell with given content
    }
}

Setup your ViewController screen with UICollectionView

import Tapptitude

class MyScreenViewController: CollectionFeedController {

    override func viewDidLoad() {
        super.viewDidLoad()

        cellController = MyCellController()
        dataSource = DataSource([MyClass()])
    }
}

TableFeedController

Create Model class and UITableViewCell

class MyCell: UITableViewCell {
    //code
}

class MyClass {
    //parameters
}

Create Cell Controller

import Tapptitude

class MyCellController: TableCellController<MyClass, MyCell> {

    init() {
        super.init(rowEstimatedHeight: 44)
    }

    override func configureCell(_ cell: MyCell, for content: MyClass, at indexPath: IndexPath) {
        //configure your cell with given content
    }
}

Setup your ViewController screen with UITableView

import Tapptitude

class MyScreenViewController: TableFeedController {

    override func viewDidLoad() {
        super.viewDidLoad()

        cellController = MyCellController()
        dataSource = DataSource([MyClass()])
    }
}

Contributing 👩‍💻👨‍💻

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

tapptitude-swift is released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages