iOS5: rastrear el dedo y arrastrar hacia abajo el controlador de vista como el centro de notificaciones

There are two instances that come to mind in the new iOS 5 where a user can drag down to reveal a view. If the user drags down from the status bar at the top of the screen, it will reveal the notification center,

iOS 5 Notification Center

Also, if the user is in the Weather app and drags down on a specific day of the week, it will reveal the hourly forecast,

iOS 5 Weather app hourly forecast

Is there a simple drop-in framework that can offer me this functionality? Or is there example code out there on the internet to be able to mimic it?

preguntado el 08 de noviembre de 11 a las 19:11

The weather app will reveal the hourly forecast simply by tapping on the daily forecast. It does not require a swipe gesture. -

Yes, but there is a difference when you drag it, you can control the way it is revealed. When you tap it, it just animates down and shows. Do you see what I'm getting at? -

I take it you're referring to the way the reveal animation tracks your finger movement? Can't help you with that. -

Yes, the way it tracks your finger motion. -

2 Respuestas

Lo que quieres usar es un UISwipeGestureRecognizer to detect the swipe and update your UI.

respondido 08 nov., 11:23

@awfullyjohn Give me a second to hack something together. - JustSid

Don't be lazy @awefullyjohn. the UIGestureRecognizer documentation (from Apple) tell you all about them. - Jessedc

@JustSid did you ever get a chance to try this out? - John

@JustSid Could you guys share it with us? (I'm assumming that there was some example code shared? :P) Thanks! - sridvijay

If anyone's interested, I've posted up code of how I accomplished this here: JCWindowShade. The relevant code for tracking is here: handleDrag.

respondido 19 nov., 12:20

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.