All Projects β†’ Morbix β†’ Tablemanager

Morbix / Tablemanager

Licence: other
An extension of UITableView. The way it should be. πŸ‘

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Tablemanager

Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (+92.94%)
Mutual labels:  cocoapods, uitableview
Toroundedtableview
A subclass of UITableView that styles it like Settings.app on iPad
Stars: ✭ 157 (+84.71%)
Mutual labels:  cocoapods, uitableview
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+1923.53%)
Mutual labels:  cocoapods, uitableview
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types πŸš€
Stars: ✭ 31 (-63.53%)
Mutual labels:  extensions, cocoapods
Mylinearlayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App θ‡ͺεŠ¨εΈƒε±€ UIView UITab…
Stars: ✭ 4,152 (+4784.71%)
Mutual labels:  cocoapods, uitableview
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+12495.29%)
Mutual labels:  extensions, cocoapods
Eureka
Elegant iOS form builder in Swift
Stars: ✭ 11,345 (+13247.06%)
Mutual labels:  cocoapods, uitableview
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Stars: ✭ 3,395 (+3894.12%)
Mutual labels:  cocoapods, uitableview
Cascadingtabledelegate
A no-nonsense way to write cleaner UITableViewDelegate and UITableViewDataSource in Swift.
Stars: ✭ 931 (+995.29%)
Mutual labels:  cocoapods, uitableview
Tangramkit
TangramKit is a powerful iOS UI framework implemented by Swift. It integrates the functions with Android layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,LayoutSizeClass to build your App θ‡ͺεŠ¨εΈƒε±€ UIView UITableView UICollectionView
Stars: ✭ 984 (+1057.65%)
Mutual labels:  cocoapods, uitableview
Localizationkit ios
Realtime Dynamic localization translation delivery system for iOS and Mac OSX in Swift. Create and update texts from localization.com without needing to recompile or redeploy. Cocapod for iOS devices (iPad, iPhone, iPod Touch and Mac)
Stars: ✭ 1,206 (+1318.82%)
Mutual labels:  cocoapods
Swiftcamscanner
A pod written in swift that lets you scan and crop documents. It uses edge detection and perspective transformation with OpenCV.
Stars: ✭ 77 (-9.41%)
Mutual labels:  cocoapods
Sfacecompare
Simple lib for iOS to find and compare faces.
Stars: ✭ 83 (-2.35%)
Mutual labels:  cocoapods
Slidingtabbar
A custom TabBar view with sliding animation written in Swift.
Stars: ✭ 84 (-1.18%)
Mutual labels:  cocoapods
Dikit
Dependency Injection Framework for Swift, inspired by KOIN.
Stars: ✭ 77 (-9.41%)
Mutual labels:  cocoapods
Sstoastmessage
SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.
Stars: ✭ 82 (-3.53%)
Mutual labels:  cocoapods
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-10.59%)
Mutual labels:  cocoapods
Ptehorizontaltableview
Horizontal UITableView inspired by EasyTableView.
Stars: ✭ 75 (-11.76%)
Mutual labels:  uitableview
Qmchatviewcontroller Ios
An elegant ready to go chat view controller for iOS applications
Stars: ✭ 75 (-11.76%)
Mutual labels:  cocoapods
Yndropdownmenu
✨ Awesome Dropdown menu for iOS with Swift 5.0
Stars: ✭ 1,259 (+1381.18%)
Mutual labels:  cocoapods

TableManager

Version License Platform Carthage compatible Build Status

TableManager is an extension of UITableView. Manipulate your table in an easier way. Add sections and rows. Configure headers and footers. Hide and show rows individually. And this library will handle all the protocols for you. The table the way it should be.

Requirements

It requires Xcode 10.0 and Swift 4.2.

Your project deployment target must be iOS 8.0+

Installation

CocoaPods

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

pod 'TableManager'

Manually

You can also install it manually just dragging TableManager file to your project.

Basic Usage

Configure the table with only 2 tiny steps

