Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-28-2012, 03:24 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default UIViewAnimationOptionTransitionFlipFromTop

Does anyone know how to get an UIView animation with this option to perform with a subview? Whenever I try it, I'm only able to either flip the entire view or instantly flip (no animation). My goal is to get a UIImageView to show up not unlike how notifications pop up from the system.
mer10 is offline   Reply With Quote
Old 01-28-2012, 03:36 PM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
Does anyone know how to get an UIView animation with this option to perform with a subview? Whenever I try it, I'm only able to either flip the entire view or instantly flip (no animation). My goal is to get a UIImageView to show up not unlike how notifications pop up from the system.
Post the code you're using now.

It sounds like you want your view to slide from the bottom, not flip. Is that right? And what target OS versions do you want to support? iOS 4 added block based animations, and the method

transitionFromView:toView:durationptions:complet ion:

I don't have much experience using transitions. I usually roll my own animations using block-based animations, and sometimes even use CABasicAnimations if I need a more complex effect.

Until just now, I thought the method transitionFromView:toView:durationptions:complet ion was new in iOS 5, but I just found in the docs that it's supported in iOS 4. I'd suggest using that.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.

Last edited by Duncan C; 01-28-2012 at 03:43 PM.
Duncan C is offline   Reply With Quote
Old 01-28-2012, 04:36 PM   #3 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

//new and oldView both have the same frame

[UIView transitionFromViewldView
toView:newView
duration:10
options:UIViewAnimationOptionTransitionFlipFromBot tom
completion:NULL];

I only do iOS 5.0 and above
mer10 is offline   Reply With Quote
Old 01-28-2012, 04:40 PM   #4 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Oh one thing I forgot to mention. The base view is EAGLView. Yeah I know it's not encouraged for performance reasons, but I rather use something simple and quick, even if it drops my framerate for a second.
mer10 is offline   Reply With Quote
Old 01-28-2012, 04:48 PM   #5 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
Oh one thing I forgot to mention. The base view is EAGLView. Yeah I know it's not encouraged for performance reasons, but I rather use something simple and quick, even if it drops my framerate for a second.
And what kind of transition do you want? Flip from bottom makes the whole view rotate in 3D, like a garage door with a pivot in the middle.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-28-2012, 05:30 PM   #6 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
And what kind of transition do you want? Flip from bottom makes the whole view rotate in 3D, like a garage door with a pivot in the middle.
The same transition that notifications make on the screen in iOS 5.0.
mer10 is offline   Reply With Quote
Old 01-28-2012, 06:11 PM   #7 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
The same transition that notifications make on the screen in iOS 5.0.
There are lots of different facets to notifications in iOS 5. You mean the ones that slide down from the top of the screen, or the ones that roll into place at the very top of the screen? Describe what you want specifically based on what it does. "Like notifications in iOS 5" doesn't cut it.

This is my last try to figure out what you're talking about.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-28-2012, 06:27 PM   #8 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
There are lots of different facets to notifications in iOS 5. You mean the ones that slide down from the top of the screen, or the ones that roll into place at the very top of the screen? Describe what you want specifically based on what it does. "Like notifications in iOS 5" doesn't cut it.

This is my last try to figure out what you're talking about.
The ones that roll into place at the very top of the screen.
mer10 is offline   Reply With Quote
Old 01-28-2012, 06:50 PM   #9 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
The ones that roll into place at the very top of the screen.
I don't think Apple has published that transition. There are quite a few transitions that are private.

If I remember correctly, that transition causes a part of the screen to rotate as if its a wide, short multi-faced dial, where the pixels from the current view are printed onto one of the faces. Those pixels rotate away, and the new view rotates into place.

To do that, you'd have to do something like this:

Create a core graphics context that's the size of the view you want to rotate into place.

Capture the portion of the current screen that fills the frame of the new view into that context, and release the context.

Create a CALayer the size of the new view and install the pixels from step 2 as the contents of the layer. Add that new layer as a sublayer of the current layer.

Add the new view as a subview of the current view.

Get the layer of the new view.

Create animations that run at the same time that animate the pixels from the old view away, and the layer of the new view into place at the same time. Both rotations would need to rotate around the x axis, with a center of rotation that was shifted down into the screen (negative Z value). The fromValue of the transform in the animation for the new view's layer would start it rotated off-screen.

