Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 20, 2011, 08:07 PM   #1
primedime
macrumors member
 
Join Date: Mar 2011
Location: Ft. Lauderdale, FL
Using Proximity Sensor in app

I want to make a push up application where you would place the phone underneath yourself and as you completed a push up it will count for you.... I used a few from the app store that did this and it works nicely... I tried looking this function up in the library but I must not be searching the correct keywords, anyone want to point me in the right direction?

Thanks!!
primedime is offline   0 Reply With Quote
Old May 21, 2011, 03:03 PM   #2
jnoxx
macrumors 65816
 
jnoxx's Avatar
 
Join Date: Dec 2010
Location: Aartselaar // Antwerp // Belgium
I just googled your title, and found several stuff for this..

Code:
 Just observe the notification: UIDeviceProximityStateDidChangeNotification
so, i guess u know what to do now.
jnoxx is offline   0 Reply With Quote
Old May 21, 2011, 03:21 PM   #3
primedime
Thread Starter
macrumors member
 
Join Date: Mar 2011
Location: Ft. Lauderdale, FL
Thanks, I was getting a lot of articles in regards to Apple fixing the proximity sensor issues and nothing about xcode. I will do some research on this now, doesn't seem to be that difficult to implement in my app. But then again, only time will tell!
primedime is offline   0 Reply With Quote
Old May 25, 2011, 08:53 PM   #4
timbojill
macrumors member
 
Join Date: May 2011
Quote:
Originally Posted by jnoxx View Post
I just googled your title, and found several stuff for this..

Code:
 Just observe the notification: UIDeviceProximityStateDidChangeNotification
so, i guess u know what to do now.
What are the properties ? I want to create an apps that does A if there is no movement and B if there is movement. So in theory someone will hit a button I will tie to UIDeviceProximityStateDidChangeNotification.
timbojill is offline   0 Reply With Quote
Old May 26, 2011, 02:48 AM   #5
jnoxx
macrumors 65816
 
jnoxx's Avatar
 
Join Date: Dec 2010
Location: Aartselaar // Antwerp // Belgium
it's not if (movement) else blah. because it's only when u put your finger on the proximity sensor it will be triggered.
If u want to check for movement, I think it's best u look at some camera apps which can figure out of something is moving. or Accelerometer or something similar.
jnoxx is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone: Proximity Sensor Always On? anyjungleinguy iOS 7 2 Oct 28, 2013 01:33 PM
Proximity Sensor help! Rezki iPhone Tips, Help and Troubleshooting 0 Feb 25, 2013 10:13 AM
Proximity sensor? Musiqxlife iPhone 1 Jan 20, 2013 11:37 PM
iPhone: Proximity sensor problem Thierry ba iOS 6 1 Oct 3, 2012 06:55 PM
Proximity sensor issues bingo296 iPhone 0 Jul 17, 2012 02:04 AM

Forum Jump

All times are GMT -5. The time now is 08:13 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC