andrewroycarter / timescroller Goto Github PK
View Code? Open in Web Editor NEWA UI Element that hovers beside the scroll bar of a UITableView (Mimicking the Path app).
License: MIT License
A UI Element that hovers beside the scroll bar of a UITableView (Mimicking the Path app).
License: MIT License
In many navigation based apps I've tested TimeScroller, if you push a new ViewController onto the navigation stack, and then navigate back to the ViewController TimeScroller will do what you see in the screenshot below, if I reinitialize the ViewController with TimeScroller in it it behaves correctly again (which is obvious since the VC is being reinitialized).
Screenshot: http://cl.ly/image/1X1A0q472D0m
I'm not sure if I'm just doing something wrong or not but I literally used the sample code verbatim.
this timerscroller does not work with my private navigationController(it provide some function like path2, so we can move the center view to left, right.....some function like the viewDesk project in GITHUB), sometimes there are many (about 10+) timescroller in the tableview....... this really draw me crazy.....
but when I comment below line, everything works fine.... but i don't know why......
[_tableView.superview addSubview:self]; in
(void)scrollViewDidEndDecelerating {
CGRect newFrame = [_scrollBar convertRect:self.frame toView:_tableView.superview];
self.frame = newFrame;
// Justin, remove this line, the everything works fine with the PathNavigationController
//[_tableView.superview addSubview:self];
[UIView animateWithDuration:0.3f delay:1.0f options:UIViewAnimationOptionBeginFromCurrentState animations:^{
self.alpha = 0.0f;
self.transform = CGAffineTransformMakeTranslation(10.0f, 0.0f);
} completion:^(BOOL finished) {
}];
}
everything works perfect, why we need this line of code? below method also add self to the _scrollBar
(void)scrollViewWillBeginDragging {
CGRect selfFrame = self.frame;
CGRect scrollBarFrame = _scrollBar.frame;
self.frame = CGRectMake(CGRectGetWidth(selfFrame) * -1.0f,
(CGRectGetHeight(scrollBarFrame) / 2.0f) - (CGRectGetHeight(selfFrame) / 2.0f),
CGRectGetWidth(selfFrame),
CGRectGetHeight(selfFrame));
[_scrollBar addSubview:self];
[UIView animateWithDuration:0.2f delay:0.0f options:UIViewAnimationOptionBeginFromCurrentState animations:^{
self.alpha = 1.0f;
self.transform = CGAffineTransformIdentity;
} completion:^(BOOL finished) {
}];
}
The method "- (void)captureTableViewAndScrollBar" returns no Scrollbar in iOS 7. Therefore this component is not working on iOS 7.
Wonderful control to have. Thanks for your effort Andrew.
I noticed some times the clock handle and time label don't sync. Just scrolling and up and down. Since it is just a random date values, I can't be sure whether the clock or the label is wrong.
Will do few more test and update you soon.
Check the screenshot - http://minus.com/m1s4eYbhx
Love this TimeScroller, thanks for making it available!
I was looking a an issue with _lastDate being null in -updateDisplayWithCell: which throws an error; I see that was resolved 10/29/12:
Using CocoaPods, it has the current version of 1.2; I see a tag in the repo for 1.3, but this fix is after that 1.3 tag. Any chance for a most current release to include these fixes?
Thanks!
Thom
if the numbers of rows in the tableview is too small the timeScroller didn't appear in the correct frame,to test it just change the numbersofRows to 2 for example,how can i fix that please??
is this project maintained?
The time scroller is not seen in iPhone plus size devices and iPhone X.
It seems something broken with frames.
The scroller clock is seen in phones with size below 6 plus but not in plus size devices.
Hey!
The TimeScroller is behaving very weird on iOS 8.1. Both on the iOS 8.1 simulators and on my iPad Mini running iOS 8.1.
It's not showing at all. Except when I scroll to the top of the screen, it pops up on the bottom of the screen and goes away immediately.
When I run my app in the iOS 7.1 simulator everything works fine.
I think this problem did not occur on iOS 8.0.*, but I'm not 100% sure and I can't test that right now.
I hope this is fixable! Good luck ;)
Kind regards,
Maarten
Hi.
I was having problems using TimeScroller with a tableview with few rows, that depending of device orientation may or may not fill all the tableview.
I've done some quick modification to fix this problem that may be useful to others...
I'm new to git hub, don't know if there's a better way to link the code so here two dropbox links:
https://www.dropbox.com/s/d6l9wmmq9afiohf/TimeScroller.h
https://www.dropbox.com/s/00ls8ll91ijm5qd/TimeScroller.m
This will cover the rotation problem, while for the row number changes i'm now just recreating the timeScroller every (rare) tableview reloadData.
I’ve recently added TimeScroller to the CocoaPods package manager repo.
CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.
However, TimeScroller doesn't have version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.
Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.
I have setup all the things needed.
there is a problem with hitTest withEvent..
which is returning a tableview instead of UITableviewCellContentView..
Please help me with this
Hi there, first of all, thanks very much for this wonderfull looking component.
My problem is when i add new data to my tableview, timescroller prevents tableview to scroll to bottom and keeps the tableview on the last row of the tableviews previous size. Here are the steps to produce:
1- Create a tableview with 20 rows, or else.
2- Add a line of code to add "20 more lines" when the user reaches to the last cell.
3- Scrollview is on the bottom of the screen (20th cell) and prevents tableview to scroll down further.
Hi, Thanks so much for this wonderful TimeScroller! I simply love it :-) !
Am using iOS 5 and Xcode 4.2. Am writing a simple app that has a simple layout : a text box and a button at the top half of the screen, and a TableView at the bottom half. As the user keeps entering the text, it keeps getting added to the table. The timer is appearing as I scroll, and the date/time is also being displayed correctly, but the hands in the clock aren't moving. Can you please help?
In the ViewController.h
@interface com_FirstViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, TimeScrollerDelegate> {
...
...
TimeScroller * _timeScroller;
....
}
...
@Property (nonatomic, retain) TimeScroller * _timeScroller;
....
In ViewController.m:
....
....
....
....
(void)viewDidLoad {
[super viewDidLoad];
_timeScroller = [[TimeScroller alloc] initWithDelegate:self];
....
....
}
....
....
....
(UITableView *)tableViewForTimeScroller: (TimeScroller *)timeScroller {
NSLog(@"tableViewForTimeScroller : returned UITableView");
return table;
}
//The date for a given cell
(NSDate *)dateForCell:(UITableViewCell *)cell {
NSIndexPath *indexPath = [table indexPathForCell:cell];
int timeInt = [[[arrayInput objectAtIndex:[indexPath row]] objectForKey:@"time"] intValue];
NSDate *time = [Utility getIntAsDate:timeInt];
NSLog(@"returned time for scroller: %@", time);
return time;
}
(void)scrollViewDidScroll:(UIScrollView *)scrollView {
NSLog(@"scrollViewDidScroll");
[_timeScroller scrollViewDidScroll];
}
(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
NSLog(@"scrollViewDidEndDecelerating");
[_timeScroller scrollViewDidEndDecelerating];
}
(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
NSLog(@"scrollViewWillBeginDragging");
[_timeScroller scrollViewWillBeginDragging];
}
(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
NSLog(@"scrollViewDidEndDragging");
if (!decelerate) {
[_timeScroller scrollViewDidEndDecelerating];
}
}
Hello there any idea how to add this control to a uiscrollview instead of a uitableview?
Hi,
is there an alternative for non ios5?
The control is really cool!
Xcode: 4.3.2
IOS SDK: ISO5.1
if the row cout is too less to fill one page of the uitableView, and the scroll indicator is not shown, the timer scroller does not work as expected. It seems that this project relies on the scroll indicator, I am not sure if this is a limitation or we can fix it...
You can simply modify this demo project and change " i >= -15" to make sure the row number is less than 10, and reproduce this issue. e.g, today is 04.27, you can change it to "i>=20".....
for (int i = todayComponents.day; i >= -15; i--) {
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[dictionary setObject:@"Title here" forKey:@"title"];
components.year = todayComponents.year;
components.month = todayComponents.month;
components.day = i;
components.hour = arc4random() % 23;
components.minute = arc4random() % 59;
NSDate *date = [calendar dateFromComponents:components];
[dictionary setObject:date forKey:@"date"];
[_datasource addObject:dictionary];
}
It would be very welcome if someone could post an ARC-compliant code example of TimeScroller. I can't figure out how to get it working. Thanks!
After making the project arc compatible I have the following problem in this line:
UIView *view = [_tableView hitTest:point withEvent:UIEventTypeTouches];
The problem: I get a compiler error saying:
implicit conversion of int to uievent* is disallowed with arc
Do you know a solution or a workaround for the problem?
In a few non-English localizations time length is much longer than US but the length of TimeScroller is fixed now, so in other localization text goes out of black field.
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.