alexsmet / numberscrollanimatedview Goto Github PK
View Code? Open in Web Editor NEWAnimated number scrolling view for iOS
License: MIT License
Animated number scrolling view for iOS
License: MIT License
I have four animations views, because of spacing between numbers. But there are some resolution broken. Compared to your markdown screenshot, mine's looks blurred.
Don't you think so? But I do not know what is wrong. Here's the screenshot and code.
I use this library to get the total number of users from the server and animate them.
You can see that the resolution is lower when compared to plain text.
@IBOutlet weak var animatedView1: NumberScrollAnimatedView!
@IBOutlet weak var animatedView2: NumberScrollAnimatedView!
@IBOutlet weak var animatedView3: NumberScrollAnimatedView!
@IBOutlet weak var animatedView4: NumberScrollAnimatedView!
private func startAnimation(text: String) {
let animatedViews = [animatedView1, animatedView2, animatedView3, animatedView4]
for (idx, view) in animatedViews.enumerated() {
guard let view = view else { return }
view.backgroundColor = UIColor(red: 234, green: 126, blue: 106)
view.font = DesignSystemManager.getFont(name: .notoExtraBold, size: .header)
view.textColor = .white
view.layer.cornerRadius = 8
view.clipsToBounds = true
view.animationDuration = 3
view.scrollingDirectionRule = { (_, _) in return (idx % 2) == 0 ? .down : .up }
view.text = String(text[text.index(text.startIndex, offsetBy: idx)])
}
for view in animatedViews {
DispatchQueue.main.async {
view?.startAnimation()
}
}
}
ℹSharp resolution like plain text.
ℹThe screen where the numbers appear is slightly blurred.
Xcode version: 10.1
Swift version: 3
Platform(s) running Library: iOS - 9.3 ~ 12.0
**macOS version running Xcode: macOS - 10.14.1 **
++ Let me know if I have any missing information.
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.