Comments (4)
Just as a data point, I set my first date and last date to a year before and year after the current date, respectively.
from objc-timessquare.
Indeed, this is a serious performance issue, and the time required to display the calendar is proportional to the number of months displayed, since every cell must be created before anything is displayed.
I fixed this problem by adding a +rowHeight class method to TSQCalendarCell, which is overridden in subclasses. Then I changed TSQCalendarView's -tableView:heightForRowAtIndexPath: method to ask the cell's class for the rowHeight, instead of instantiating a cell instance:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
{
return [[self cellClassForRowAtIndexPath: indexPath] cellHeight];
}
- (Class) cellClassForRowAtIndexPath:(NSIndexPath *)indexPath;
{
if (indexPath.row == 0 && !self.pinsHeaderToTop) {
return [self headerCellClass];
} else {
return [self rowCellClass];
}
}
After making these changes, performance has improved significantly, and the time to display the calendar is constant, no matter how many months are displayed, since now only the visible cells are created.
from objc-timessquare.
any chance this will get merged into master?
from objc-timessquare.
Thanks again for filing this. More words on performance: http://corner.squareup.com/2013/03/times-square-2.html
from objc-timessquare.
Related Issues (20)
- rendering issue with TSQTACalednarRowCell HOT 2
- Any way to change swipe length? HOT 1
- Can't Archive HOT 2
- Won't run HOT 2
- Mark Day
- UITextAlignmentCenter is deprecated
- NSDateComponents.week is deprecated
- Question]Drawing in a cell
- iOS 8 update HOT 1
- Disable some dates
- Monday as first day of week HOT 1
- Calendar not rendered HOT 1
- I want to select multiple dates like "TimesSquare for Android" can your help me HOT 1
- how to close TimesSquare? HOT 1
- Change start day HOT 5
- how to displayOnly
- Highlight multiple dates HOT 2
- One month frame size
- No access to tableView in Swift
- I can't run this app.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objc-timessquare.