This is just a small feature I implemented into a recent project but could be very useful. It will highlight instances of a string within a NSMutableAttributedString.
For example - a we could highlight each instance of "we" in "We all went to the beach on Wednesday". In practice I added this to a search suggestion field to show where the matches were taking place.
A nice little feature I was recently asked to implement to which I could find no obvious solution. A small code sample to help those in need of a similar solution.
Something often overlooked is how your app integrates to the user's mobile experience. When listening to music and interacting with other apps, it can be a bad user experience for the user's audio experience to be cut off when your app has no use for a focused audio experience.
Here's a short code snippet to allow your user to play background music in your IOS App...
So we all know Game Center isn't ideal - if user's don't login at install time it can be hard to get them to login whilst within your app. Game Center is designed to stop presenting the Game Center login view after the user has dismissed it a few times. Short of giving the user clear instructions to login once this has occurred there isn't really any ideal solution to get your user to login once they have decided to do so.
A neat little trick I've just been shown when implementing a singleton within Obj-c/ Xcode. We can forget about the sharedInstance method and simply call the singleton by [UsersSettingsInstance method:parameters].
A small issue I ran into today when running my unit test cases where none of the libraries within my podfile were found. Simple fix is to edit the podfile so that it links to your main target and test target...
link_with ['XXXXXTarget', 'XXXXXTargetTests']
Then run your pod install and you should be all set.
Small code snippet reference for getting lifelike gravity from your accelerometer in your projects. This is for Cocos2D and Box2D but is easily changeable to your project needs whichever language you program in.
On a project we're currently working on I was required to animate character input using sprite sheets to handle the animation of the characters. This was done by using textfields hidden to the user and animating their input. One of the features required was wordwrap so here is a simple way to create the appearance of wordwrapping between 2 separate fields...
So, with the release of Air 3.2 this week I decided to run a quick demo in the iPad using the source code of the Whack Game Demo by Byxb Interactive. This is pretty easily to do - overlay the Air 3.2 SDK then just create a new mobile project and copy over the source from the project.
Working on a project where the html text of a field would appear to jump/ contract on rollover. It appears the issue occurs when a dynamic textfield has autoSize set to true. There is a simple fix by setting autoSize to false after the text has been set.This may play with the height of the textfield if it is dynamically sizing so to fix this I add in the following code...