Step 1 - Import TableManager
import TableManager
Step 2 - Add a Row with a configuration
tableView.addRow().setConfiguration { _, cell, _ in 
    cell.textLabel?.text = "Row \(number)"
}

Complete Example

import TableManager

class ViewController: UITableViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        (1...10).forEach { n in
            tableView.addRow().setConfiguration { _, cell, _ in 
                cell.textLabel?.text = "Row \(n)"
            }    
        }
    }
}

Basic Usage

Documentation

Rows

The magic starts here: adding Rows.

Directly using UITableView's extension
tableView.addRow()
Or instance a row and add it in the table
let someRow = Row()
tableView.addRow(someRow)
You can add a row in a specific section, e.g. the last section
let someRow = Row()
tableView.sections.last?.addRow(someRow)

Visibility

You can change the property visible from any Section and any Row.

someRow.setVisible(true)

someSection.setVisible(false)

Configuring a custom cell

You can set a identifier and the configuration property:

let row = Row(identifier: "CellBasic", object: someString)

row.setConfiguration { (row, cell, indexPath) in
    if let text = row.object as? String {
        cell.textLabel?.text = text
    }
}

tableView.addRow(row)

Or declare a Row.Configuration and attribute it to any row:

let configuration: Row.Configuration = { (row, cell, indexPath) -> Void in
    if let text = row.object as? String {
        cell.textLabel?.text = text
    }
}
let rowA = tableView.addRow(Row(identifier: "CellBasic", object: someObject))
rowA.setConfiguration(configuration)

let rowB = tableView.addRow(Row(identifier: "CellBasic", object: otherObject))
rowB.setConfiguration(configuration)

Row selection event

You can set the didSelect property:

let row = Row(object: someString)

row.setDidSelect { (row, tableView, indexPath) in
    if let text = row.object as? String {
        print(text + " selected")
    }
}

tableView.addRow(row)

Or declare a Row.DidSelect and attribute it to any row:

let didSelect: Row.DidSelect = { (row: Row, tableView: UITableView, indexPath: NSIndexPath) -> Void in
    if let text = row.object as? String {
        print(text + " selected")
    }
}

let rowA = tableView.addRow(Row(object: someString))
rowA.setDidSelect(didSelect)

let rowB = tableView.addRow(Row(object: someString))
rowB.setDidSelect(didSelect)

Selected row

You can get the row that corresponds the selected cell

if let selectedRow = tableView.selectedRow() {
    print('the selected row is: ' + selectedRow.object)
}

Visible rows

You can get the visible rows that corresponds the cells appearing in the UI for the user

if let visibleRows = tableView.visibleRows() {
    visibleRows.forEach { row in
        print(row)
    }
}

UIScrollViewDelegate events

You can handle all the scrollview delegates by your own

class TableViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
            
        tableView.scrollViewDelegate = self
        
        // [...]
    }
    
    override func scrollViewDidScroll(_ scrollView: UIScrollView) {
        print(scrollView.contentOffset.y)
    }
    
} 

Drag & Drop feature or Reordering

You can make a row draggable when table is editing just passing true in method setCanMove:

let row = tableView.addRow()
            
row.setCanMove(true)

// [...]

tableView.editing = true

Drag and Drop

Deletion

You can make a row deletable when table is editing just passing true in method setCanDelete:

let row = tableView.addRow()
            
row.setCanDelete(true)

// [...]

tableView.editing = true

Deletion

And you can easily edit the title confirmation too:

row.setCanDelete(true, titleForDeleteConfirmation: "Go away")

Go Away

Index Titles

You can make an Index Title(like contacts list on iOS) by just passing the indexTitle for each section that you want to show in indexTitles, calling the method setIndexTitle:

let section = tableView.addSection().setIndexTitle("A")

Index Titles

CHANGELOG

Go to CHANGELOG

Contribute

Feel free to submit your pull request, suggest any update, report a bug or create a feature request.

Just want to say hello? -> [email protected]

Contributors

Author: @Morbin_ / fb.com/hgmorbin

See the people who helps to improve this project: Contributors β™₯

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].