Code Monkey home page Code Monkey logo

expandabletable's Introduction

AZExpandable

AZExpandable is a lightweight proxy for UITableView to expand cells. It incapsulates native NSProxy mechanism inside and gives swifty api outside.

General advantages: No Subclassing, No Swizzling, Easy to intagrate

Example

Alt Text

Requirements

  • iOS 8.0+
  • Xcode 9.2+
  • Swift 4.0+

Communication

  • If you'd like to ask a general question, use Twitter.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1+ is required to build AZExpandable.

To integrate AZExpandable into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target '<Your Target Name>' do
    pod 'AZExpandable'
end

Then, run the following command:

$ pod install

Usage

private var expandableTable: ExpandableTable!// Expanding Table Proxy

override func viewDidLoad() {
    super.viewDidLoad()
    // infoProvider - UITableViewDelegate & UITableViewDataSource
    expandableTable = ExpandableTable(with: tableView, infoProvider: self)
}

func expandCell(at indexPath: IndexPath) {
    let cellClosure: CellClosure = { (IndexPath) -> (UITableViewCell) in
    	//Your custom expanding cell
        return self.tableView.dequeueReusableCell(withIdentifier: "Identifier", for: indexPath)
    }
    expandableTable.expandCell(ExpandedCellInfo(for: indexPath, cellType: .custom(cellClosure)))
}

func unexpandCell() {
	expandableTable.unexpandCell()
}

License

AZExpandable is released under the MIT license. See LICENSE for details.

expandabletable's People

Contributors

azonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

expandabletable's Issues

Unable to find a specification for `AZExpandable (~> 0.0)`

I'm unable to install this pod in my project. This is a greenfield project with nothing really in it yet. Here's my Podfile.

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
use_frameworks!

target 'AppName' do
  pod 'AZExpandable', '~> 0.0'
end

Am I doing something wrong? Feel free to close this if it's an issue with Cocoapods.

Expand the same cell and force its reload?

I have a cell with 2 buttons. Each button may expand cell. The expanded cell is the same but can have different data. For example in my case it contains DatePicker and a button but DatePicker's value depends on which cell button is pressed.
If I do it as described in your template then I call expandCell multiple times but it seems all the calls are ignored except of the first one.
Calling unexpandCell before each expandCell is not a solution too - the cell is collapsed and expanded again with animation.

How to change font type in section header

for get to add in UITableViewDelegate
func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int)
{
let header = view as! UITableViewHeaderFooterView
header.textLabel?.font = UIFont(font: .avenirBook, size: 14)
header.textLabel?.textColor = UIColor.red
}

Error in readme

Requirements

iOS 8.0+
Xcode 9.2+
Swift 4.0+

I use Swift 4 in my project and install your library via cocoapods. I get some errors with swift version like the following:
'automaticDimension' has been renamed to 'UITableViewAutomaticDimension'

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.