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-12-2012, 08:40 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 15
matzino is on a distinguished road
Default Move an UIView like Newscenter

Hej folks,

can anyone give me a hint what the best way is to move an UIView in and out, by following the finger movement like it works by the newscenter app under iOS 5?

I can't find any helpful links...

thanks in advance
matzino
matzino is offline   Reply With Quote
Old 01-12-2012, 09:07 AM   #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 matzino View Post
Hej folks,

can anyone give me a hint what the best way is to move an UIView in and out, by following the finger movement like it works by the newscenter app under iOS 5?

I can't find any helpful links...

thanks in advance
matzino

What app are you talking about, and what animation in that app? I found an app on the app store called NewsCenter Global (NewsCtrGlobal), but I don't see any special animations in it.

It would be easier if you could describe the type of animation you are after, rather than expecting people reading your post to go hunt down some app install it, and then hunt through it, looking for what you are talking about.

In general terms, Core Animation gives you lots of cool animation options for UIView. Take a look at the UIView class methods that start with animateWithDuration:

There are several different flavors of animation methods. The simplest is animateWithDuration:animations:. The most powerful, and the most complex, is called animateWithDuration:delayptions:animations:compl etion:


Those methods let you provide a block of code that changes animatable properties of one or more views. The changes are done as an animation.

There are also animations that let you do view transitions.

If you need more complex animations, you can use CAAnimation objects and CALayers, but that gets a little more complicated. More powerful, but there's more to learn in order to use it.
__________________
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-12-2012, 09:28 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 15
matzino is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
What app are you talking about, and what animation in that app? I found an app on the app store called NewsCenter Global (NewsCtrGlobal), but I don't see any special animations in it.

It would be easier if you could describe the type of animation you are after, rather than expecting people reading your post to go hunt down some app install it, and then hunt through it, looking for what you are talking about.
Sorry, my fault! I meant the "notification center", it was a wrong translation from my side.

My purpose is to have a normal UIViewController (View B) that is on top of an other UIViewController (View A). If my finger touch down on View B at the bottom and move upside the View B should follow my finger position, so that the View A comes visible. And the other side round, on View A start with the touch on top, and move to the bottom the View B should be visible, by following my finger gesture.

I take a look at the mentioned methods and if they can help me to solve this. Thank you for your reply.
matzino is offline   Reply With Quote
Old 01-12-2012, 11:35 AM   #4 (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 matzino View Post
Sorry, my fault! I meant the "notification center", it was a wrong translation from my side.

My purpose is to have a normal UIViewController (View B) that is on top of an other UIViewController (View A). If my finger touch down on View B at the bottom and move upside the View B should follow my finger position, so that the View A comes visible. And the other side round, on View A start with the touch on top, and move to the bottom the View B should be visible, by following my finger gesture.

I take a look at the mentioned methods and if they can help me to solve this. Thank you for your reply.
Ok, you're talking about the way you can drag the notification center down?

You probably want to do something like this:

Add a pan gesture recognizer to the main view of view controller A. If you want the user to drag from the top or the bottom, you might want to add hidden views to the top and bottom, and attach separate gesture recognizers to each one. Write you code to ignore pan gestures that aren't from the top down, or from the bottom up.

Use the new child view controller set up in iOS 4, and make view controller B a child view controller of view controller A.

When you detect a drag up from the bottom, you could add view controller B's content view as a subview of view controller A, shifted to be off-screen. As the user dragged up, you could use view animation to slide the view upward to follow the user's finger. The new child view controller support in iOS 5, combined with the new block-based view animation code and gesture recognizers, make this pretty simple to do.
__________________
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-12-2012, 02:53 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 15
matzino is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
Ok, you're talking about the way you can drag the notification center down?
Exactly

I was pretty sure that an easy way exists to do this job Even more if I see the notification center.

I'm very glad about your advice and I think thats the way to do
matzino 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: 380
10 members and 370 guests
7twenty7, Atatator, glenn_sayers, guusleijsten, j.b.rajesh@gmail.com, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
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:40 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0