I think you might need to add a "container layer" that contained the layers for the pixel from the old view that you're rolling away, and the layer for the new view that you're rolling into place. You'd set the masksToBounds property on the container layer to true. That way, as you rotated the old pixels layer away, and the new pixels layer into place, only the parts that showed up in the container layer would be visible, kind of like the way you can only see a couple of the numbers on the rollers in a slot machine.

It would take some fairly tricky Core Animation Work, and a fair amount of fiddling, but it should be possible.

I could probably create this transition, but it might take me a day or two of full time work.

I've done a fair amount of work with custom Core Animation transitions lately, and gotten some cool effects. I may post some samples in a thread here.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-28-2012, 07:08 PM   #10 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
I don't think Apple has published that transition. There are quite a few transitions that are private.

If I remember correctly, that transition causes a part of the screen to rotate as if its a wide, short multi-faced dial, where the pixels from the current view are printed onto one of the faces. Those pixels rotate away, and the new view rotates into place.

To do that, you'd have to do something like this:

Create a core graphics context that's the size of the view you want to rotate into place.

Capture the portion of the current screen that fills the frame of the new view into that context, and release the context.

Create a CALayer the size of the new view and install the pixels from step 2 as the contents of the layer. Add that new layer as a sublayer of the current layer.

Add the new view as a subview of the current view.

Get the layer of the new view.

Create animations that run at the same time that animate the pixels from the old view away, and the layer of the new view into place at the same time. Both rotations would need to rotate around the x axis, with a center of rotation that was shifted down into the screen (negative Z value). The fromValue of the transform in the animation for the new view's layer would start it rotated off-screen.

I think you might need to add a "container layer" that contained the layers for the pixel from the old view that you're rolling away, and the layer for the new view that you're rolling into place. You'd set the masksToBounds property on the container layer to true. That way, as you rotated the old pixels layer away, and the new pixels layer into place, only the parts that showed up in the container layer would be visible, kind of like the way you can only see a couple of the numbers on the rollers in a slot machine.

It would take some fairly tricky Core Animation Work, and a fair amount of fiddling, but it should be possible.

I could probably create this transition, but it might take me a day or two of full time work.

I've done a fair amount of work with custom Core Animation transitions lately, and gotten some cool effects. I may post some samples in a thread here.
Thanks Duncan. No need to do it for me of course. Do you think I'd get the code they use for that particular animation if I used a technical support incident?
mer10 is offline   Reply With Quote
Old 01-28-2012, 07:28 PM   #11 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
Thanks Duncan. No need to do it for me of course. Do you think I'd get the code they use for that particular animation if I used a technical support incident?

No. Apple doesn't give out their code, unless it's officially sanctioned sample code. Apple's support engineers would get fired if they gave out OS internal code like a private view transition.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-28-2012, 07:29 PM   #12 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
Thanks Duncan. No need to do it for me of course. Do you think I'd get the code they use for that particular animation if I used a technical support incident?
I'm available for hire...
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-29-2012, 05:20 PM   #13 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
I'm available for hire...
You accept TSIs??

I'll have to keep that in mind.
mer10 is offline   Reply With Quote
Old 01-29-2012, 05:48 PM   #14 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
You accept TSIs??

I'll have to keep that in mind.
I'm acronym-impaired. What's a TSI?
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-29-2012, 06:32 PM   #15 (permalink)
Registered Member
 
Join Date: Oct 2011
Age: 25
Posts: 169
mer10 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
I'm acronym-impaired. What's a TSI?
haha I was joking. Technical Support Incident, the thing we get two of every year for being in the program.
mer10 is offline   Reply With Quote
Old 01-29-2012, 08:06 PM   #16 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mer10 View Post
haha I was joking. Technical Support Incident, the thing we get two of every year for being in the program.

Gotcha. Nope. Cash, or really good booze for simple things (I'm partial to single-malt Scotch)
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 406
11 members and 395 guests
Atatator, condor304, FrankWeller, imac74, MAMN84, mraalex, n00b, PowerGoofy, QuantumDoja, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,123
Posts: 402,908
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:58 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0