Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS5: Track Finger and Drag Down View Controller Like Notification Center

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?

like image 923
john Avatar asked Nov 08 '11 19:11

john


People also ask

How do I turn on swipe down Notification Center on iPhone?

Go to Settings > Face ID & Passcode (on an iPhone with Face ID) or Touch ID & Passcode (on other iPhone models). Enter your passcode. Scroll down and turn on Notification Center (below Allow Access When Locked).

What is iPhone Notification Center?

Notification Center shows your notifications history, allowing you to scroll back and see what you've missed. There are two ways to see your alerts from the Notification Center: From the Lock Screen, swipe up from the middle of the screen. From any other screen, swipe down from the center of the top of your screen.

How do I find old notifications on my iPhone?

Find your notifications in Notification CenterOn the Lock Screen: Swipe up from the middle of the screen. On other screens: Swipe down from the top center. Then you can scroll up to see older notifications, if there are any.


2 Answers

What you want to use is a UISwipeGestureRecognizer to detect the swipe and update your UI.

like image 69
JustSid Avatar answered Oct 23 '22 14:10

JustSid


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

like image 2
john Avatar answered Oct 23 '22 12:10

john