Skip to content

imilakovic/IMDrawersTableView

Repository files navigation

IMDrawersTableView

IMDrawersTableView is a simple iOS table view with drawers instead of standard cells.

Requirements

  • Requires iOS 7 or later
  • Requires Automatic Reference Counting (ARC)

Demo Project

Please feel free to try the IMDrawersTableViewDemo project in Xcode. It demonstrates the setup and behaviour of the table view and also provides a couple of UX ideas for implementation.

Installation

CocoaPods

If you are using CocoaPods, simply add pod 'IMDrawersTableView' to your Podfile.

Drag & Drop

Simply drag & drop the IMDrawersTableView folder to your project.

Usage

IMDrawersTableView has a very similar usage to UITableView. Please see the following steps:

####1. Import the header file

#import "IMDrawersTableVew.h"

####2. Initialize the table view and set dataSource and delegate properties

_tableView = [IMDrawersTableView new];
_tableView.dataSource = self;
_tableView.delegate = self;
[self.view addSubview:_tableView];

####3. Set the frame for table view

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    
    _tableView.frame = self.view.bounds;
}

####4. Implement required data source methods

- (UIView *)headerViewForTableView:(IMDrawersTableView *)tableView {
    return [YourCustomTableHeaderView new];
}

- (NSInteger)numberOfCellsInTableView:(IMDrawersTableView *)tableView {
    return 3;
}

- (IMDrawersTableViewCell *)tableView:(IMDrawersTableView *)tableView cellAtIndex:(NSInteger)index {
    IMDrawersTableViewCell *cell = [IMDrawersTableViewCell new];
    cell.headerView = [YourCustomCellHeaderView new];
    cell.contentView = [YourCustomCellContentView new];
    
    return cell;
}

License

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

About

iOS custom table view with drawers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published