Skip to content

Instantly share code, notes, and snippets.

@Fredbin
Fredbin / 0_reuse_code.js
Created May 28, 2014 10:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/ 添加通知
[[UIDevice currentDevice] setProximityMonitoringEnabled:YES];
if ([UIDevice currentDevice].proximityMonitoringEnabled == YES)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(proximitySensorChange:)
name:UIDeviceProximityStateDidChangeNotification
object:nil];
// 移除通知
if ([UIDevice currentDevice].proximityMonitoringEnabled == YES)