Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Simple accordion view in Cocoa Touch

branch: master

Fixed #7

latest commit 133911b3b8
Wojtek Siudzinski suda authored
Octocat-spinner-32 Example Added allowsEmptySelection property as requested in #11 January 25, 2014
Octocat-spinner-32 .gitignore Workplace cleanup December 18, 2012
Octocat-spinner-32 AccordionView.h Fixed #7 January 25, 2014
Octocat-spinner-32 AccordionView.m Fixed #7 January 25, 2014
Octocat-spinner-32 AccordionView.podspec Added CocoaPods spec September 21, 2013
Octocat-spinner-32 LICENSE.md Added license September 21, 2013
Octocat-spinner-32 README.md Update README.md January 25, 2014
README.md

AccordionView

Very simple accordion view in Cocoa Touch.

Usage

AccordionView *accordion = [[AccordionView alloc] initWithFrame:CGRectMake(0, 0, 320, 420)];
[self addSubview:accordion];

// Only height is taken into account, so other parameters are just dummy
UIButton *header1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 0, 30)];
[header1 setTitle:@"First row" forState:UIControlStateNormal];

UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 200)];
// ... add subviews to view1

[accordion addHeader:header1 withView:view1];

// ... add more panels

[accordion setNeedsLayout];

// Set this if you want to allow multiple selection
[accordion setAllowsMultipleSelection:YES];

// Set this to NO if you want to have at least one open section at all times
[accordion setAllowsEmptySelection:YES];

// Remove section at index 1
[accordion removeHeaderAtIndex:1];

Todo

  • Horizontal view

LICENCE

Copyright (C) 2011-2013 Wojtek Siudzinski admin@suda.pl, Appsome

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Something went wrong with that request. Please try again.