IOS Coreplot scatterplot animation drawing - ios

I need to animate in ios a scatterplot to make it as the line was drawing. There is a similar effect in this website http://www.highcharts.com .I tried unsuccessfully with basic animation but impossible to make this effect.
Does anyone has any idea on how to do it ?

Unfortunately I've found CorePlot's animation capabilities in this area limiting.
However I have had success achieving the same effect by animating expanding the expansion of a regular UIView which encapsulates the graph.
I don't have my code in front of my at the moment by here is a diagram to highlight how I did it:
The key thing here is you start the initial Animation with a UIView which contains the Graph and who's frame is a smaller width than the graph. Then you animate the frame width to be the full graph size.
When this animates it progressively reveals your graph in a smooth animation.

Related

Is it possible to animate a change in a UIView's lineDash stroke with Core Graphics/Animation?

I have a UIView subclass that does some drawing, and at one point calls CGContextSetLineDash to set the dash and gap information on the line stroke.
Is it possible to do this with an animation? If so, how? I find Core Graphics very confusing and I'm admittedly just getting started out with it.

Animate a curve in response to UIScrollView velocity

I have a custom scroll view with a rectangle inside.
I would like to animate a curve along the top line of this rectangle so that it responds to scroll velocity. When done, it would look something like this:
video: http://capptivate.co/2015/02/01/skype-qik/
How would I accomplish this? Both high-level approaches and specific implementations are welcome, I'm not sure how to get started. (core animation? drawrect?)
This is nicely explained here http://holko.pl/2014/06/26/recreating-skypes-action-sheet-animation/
You can use a bezier path (either in a custom UIView w/ drawRect:, or easier with a CAShapeLayer), whose curvature can be controlled via its control points. So change the control points based on the scrollview's offset and you should have this effect.

How can I animate in the entrance of a CAEmitterCell?

Currently my particles appear on screen abruptly in their full shape and form. What I want is for the cells to either start at 0.0 opacity and animate up to full opacity, or start at 0.0 scale and animate up to 1.0 scale. I can't find anything online on how to do this.
You can animate the various properties of a CAEmitterCell, there is a good example at animating the CAEmitterCell Color property that should give you a good idea of what you should do to get the effect you want.
There are lots of great resources on CAEmitters, one good one is Tutorial: Particle Systems in Core Animation with CAEmitterLayer and another is Apple's Fireworks Sample Code

UISlider - draw line / image to the track (bar)

I have UISlider with min and max track colors. I want to draw vertical line (or image) in the middle of the slider track. This line must be there the whole time, only color on top of it will be different (min / max track color).
If I put UIImage on the Slider background, tracks covers it. If I set clear color for tracks, I can see line, but no colors from tracks (obviously). Is there any simple way, how to do this, or I have to override drawRect method for Slider ?
Something like on the slider in image
Note that the sort of "ultimate" solution to this type of project is...
http://www.paintcodeapp.com
As #BradAllred pointed out, the fundamental problem here is: you are trying to avoid drawRect.
Realistically, you can only achieve your goal here by subclassing UIControl or slider.
As others have mentioned fortunately there are many great tutorials, etc, on doing this -- and it's not hard.
Once again paintcodeapp.com is kind of an "incredible secret" to making iOS apps, enjoy.
add an UIView that is 1 pixel wide and has the height of the Slider and put it over the slider.
Create a CALayer, draw it, (even add an image to it), then add that layer as a sublayer to the Slider's layer.contents.

How can I reproduce a "box" transition animation in iOS?

I want to build an animated transition between two view controllers in iOS, resembling the "Box" transition in PowerPoint or the "Reflection" transition in Keynote.
You can see it here, at 2:10:
http://youtu.be/1fLQg5hFQQg?t=2m10s
What's the best way to do this?
Thanks!
That would be a complex animation to recreate. You'd need to use a CAAnimationGroup that grouped several different animations running at once. You'd want to animate a rotation around the y axis with the center of rotation lifted off the screen, on both the view controller that is animating away and the view that your are animating into place.
You would have to tweak the transform to make it draw with perspective (you add a small value to the .m34 record in the transform). That's because CA animations are orthographic by default (they don't show perspective.)
The reflections could be created using a special subclass of CALayer that lets you create duplicates of a layer. I'm blanking on the name of that layer subclass at the moment. You'd set up 1 duplicate with a scale of -1 on the y axis to flip it upside down, and a darkening effect. I've never done it myself, but I've seen several examples in books and online.

Resources