klevison / accordiontableviewcontroller Goto Github PK
View Code? Open in Web Editor NEWSwift version of https://github.com/klevison/KMAccordionTableViewController
License: MIT License
Swift version of https://github.com/klevison/KMAccordionTableViewController
License: MIT License
Could you give me the equivalent code to install it in Objective C?
Hi, nice work by the way...
After much messing about I was hoping to remotely call an event to change the open section of the accordion - but can't figure it out for whatever reason. No doubt it is something really simple... Given you wrote it - is there any chance you could give me a clue or point me in the right direction to achieve this please? I have the triggering event setup and tested, just can't get it to fire and change the cell.
Thanks in advance if you are able to find a moment to help me out with this.
Cheers,
Stewart.
I just want to allow an item to expand
Hello there,
I got application crash every time when I try to close the previous section and open a new section.
Crash happened at line tableview.endupdate() in below code ,
fileprivate func sectionHeaderViewOpenedAtIndex(_ index: Int) {
let section = sections[index]
section.open = true
var indexPathsToInsert = [IndexPath]()
var indexPathsToDelete = [IndexPath]()
indexPathsToInsert.append(IndexPath(row: 0, section: index))
if openedSectionIndex != NSNotFound {
let previousOpenSection = sections[openedSectionIndex]
let praviousSectionHeaderView = tableView.headerView(forSection: openedSectionIndex) as! SectionHeaderView
praviousSectionHeaderView.disclosureButton.isSelected = false
previousOpenSection.open = false
indexPathsToDelete.append(IndexPath(row: 0, section: openedSectionIndex))
delegate?.accordionTableViewControllerSectionDidClose(previousOpenSection)
}
tableView.beginUpdates()
tableView.insertRows(at: indexPathsToInsert, with: openAnimation)
tableView.deleteRows(at: indexPathsToDelete, with: closeAnimation)
tableView.endUpdates()
let sectionRect = tableView.rect(forSection: index)
tableView.scrollRectToVisible(sectionRect, animated: true)
openedSectionIndex = index
delegate?.accordionTableViewControllerSectionDidOpen(section)
}
error : Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete row 0 from section 1 which only contains 0 rows before the update'
Please let me know if there is any update in the library or if I miss something in above logic.
Any help will be appreciated :)
My PodFile is the following.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
pod 'ObjectMapper', :git => 'https://github.com/Hearst-DD/ObjectMapper.git', :branch => 'swift-2.0'
pod 'SlideMenuControllerSwift'
pod 'AccordionTableViewController'
When I pod install I get Unable to find a specification for AccordionTableViewController
I tried platform: '9.0' but still the same.
Maybe the use_frameworks flag?
Hello there,
I want to reload all section data because everytime i expand the section, it'll call network and put the response from network into button title.
In my viewdidload
, i call a func called reloadAllData()
and in my func reloadAllData()
there's some code like this
func reloadAllData() {
if dataProducts.isEmpty == true {
self.requestSpinnerData()
} else {
oneSectionAlwaysOpen = false
sections = allSetions()
delegate = self
openAnimation = .fade
closeAnimation = .fade
}
}
When i segue into this view, it'll go to self.requestSpinnerData()
because i'll use the data that i get from requestSpinnerData()
for the section.title
. and then it'll call reloadAllData()
again for executing code inside else
And what i get is empty (there's no section inside my viewcontroller"
How i can reload all section after i call another function?
Thankyou
Hi! Amazing Work!
Is any option to use this framework with xibs? I'm not using SB.
Thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.