Coder Social home page Coder Social logo

justinmfischer / swiftyaccordioncells Goto Github PK

View Code? Open in Web Editor NEW
168.0 12.0 34.0 3.35 MB

Example Swift 3.0 Xcode 8.0 project which demonstrates how to expand and collapse a UITableView like an accordion. Using this lightweight data structure approach, UITableViewCell header/sub-item rows can be added or removed dynamically as needed. Subclass table for further reuse.

License: MIT License

Swift 100.00%

swiftyaccordioncells's Introduction

Swifty Accordion Cells

Example Swift 3.0 Xcode 8.0 project which demonstrates how to expand and collapse a UITableView like an accordion. Using this lightweight data structure approach, UITableViewCell header/sub-item rows can be added or removed dynamically as needed. Subclass table for further reuse.

swiftyaccordioncells's People

Contributors

justinmfischer avatar alexshive avatar

Stargazers

Fernando avatar Diana Domoslavska avatar Sergei Fabian avatar machzen avatar  Stanislav Sokolov avatar  avatar Nikita Vasilev avatar Anton avatar  avatar  avatar Conner Simmons avatar  avatar Kyle Howells avatar Ross avatar Kelvin avatar Jack Breon avatar  avatar James Lee avatar Simon Riis Olesen avatar  avatar Mohammad Farhan avatar  avatar YITA avatar David Martínez avatar Jonathan avatar Pradeep Rajkumar avatar Billy R avatar  avatar Gene Loparco avatar Rishabh Kesarwani avatar  avatar Husnain Ali avatar Rufat Babayev avatar Mohammad Azmal Hossain avatar Sultankhan avatar Kai Reeh avatar Karsten Gresch avatar  avatar Abdul-Mujeeb Aliu avatar ₴Ⱡ33₱ avatar Jim Carter avatar Tak avatar Milad Faridnia avatar  avatar Pedro Molina avatar DocMacFain avatar Chashmeet Singh avatar Mauran Muthiah avatar Vishal Gabani avatar omarfraiwan avatar Maksym Leshchenko avatar Frederic D. avatar Abdulmomen Bsruki avatar Wes avatar José GC avatar  avatar Shumpei Kobayashi avatar Pierre Wehbe avatar  avatar Kye Esa avatar Vinny avatar  avatar  avatar Sally Ahmed avatar Julio Diaz avatar Rafael Leandro avatar Yan Malynivskyi avatar JerryY avatar Tony Li avatar Jason Jobe avatar Samuel Deng avatar  avatar Amila Fonseka avatar Super Jump avatar Raman avatar Dondrey Taylor avatar shima avatar Steve Thornton avatar Nealon Young avatar Abdulrahman Alfulayt avatar Huy Vuong avatar terry.pang avatar Daniel Caldas avatar Vala Kohnechi avatar  avatar Viraj Patel avatar  avatar Marcelo Sampaio avatar Ilam Mougy avatar Kirill Kunst avatar Darek avatar Ryan D avatar YuryG avatar Akash Padhiyar avatar Sean Perkins avatar Takashi Saito avatar Jorge Mendoza avatar Karim Razak avatar Luis Burgos avatar  avatar

Watchers

Damian Sullivan avatar Paul Unbehagen avatar  avatar James Cloos avatar Carabineiro avatar Tranld avatar  avatar  avatar Rodrigo Astorga avatar  avatar Carly Fristoe avatar  avatar

swiftyaccordioncells's Issues

Not working Swift 3.0

Hi ,
when i run the app it coming many compile errors. please updated latest swift3.0
Thanks & Regards,
Gupta.

code is not working with Swift 3 : Please Find the error log.

Error Log : Please Solve it.

Swift Compiler Error Group
SwiftyAccordionCells.swift:12:5: Expected declaration
SwiftyAccordionCells.swift:12:22: Consecutive declarations on a line must be separated by ';'
ViewController.swift:160:86: Expected member name following '.'
ViewController.swift:160:86: Expected ',' separator
ViewController.swift:160:86: Expected expression in list of expressions
ViewController.swift:76:70: Use of undeclared type 'IndexPath'
ViewController.swift:101:72: Use of undeclared type 'IndexPath'
ViewController.swift:113:72: Use of undeclared type 'IndexPath'
ViewController.swift:81:23: Value of type 'UITableView' has no member 'dequeueReusableCell'
ViewController.swift:144:66: Use of unresolved identifier 'IndexPath'
ViewController.swift:159:115: Type 'UIAlertControllerStyle' has no member 'alert'
AppDelegate.swift:17:98: Use of undeclared type 'UIApplicationLaunchOptionsKey'
Ditto Error Group
Command /usr/bin/ditto failed with exit code 1

Issue with reusable cells.

As we all know in iOS, cells are being reused. And so if I have enough cells to make the tableview scroll, the cells becomes the header and many issues occur. How can we fix this? This library is so-almost perfect. Anyone?

Is there a way to allow multiple lines in the Item cells?

I am using your code as the template for an About Page for an app I am developing. Great job on the UI, it really looks great and was exactly what I was looking for. I have the Header cells as the title of a topic and then I would like the Item cell to have the answer, which are multiple lines long. Right now it looks like I can only have two lines though, which isn't enough. Is it possible to allow three or four lines of text?

2 Tabs needed

On iOS 11.3 the table view needs two tabs to fire
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath

different design

Hi,
Thank your for your library. I have a problem i want to use 2 different design for items and subitems.
what can I do for this?

Thanks,
Vafa

not working properly when a header has 8 or more sub items

please check these edge cases

  1. problem of coloring sub items :

open and close "Title 2", then the sub items in "Title 3" get darken by "cell.backgroundColor = UIColor.lightGrayColor()"

        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 2"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 3"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 4"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 5"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 6"))

        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 2"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 2"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 3"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 4"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 5"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 6"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 7"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 8"))

        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 3"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 2"))

        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 4"))
        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 5"))
  1. problem of checking/unchecking items :

open "Title 3" and click "sub item 2", then open "Title 2" and click "sub item 8". both "Title 2 - sub item 8" and "Title 3 - sub item 2" are checked

        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 2"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 3"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 4"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 5"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 6"))

        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 2"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 2"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 3"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 4"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 5"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 6"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 7"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 8"))

        self.cells.append(SwiftyAccordionCells.HeaderItem(value: "Title 3"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 1"))
        self.cells.append(SwiftyAccordionCells.Item(value: "Sub Item 2"))

Show expanded headers and cells

Hi how can i present on first time expanded groups of cells.
I mean, show selected cells that the user has selected previously.
Best regards!!

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.