Skip to content

Instantly share code, notes, and snippets.

// Eric Wolfe: Added support for checking if mobile radios are enabled on the device
// Original source: http://www.enigmaticape.com/blog/determine-wifi-enabled-ios-one-weird-trick
#import <Foundation/Foundation.h>
#import <ifaddrs.h>
#import <net/if.h>
#import <SystemConfiguration/CaptiveNetwork.h>
@interface ERWNetworkStatus : NSObject
@ericrwolfe
ericrwolfe / Mapbox Private Access Tokens.sh
Created February 23, 2017 23:04
Xcode run script build phase to deal with Mapbox access tokens
token_file=~/.mapbox
token=`cat $token_file`
info_plist=$TARGET_BUILD_DIR/$INFOPLIST_PATH
current_token=`/usr/libexec/PlistBuddy -c "Print :MGLMapboxAccessToken" $info_plist`
if [ "$current_token" ]; then
exit 0
elif [ "$token" ]; then
plutil -replace MGLMapboxAccessToken -string $token $info_plist
else