Latest 0.0.3
Homepage https://github.com/klevison/AccordionTableViewController
License MIT
Platforms ios 8.0, requires ARC
Authors

Swift version of https://github.com/klevison/KMAccordionTableViewController

...

Current Version

Version: 0.0.3

Under the Hood

  • Supports UIViews as sections (UIViews, UIViewController’s view, UITableViews, UIWebView, MKMapView, etc…)
  • Update content and size of a section
  • Custom animation, headers, sizes, etc…
  • Xcode 8
  • Swift 3

How to install it?

CocoaPods is the easiest way to install AccordionTableViewController. Run pod search AccordionTableViewController to search for the latest version. Then, copy and paste the pod line to your Podfile. Your podfile should look like:

platform :ios, '8.0'
pod 'AccordionTableViewController'

Finally, install it by running pod install.

If you don’t use CocoaPods, import the all files from "Classes" directory to your project.

How to use it?

Extends from AccordionTableViewController

import UIKit

class ViewController: AccordionTableViewController {

}

Set sections and delegate variables

    override func viewDidLoad() {
        super.viewDidLoad()

        let viewOfSection = UIView(frame: CGRectMake(0, 0, view.frame.size.width, 300))
        viewOfSection.backgroundColor = UIColor.blueColor()
        let section = Section()
        section.view = viewOfSection
        section.title = "Section"

        oneSectionAlwaysOpen = true
        sections =  [section] //how many sections you want
        delegate = self
    }

Customization

Each section has an appearence var and it can be customized

var open = false
var view: UIView?
var overlayView: UIView?
var headerView: SectionHeaderView?
var title: String?
var backgroundColor: UIColor?
var sectionIndex: Int?
var appearence = Appearence()

Contact

If you have any questions comments or suggestions, send me a message. If you find a bug, or want to submit a pull request, let me know.

Copyright and license

Copyright (c) 2015 Klevison Matias (http://twitter.com/klevison). Code released under the MIT license.

Latest podspec

{
    "name": "AccordionTableViewController",
    "version": "0.0.3",
    "summary": "Accordion UITableViewController",
    "description": "Swift version of https://github.com/klevison/KMAccordionTableViewController",
    "homepage": "https://github.com/klevison/AccordionTableViewController",
    "screenshots": "http://dl.dropbox.com/u/378729/MBProgressHUD/1.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Klevison Matias": "[email protected]"
    },
    "source": {
        "git": "https://github.com/klevison/AccordionTableViewController.git",
        "tag": "0.0.3"
    },
    "social_media_url": "https://twitter.com/klevison",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": [
        "Classes",
        "Classes/**/*.{swift}"
    ],
    "resource_bundles": {
        "AccordionTableViewController": [
            "Classes/**/*.{xib,png,nib}"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This