Animations etc..

I want to animate a Canvas so it smoothly slides from the bottom out into the view.

Not sure if the link below are the correct delegates because this seems to be for UIViews.
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html

Come to think of it: animating a view into another view would be useful too. :slight_smile:

Does Animation Kit not suit the need here? I use it to slide the progress bar in Answers into the view.

Does this apply to iOS?

As Dave asked: does this work with iOS ?

Oh I have no idea. I hadn’t noticed the category. :3

Animation Kit does not work with iOS and I currently have no plans to support it. I did sit down last week to update it to support iOS, but I would need to drop support for all previous Xojo versions. That is not something I am willing to do at this time.

Animation Kit will be updated when 2014r2 is old enough to be considered unreasonable to support.

[quote=155071:@Christoph De Vocht]I want to animate a Canvas so it smoothly slides from the bottom out into the view.

Not sure if the link below are the correct delegates because this seems to be for UIViews.
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html[/quote]

What do you mean by “smoothly slides from the bottom out into the view”. You mean “slide in” or “slide out” ?

In both cases, you have to approaches possible :

With a reasoned use of a timer or two, you can probably get what you want.

I prefer the real iOS animations no tricks. :slight_smile:

Tricks. Pfuhh.

You should have mentioned “No Xojo code, please” :confused: I would have not bothered.

[quote=155360:@Michel Bujardet]Tricks. Pfuhh.

You should have mentioned “No Xojo code, please” :confused: I would have not bothered.[/quote]

Michel, I always appreciate your help. No offence meant. :slight_smile:

But what I need is the default iOS animations. For example they provide smooth (on all devices) animations for Views and controls.
But yes, for now they can be accessed with declares only. unfortunately I am not a declare master. :slight_smile:

Hi Christoph,
I posted an in-between-version of UIView and iOSControls here recently. I will update an add a few bits, but many UIView animation methods have already been implemented.
And yes: It’s ok to use the UIView animations for a canvas – UIView is a superclass of most visible iOS controls.

[quote=155119:@Christoph De Vocht]Come to think of it: animating a view into another view would be useful too. :slight_smile:
[/quote]

Yes, there’s a transformFromView:toView method too but I have not succeeded in making it really work – currently the toView control just disappears :wink:

Oeps… missed that one. Will search for it here.

EDIT: couldn’t find your project for animating Views.

I’m currently unsure what version that is but try here:
https://dl.dropboxusercontent.com/u/21200221/Xojo/UIImageView.zip
or this: https://dl.dropboxusercontent.com/u/21200221/Xojo/iOSControls.xojo_binary_project.zip

(But I believe the latter does not have the animations yet – damn, so many uncompleted projects!)

Yes, it was the first link. I updated the project to the latest version. Take this link:
https://dl.dropboxusercontent.com/u/21200221/Xojo/UIImageView.xojo_binary_project.zip

Like so often, this is not complete and has no documentation yet, but you can animate a lot of properties already. Rest to follow soon. See this movie for some stacked animations:

https://dl.dropboxusercontent.com/u/21200221/Xojo/UIImageView%20animations.mov

For a quick start: The blue textfields for frame and bounds are x, y, w, h from top to bottom. Enter some different x & y frame values and hit “animate frame”. This will trigger a one-time frame animation to the new coordinates, shortly showing an “animation finished” message when the appropriate event fires.
If you opted for repeat, the move will play endlessly (or until you tap on “Reset Frame & Bounds”), and with AutoReverse on exactly that will happen. When spring animation is on, an elastic bouncing effect will be used, taking into account damping ratio & initial velocity. Animation time and an initial delay can be set on top.
You can independently animate bounds, Backgroundcolor and Rotation too, all with different settings for duration, movement & the like.
The segmented control at the bottom lets you chose some animation behaviors for each animation too.
The buttons on the right side are for setting the values without animation. A “Set Rotation” button is currently missing.
Please note I do not check for correct entries, so leaving a number field empty will make the demo crash.

Thank you Ulrich. This is exactly what I was looking for.

Now we only need the same for Views. So for example you can slide a view into another view. :slight_smile:

Glad to hear that, Christoph! I am currently adding the missing animation methods and some textfields for examining the CGAffineTransformation matrix and will try to add the transitionfrom/toView methods next week.

And I am fusing both projects so the basic NSObject/UIView properties and methods are accessible from within every Xojo control inheriting from iOSControl (avoiding to add them again and again to each class this way – encapsulated controls make sense in the multiplatform arena but I think we are better off with some base extensions in iOS). I’ll add a post once I made some progress.

A bit further – see the movie link above (I replaced the file).
The current project is here: https://dl.dropboxusercontent.com/u/21200221/Xojo/UIImageView%20With%20iOSControlExtension.xojo_binary_project.zip.

Now I’m waiting for the first UIImageView based space shooter :wink:

EDIT: The Transformation values in the grey fields are read-only and currently only set by rotation. There’s a few more CGAffineTranformations waiting to be added. The transformation matrix is much too math for me, but maybe someone with a better grasp for numbers gains some insight from it …

Edit II: In the cases some class is not a subclass of iOSControl you can use the extension methods too. If you want to know what class a Xojo iOSView is for example, you can find out by

dim myclass as text = iOSControlExtension.description (view1.Handle) (String works too).

[quote=155677:@Ulrich Bogun]A bit further – see the movie link above (I replaced the file).
The current project is here: https://dl.dropboxusercontent.com/u/21200221/Xojo/UIImageView%20With%20iOSControlExtension.xojo_binary_project.zip.

Now I’m waiting for the first UIImageView based space shooter :wink:

EDIT: The Transformation values in the grey fields are read-only and currently only set by rotation. There’s a few more CGAffineTranformations waiting to be added. The transformation matrix is much too math for me, but maybe someone with a better grasp for numbers gains some insight from it …

Edit II: In the cases some class is not a subclass of iOSControl you can use the extension methods too. If you want to know what class a Xojo iOSView is for example, you can find out by

dim myclass as text = iOSControlExtension.description (view1.Handle) (String works too).[/quote]

Thank you Urlich. That is great ! Best run on iPad :slight_smile: