iOSNativeUtilities is a native extension that provides a set of native utilities for iOS. It currently supports unzip, access to settings bundle and nslog. The settings bundle allows you create a custom settings tab under the iOS “Settings” app, producing a move native experience for users.
Sample
//Settings bundle //Add Settings.bundle (yes, on windows it is a directory) to your application and include it in building options if(NativeUtils.isSupported) { var nativeUtils:NativeUtils=new NativeUtils(); //you should alwas load defaults before accesing the values, this will not override any values, that are already set //if you don't load the defaults the application may crash when trying to access a value, that was not set nativeUtils.settings.loadSettingsDefaults(); //if you want to retrieve a string: var mySetting:String=nativeUtils.settings.getStringValue("settingKeyFromBundle"); //if you want to retrieve a number: var mySetting:Number=nativeUtils.settings.getNumberValue("settingKeyFromBundle"); //if you want to retrieve an int: var mySetting:Int=nativeUtils.settings.getIntValue("settingKeyFromBundle"); //if you want to retrieve a Boolean: var mySetting:Number=nativeUtils.settings.getBooleanValue("settingKeyFromBundle"); //you can also set the values by using nativeUtils.settings.setStringValue("settingKeyFromBundle","my value"); nativeUtils.settings.setNumberValue("settingKeyFromBundle",.52); nativeUtils.settings.setIntValue("settingKeyFromBundle",134); nativeUtils.settings.setBooleanValue("settingKeyFromBundle",true); //in iOS >5 synchronize should be called automatically, but you can also do this manually to commit the changes nativeUtils.settings.synchronize() } // unzip var _nativeUtils:NativeUtils; if(NativeUtils.isSupported && !_nativeUtils) { _nativeUtils=new NativeUtils(); _nativeUtils.addEventListener(NativeUtilsZipEvent.PROGRESS,unpackProgress); _nativeUtils.addEventListener(NativeUtilsZipEvent.COMPLETE,unpackComplete); _nativeUtils.unzipFile(path,File.applicationStorageDirectory.nativePath); } // nslog var nativeUtils:NativeUtils=new NativeUtils(); nativeUtils.nslog("Your message");
RT @as3gamegears http://t.co/JW4VkcE4 #as3 #flash #gamedev: New: iOSNativeUtilities (native extension to unzip,… http://t.co/lt4O67i8