stuffrabbit / swiftspreadsheet Goto Github PK
View Code? Open in Web Editor NEWSpreadsheet CollectionViewLayout in Swift. Fully customizable. ๐ถ
License: MIT License
Spreadsheet CollectionViewLayout in Swift. Fully customizable. ๐ถ
License: MIT License
Hello, great work on the library and the fact that it relies on native UICollectionView
system is great.
I'm trying to create "grouped headers" that can span over muliple columns like in the screenshot below. How would you approach it?
I was thinking about adding a large section header but the width of headers column is tied to the width of row's columns.
if numberofrows in section are different it crashes.
thanks for the awesome library!!
I can just create another nib file but I was wondering how to change label text on the fly..
Things I've tried..
//First I registered decorationview as SupplementaryView
self.collectionView.register(topRightDecorationViewNib, forSupplementaryViewOfKind: SpreadsheetLayout.ViewKindType.decorationTopRight.rawValue, withReuseIdentifier: self.defaultSupplementaryViewIdentifier)
//Lastly I tried to access it under ViewKind
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
guard let viewKind = SpreadsheetLayout.ViewKindType(rawValue: kind) else { fatalError("View Kind not available for string: \(kind)") }
let supplementaryView = collectionView.dequeueReusableSupplementaryView(ofKind: viewKind.rawValue, withReuseIdentifier: self.defaultSupplementaryViewIdentifier, for: indexPath) as! SpreadsheetCollectionReusableView
supplementaryView.headerDelegate = self
switch viewKind {
case .leftRowHeadline:
if indexPath.section >= 0 && indexPath.section < self.LastPaymentReceiptArray.count {
supplementaryView.infoLabel.text = self.LastPaymentReceiptArray[indexPath.section].partynm
}
case .rightRowHeadline:
supplementaryView.adjustmentButton.tag = indexPath.section
case .topColumnHeader:
supplementaryView.infoLabel.text = self.topHeaderLabels[indexPath.item]
case .decorationTopRight:
//Here I try to mutate the label
supplementaryView.infoLabel.text = "View Adjustment"
default:
break
}
return supplementaryView
}
Hi,
Interesting component ๐
For iOS projets it's will be great to make your component Carthage compatible
Take a look at these articles:
On your README.md
add on top and add section for the installation with Carthage.
Can we have a built-in sorting for columns in near future?
I'm pretty sure this is a dumb question, but is there a way to update/set the label into a decorative view programmatically ?
I didn't find any example about it in the project and I don't understand how I may access to the label in order to change "Revenue" by something else
Thanks in advance
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.