dataxpress / uicountinglabel Goto Github PK
View Code? Open in Web Editor NEWAdds animated counting support to UILabel.
License: MIT License
Adds animated counting support to UILabel.
License: MIT License
I didn't get how to use with NSNumberFormatterCurrencyStyle, is it possible? how?
leadsCountingLabel.method = UILabelCountingMethodEaseIn --- (Error: Use of unresolved identifier 'UILabelCountingMethodEaseIn'; did you mean 'UILabelCountingMethod'?)
I was hoping for an odometer effect like this
http://github.hubspot.com/odometer/api/themes/
it seems like using kCATransitionFromBottom
this should be possible.
// Add transition (must be called after myLabel has been displayed)
CATransition *animation = [CATransition animation];
animation.duration = .3;
animation.type = kCATransitionFromBottom;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[_instructions.layer addAnimation:animation forKey:@"changeTextTransition"];
// Change the text
_instructions.text = @"127";
Label added to scrollView and it's no animation while I'm scrolling.
Hi,
Does it work with UIButton label, without subclassing ?
thx.
How can we add a comma, like "100,000,000"? Right now I can only get it to do "100000000".
你好能不能暴露一个 stop 的方法,计数到一半想要停止,然后立刻改成其他的值
The pod file does not find the newest version of it
[!] Unable to satisfy the following requirements:
- `UICountingLabel (~> 1.4.1)` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `UICountingLabel (~> 1.4.1)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
First of all, great library :)
The only thing I'd ask for is support for numbers (ie. NSDecimalNumber) with a higher value than the float max.
All I want to do is count from a value like 0 to 38. I don't want to display any decimal points or numbers after a decimal point. Just want a simple number like "38" or "500".
Is anyone successfully doing this? If I set my format to @"%d"
, the label counts up weird and stops at the wrong value. I have tried hacking around in the repo and using formatted strings but nothing seems to work.
Is anyone successfully doing this, or does anyone know how it can be done?
Thanks for the help!
add support for the format block to give an NSAttributedString and set the label's AttributedText with that
I run pod update UICountingLabel and it does not update the pod to version 1.4.0
Please add cocoapod file
Thank you
If it's a number over 1,000 it would be nice to add a thousands separator based on locale. Not a must have but just noticed it. Great Library BTW. Thanks for the hard work!
I second that emotion. Going to give you credit in our app definitely.
Would be nice to be able to specify a fixed number of characters so it would automatically pad with leading zeros.
Hi
This is a very useful pod. I wasn't able to figure out how to initialize the counter to something other than 0. Right now my viewDidLoad has
[self.myLabel countFrom:123 to:123 withDuration:0.0f ];
as an example to initialize to 123.
The currentValue property doesn't have associated get/set options.
(I could also be making a silly mistake, I'm somewhat new to iOS and objective C)
Hi, I really appreciate that you have this as open source, What is the License on this?
make 1.1 a thing, update the podfile to reference the latest commit, start a running changelog, use github releases to tag releases
I have run into an issue with using UICountingLabel. It is causing an BSXPCMessage error. Any ideas?
BSXPCMessage received error for message: Connection interrupted
when (main)view is scrolling, the counter freeze until finger locate at screen
p.s. sorry for my russian english)
I just updated to this latest build and when I call the [self.barChart strokeChart];
it gives EXE_BAD_EXEC error in below line:
PNBarChart.m file
- (void)strokeChart
{
[self viewCleanupForCollection:_labels];
......
//Add y labels
float yLabelSectionHeight = (self.frame.size.height - _chartMargin * 2 - xLabelHeight) / _yLabelSum;
for (int index = 0; index < _yLabelSum; index++) {
// This line causes the EXE_BAD_ACCESS
NSString *labelText = _yLabelFormatter((float)_yValueMax * ( (_yLabelSum - index) / (float)_yLabelSum )); // CAUSES ERROR EXE_BAD_ACCESS
Any ideas?
After importing UICountingLabel
into a Swift project, setting format
works as expected:
myLabel.format = "$%d asdf" // This works
I then attempt to set formatBlock
:
totalDebtLabel.formatBlock = {(debtValue) -> String in
let returnString = "$\(debtValue) asdf"
return returnString
}
I expect this to work similarly, but instead I get an EXC_BAD_ACCESS
crash:
* thread #1: tid = 0x123f44, 0x01f500be libobjc.A.dylib`objc_msgSend + 26, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x22281)
frame #0: 0x01f500be libobjc.A.dylib`objc_msgSend + 26
frame #1: 0x01f50eb1 libobjc.A.dylib`objc_release + 65
* frame #2: 0x000edc05 ExampleApp`reabstraction thunk helper from @callee_owned (@unowned Swift.Float) -> (@owned Swift.ImplicitlyUnwrappedOptional<Swift.String>) to @callee_unowned @objc_block (@unowned Swift.Float) -> (@autoreleased Swift.ImplicitlyUnwrappedOptional<ObjectiveC.NSString>) + 229 at ViewController.swift:31
frame #3: 0x00122dfc ExampleApp`-[UICountingLabel setTextValue:](self=0x7a099390, _cmd=0x00129f4e, value=20.8544655) + 348 at UICountingLabel.m:204
frame #4: 0x00122bfd ExampleApp`-[UICountingLabel updateValue:](self=0x7a099390, _cmd=0x00129fe9, timer=0x79ece300) + 621 at UICountingLabel.m:190
frame #5: 0x00957819 Foundation`__NSFireTimer + 97
frame #6: 0x002990b6 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
frame #7: 0x00298a3d CoreFoundation`__CFRunLoopDoTimer + 1309
frame #8: 0x00257e6a CoreFoundation`__CFRunLoopRun + 2090
frame #9: 0x0025737b CoreFoundation`CFRunLoopRunSpecific + 443
frame #10: 0x002571ab CoreFoundation`CFRunLoopRunInMode + 123
frame #11: 0x04f382c1 GraphicsServices`GSEventRunModal + 192
frame #12: 0x04f380fe GraphicsServices`GSEventRun + 104
frame #13: 0x00d6c0c6 UIKit`UIApplicationMain + 1526
frame #14: 0x000f02ee ExampleApp`top_level_code + 78 at AppDelegate.swift:12
frame #15: 0x000f032b ExampleApp`main + 43 at AppDelegate.swift:0
frame #16: 0x026aaac9 libdyld.dylib`start + 1
I attempted to debug the problem using image lookup --address
and the Zombie profiler, but didn't find anything interesting.
I am just beginner so i couldn't figure out how to implement to my project.
I love UICountingLabel and would really like to use it with attributed strings. Is the code for UICountingLabelAttributedFormatBlock stable enough to update podspec?
Great extension!
Is it possible to get UICountingLabel to work with a comma instead of a period as a decimal point? Eg 1,3 instead of 1.3.
Have tried format = @"%,1f";
is there support for delegates or blocks or other way to know when the count is finished ?
Instead of having a separate NSString* format
, only expose the formatBlock property, and make a setFormat: method that sets up the right format block only at set time instead of on every iteration.
This will ultimately improve performance, as a single block call each time is much faster than regular expression searches every frame.
So, it would look something like:
-(void)setFormat:(NSString*)format
{
self.formatBlock = ^(NSString*) ^(float val) {
return [NSString stringWithFormat:format,val];
};
}
Note - something will have to deal with formats that pass in %d
or %i
(as the current regex does) - perhaps find these and then cast to int if it has those? maybe two different blocks? just ideas
Anyone know how to keep the number not shaking when it in counting? Thanks!
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.