Animations etc..

That’s good to know, thank you, Michel!

Addendum: Updated the project – just a few minor corrections and added documentation on the features that should be safe. There’s more included but some are work in progress and unsafe yet.

You mean something like this?
https://dl.dropboxusercontent.com/u/21200221/Xojo/Partial%20Curl.mov

Just a handful of declares yet, but the other classes (and documentation!) have been extended too.
You find the call under TestButton.Action in View1.

https://dl.dropboxusercontent.com/u/21200221/Xojo/UIImageView%20With%20iOSControlExtension.xojo_binary_project.zip

Hi Ulrich,

It’s a great job. :slight_smile:

This offers lots of possibilities with the views.

But I have a problem with this code, When I put this in TestButton.Action in View 1.

dim v2 as new View2
v2.ModalPresentationStyle=iOSViewExtension.PresentationStyle.FormSheet
self.AnimateTo v2

Animation works perfectly, but how to close View2 and return to View1

If I call this in View2 in action button :
self.close,

nothing happens.

If I call this in View2 in action button :
dim v1 as new View1
v1.ModalTransitionStyle = iOSViewExtension.TransitionStyle.CrossDissolve
self.AnimateTo v1

This create a new view of View1 and lost the state of the previous view1.

Thanks for your help :slight_smile:

Franck.

Sorry, Franck – I was too fast with publishing. Currently it’s a modal call which has to be released of course. I will add that method and update the project later today.

EDIT: Please reload the project, Franck. I replaced AnimateTo by AnimateModalTo to make clear it is a modal call and added a DismissModal (Animated as Boolean) method you can call on the second view to return to the first.
Of course, there’s tons of methods missing – will try to add a few the next days until … tada (!) … I go on a week of vacation. The first after 4 1/2 years and I swear I leave the Mac at home.

EDIT II: And I will have to build an iOSView subclass anyhow to enable completion handler events. So take it only as a first impression please, its handling will be subject to change.

Ulrich, thank you for everything you do. :slight_smile:

Another Question :
Is it possible to change the placement of modal view (view2).

dim v2 as new View2 v2.ModalPresentationStyle=iOSViewExtension.PresentationStyle.PageSheet

The Pagesheet presentation is great. :slight_smile: But I want the window does not go back to the top of the screen, only in the middle

Is there a solution ?

Thanks a lot !

Franck

I don’t know yet, Franck. I threw first glimpses into UIView yesterday and have not even tried the presentationstyle values, not to speak of all the other features of this class. I am currently totally ignorant of most of them. Think I’ll add a transition view to the demo next so it’s easier to try.

Did you think of something like this, Franck?

It’s in the updated project, same link. It was before, it is the presentation style property.

For a completely custom presentation, you would need a custom delegate. I‘ll save that for some time later.
Partial curl together with Formsheet or PageSheet will crash. It’s not my fault, Apple says

EDIT: If you should have any clue how to make the popup presentation style appear please let me know. I experimented with preferredcontentsize but the new view always shows up in full screen mode no matter if I view it horizontally or vertically.

Not exactly !
I would like this :slight_smile:

Another solution is to set the background view2 to transparent with alpha, and put a tinted canvas.

But if I put this code in open event of view 2.

declare sub alpha_ lib UIKitLib selector "setAlpha:" (obj_id as ptr, alpha as Double) alpha_(self.Handle, 0.5)

The iOS app crash.

Your image doesn’t show up for me.

It’s no wonder setalpha crashes the project: UIViewController, the class behind iOSView, is not a subclass of UIView which has an alpha property but a subclass of NSObject/NSResponder which do not have such.

But there’s a view property in a UIViewController that should give you access to the view and therefore, via iOSControlextension, you can address alpha too. I will add that but it would make the whole view transparent. This probably has to be done with a custom delegate – or maybe with the popup presentation style which I cannot invoke in my experiments.

[quote=156045:@Franck Danard]Not exactly !
I would like this :slight_smile:

Another solution is to set the background view2 to transparent with alpha, and put a tinted canvas.

But if I put this code in open event of view 2.

declare sub alpha_ lib UIKitLib selector "setAlpha:" (obj_id as ptr, alpha as Double) alpha_(self.Handle, 0.5)

The iOS app crash.[/quote]

Thanks, now I see it. Is that a photoshopped image or did you manage to get half of the screen?

Yes, it’s photoshopped image .

I see. Another update with an alpha value available, but like I thought this influences the whole view. Do you have any experience with view layer management? In order for this to work, you would either have to create a custom delegate and use the custom Presentation style or use the extension methods to add another subview to the new view, fill it with a color and set its alpha value so it’s in the background and not influencing the main view layer. Could even be a VisualEffectView, I guess.
But it’s no trivial task, admittedly.

Or the answer lies in the split view controller class:

Indeed it is not an easy task. I’m not an expert on the subject

I tried with a white rectangle that fills the lower half of the screen and view’s background color set to transparent. But as you can see there is no background anymore – the first view disappears.

Except for the sheet and formviews but the transparent color is not really transparent:

I wonder if it’s caused by the view being opaque still. Will give it a try.

No, neither opaque nor alpha help. And a custom delegate is currently a bit high for me with all that view handling. I don’t have that much experience with it, need a bit more exploration time.

Ulrich,
I’ll make do with what you’ve already implemented.

Thank you for all and Happy New Year celebrations

PS : Link Dropbox is broken

The download link doesn’t seem to work here.

Oh sorry. Should now work again: https://dl.dropboxusercontent.com/u/21200221/Xojo/UIImageView%20With%20iOSControlExtension.xojo_binary_project.zip

I added an app extension with statusbarhidden property but that doesn’t seem to work. The declares are accepted, so I wonder if this only works on a real device? (Or I made a mistake)

Great work Ulrich. Appreciated !

BTW it doesn’t work when using the another project you made (with the UIPicker). Seems several functions names etc are colliding and you get a bunch of compiler errors… :slight_smile: