augustrush / stellar Goto Github PK
View Code? Open in Web Editor NEWA fantastic Physical animation library for swift
License: MIT License
A fantastic Physical animation library for swift
License: MIT License
�
@interface CALayer (SWIFT_EXTENSION(Stellar))
@EnD
@interface UIColor (SWIFT_EXTENSION(Stellar))
@interface UIDynamicBehavior (SWIFT_EXTENSION(Stellar))
@EnD
@Class UIView;
@interface UILabel (SWIFT_EXTENSION(Stellar))
@interface UITextView (SWIFT_EXTENSION(Stellar))
@interface UIView (SWIFT_EXTENSION(Stellar))
@interface UIView (SWIFT_EXTENSION(Stellar))
Hi,
Interesting library!
Latest release here is 0.66, while on pods you can only find 0.61. Any reason to keep it that way? Could you update it there too? So we don't need to point this specific branch.
Thank you,
H.
Would be amazing if this could be installed using CocoaPods :)
For months now I have problem using Stellar with Carthage. I have to ways to solve the problems: 1/ by "manually" building Stellar framework after changing stuff in Xcode project or 2/ by adding sources to my project. But as for now the last option does not work because the code imported using Carthage is not the last one on GitHub...
So there is definitely something wrong with Carthage.
Hello, I would like to collaborate with the Spanish translation, is it done?
Unless the library works differently it is ususally expected that a scale of 1 always return the identity matrix scalling column back.
However here with Stellar (and thanks for you great work btw), this not the case.
A simple exemple with
myView.scaleXY(0.9,0.9).animate()
// later on:
myView.scaleXY(1.0,1.0).animate()
shows that the scaling factor of 1.0 leave the scale of the view unchanged.
And changing the second call to myView.scaleXY(1.1,1.1).animate()
doesn't return the view to its original scale either (that, I have trouble understanding).
If you have any question regarding this, let me know :)
With 0.66
this exception is thrown on very basic animation:
myView.makeAlpha(0.0)
.duration(aDuration)
.autoreverses()
.repeatCount(someRepetitions)
.completion {
// Some statements
myView.removeFromSuperview()
}
.animate()
Let's say it's a find of flash.
I tried other animation like makeSize
or makeColor
but same behavior.
This flash portion of code is called several times on a sequence basis. On the first call everything is fine. The exception is raises on the second call.
Between these two calls of flash there is an animation using CATransaction
. On the completion block of this animation the second call of flash is then made.
CATransaction.begin()
CATransaction.setCompletionBlock({
// call to flash animations
})
...
CATransaction.commit()
This error came after I decided to use CATransaction
to use it's completion block.
What are your thought about this?
Oftentimes I need to also animate affine scale. However this one is not supported by stellar. I wrote the following set of extensions to make it uniform with Stellar's syntax.
What are your thoughts? Do you see any systemic issue?
`struct CABasicAnimatedView {
let view: UIView
let animation: CABasicAnimation
}
extension UIView {
func makeAffineUniformScale(from from: CGFloat, to: CGFloat) -> CABasicAnimatedView {
let animation = CABasicAnimation(keyPath: KeyPaths.Transform.scale)
let animatedView = CABasicAnimatedView(view: self, animation: animation)
animatedView.animation.fromValue = from
animatedView.animation.toValue = to
return animatedView
}
}
extension CABasicAnimatedView {
func duration(duration: NSTimeInterval) -> CABasicAnimatedView {
self.animation.duration = duration
return self
}
func timingFunction(timingFunction: CAMediaTimingFunction) -> CABasicAnimatedView {
self.animation.timingFunction = timingFunction
return self
}
func animate() {
CATransaction.begin()
self.view.layer.addAnimation(self.animation, forKey: nil)
CATransaction.commit()
self.view.transform = CGAffineTransformMakeUniformScale(self.animation.toValue as! CGFloat) }
}
func CGAffineTransformMakeUniformScale(scale: CGFloat) -> CGAffineTransform {
return CGAffineTransformMakeScale(scale, scale)
}`
I want to use Stellar with my project but I have this Value of type 'UIView' has no member
error in my very first attempt to use Stellar on an UIView.
I use Carthage to install Stellar the same way as other libraries. It's like Stellar is not "installed". Installation using Stellar 0.65 is OK, and the usual Carthage installation has been followed.
Then, I used the direct inclusion of Sources
directory and everything is fine.
I have clean project. This is a weird behavior... Any idea? Is there special configuration for Carthage command?
不知不觉又新推出一开源项目
I want to design an animation by chaining several animations in a programmatically way.
I tried the following without success:
aView = aView.moveX(5.0).duration(2.0).completion({ do_something() }).then()
...
aView = aView.moveX(7.0).duration(1.0).completion({ do_something() }).then()
aView.animate()
How to achieve this?
Updated via cocoapods and makeAlpha calls fail with
fatal error: Should not be excute forever!
Hi,
I am using the library with solid success. However I am a bit stressed by the stale development lately. What are your plans honestly?
Still awesome animation library. Loving it the more I use it.
Feature request. Would be nice if I could call cancelAllAnimations() on a UIView. and it'll stop all ongoing and planned animations.
Hello,
As is, the examples do not support Xcode 9. Can they be updated to support Xcode 9 and at least Swift 3?
Hi,
Seems that makeAlpha is not working, or maybe I'm doing something wrong.
Can you add an example of how to use it on the demo view controllers?
Thanks
just run any example from demo and click multiple times - animation breaks
How i can simulate infinity repeat count?
repeatCount(Int.max)?
I love Stellar. Animations with Swift like they should be. Thanks.
but...
Swift 3 branch seems to throw compile errors. Any plans on fixing this? Swift 3 officially out today.
thanks.
Hi,
For iOS and macOS 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.
Using makeAlpha
of 0.66
generates the Unsupport this animation type!
(btw, Unsupport is not word ... Do not support this animation type!
is better)
Reverting back to 0.65 fixed the issue by using the following in the Podfile
pod 'Stellar', :git => 'https://github.com/AugustRush/Stellar', :commit => '5249167900b1eb136ce71543af7817a9fa5535cb'
There are a lot of errors on Swift 4 using Xcode 9 beta 4...
I've noticed there's a podspec
file available but some for strange reason I can't find the repo on CocoaPods.
pod 'Stellar'
Returns a Unable to find a specification for Stellar
error.
Although downloading straight from the source works.
pod 'Stellar', :git=>'https://github.com/AugustRush/Stellar.git'
Hi, I have just got an issue when I try to animate the appearance of a view by extending its width from 0 to full width, from left to right.
view.makeFrame(CGRect(origin: origin, size: CGSize(width: 0, height: view.bounds.height))).makeAlpha(1).duration(0).then()
.makeFrame(CGRect(origin: origin, size: CGSize(width: width, height: view.bounds.height))).duration(1).animate()
The view is expected to extend from the origin of the view.
| |
|----->-------------->-----------------------------
| |
| |
| |
(view left border) (view right border)
However, it did extend from the center of the view.
| |
| ---->------------->---------------------------
| |
| |
| |
In the storyboard, autolayout of this view is set as having 0 padding to the left border of the container.
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.