Coder Social home page Coder Social logo

blackjacx / source Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 3.03 MB

Tired of implementing the data sources over and over again? Want to use a lightweight solution that does not mess up your view controllers? Then this is for you! The generic data source implementation for all your view controllers, that supports UITableView, UICollectionView and NSFetchedResultsController

License: MIT License

Ruby 3.39% Swift 95.57% Objective-C 1.04%
ios uitableview uicollectionview swift xcode apple datasource spm swiftpackage swiftpackagemanager carthage carthage-support cocoapods hacktoberfest

source's Issues

Support performBatchUpdate

Hey there, so far you always call reloadData on the table view when the datasource gets updated. It would be more efficient/elegant/pretty to do the diffing first and then insert/delete the items that changed. Pre iOS 13 that is, after that it's just a one liner, but either way reloadData ain't ideal. ^^

๐Ÿšจ Fix Cells LayoutMargins

Expected behaviour

Remove from adjustCellSeparatorInsets(...):

        // explicitly setting cell's layout margins
        directionalLayoutMargins = insets

to be able to properly use directionalLayoutMargins โœŒ๏ธ

Make sure to use this one again in TableContainer instead of updateCellSeparatorInsets()

Actual behaviour

directionalLayoutMargins are not usable since they are influenced by this setting on the UITableViewCell.

Update View Models Without Reloading The Table

Expected behaviour

It must be possible to update the view models without reloading the table view. When you use a e.g. UISwitch and press it the change must be reflected in the view model but since the switch value has already changed it is not necessary to update reload the cell.

Actual behaviour

On update of view models the table is always reloaded.

Implement TableView functions

  • optional public func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool
  • optional public func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath)
  • optional public func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.