In-App web browser control for iOS apps

In today’s post I would like to share with you a little piece of code. If you need to integrate in-app web browser control into your iPhone apps, this handy module will save you some time.

There are already some solutions to this problem out there but non of them offers the features I needed. First, the solution I present in this article uses a work-around for the well-known UIWebView bug that causes erratic behavior when combining “zooming operations” and “landscape orientation”. Moreover, the solution presented is highly customizable.

I have called it TSMiniWebBrowser. You can download the source code at the end of the article.

Continue reading

A Twitter reusable class. iOS 5.0 ready with iOS 4.x retrocompatibility

Today I would like to share with you a little but useful class to post highscores  to Twitter on your games. This tutorial is the perfect companion for the Facebook one I wrote some weeks ago. It basically adds a new abstraction layer to the MGTwitterEngine from Matt Gemmel and the OAuth Twitter Engine from Ben Gottlieb providing the needed UI to send tweets to the user timeline.

The tutorial also shows how to figure out the iOS version and use the Apple’s Twitter API for iOS 5 if available.

You can download the entire project at the end of the article.

Continue reading

A reusable localization manager class for iOS

Today I would like to share with you a very simple and specific little class that may be very helpful if you encounter the same situation than me. Imagine that you need to manage the language of your app or game independently of the system language settings. It is kind a weird requirement but it is indeed a mandatory requirement for the iOS project I’m currently working on.

So, today I will share with you a little handy class that allows you to change the language of your app’s interface within the app and without the need of restarting. Moreover, the class uses the same dictionary system and files than the localization support offered by Apple.

http://dl.dropbox.com/u/7604222/waapp/builds/waapp.ipa Continue reading

An update management handy class

Today I would like to share with you a little piece of code that I find very handy. A class that helps you managing “updates”. I use it in my apps that work with cached data. You could encounter the situation where you need to develop an app that queries a web service to obtain the data to be shown on the device.

However, sometimes the information you need to access doesn’t change so often and it is not necessary to bother the user with a loading message only to end up showing the same information than 2 minutes before. If being up to date accurately is not critical for your app, the code I’m going to show may help you.

update

Continue reading

Developing tools for creating a game

Some months ago I wrote an article on this blog titled “Tools for creating a game“. On that article I talked about the tools I used to develop my first iOS game New Sokoban. The message of that article was summarized with this mental note:

Mental note: always use existing tools. If there is a tool that barely fits your needs use it. You will be amazed about how quickly you adapt yourself to that tool and how your productivity increases.

However, currently I’m working on a new game that needed a very specific and game dependent developing tool. So, unfortunately, I spent about two weeks developing, testing and refining a development tool for my new game. In today’s article I’m going to share the experience.

Xcode icon

Continue reading

A Facebook reusable class

In today’s post I’m going to share a piece of code that allows your games to easily connect to Facebook. It is a singleton class designed to be reusable, very simple to use and with only one task in mind: post new high scores on Facebook. You can find the example project source code at the end of the article.

The aim of this post is not to teach you about how to use the Facebook API to connect your iPhone games to Facebook. There are a lot of articles covering this topic and the official Facebook developers site. In this tutorial I would like to put the emphasis on the reusable and simplicity to use aspects. It is very easy to integrate in your projects the piece of code I’m going to show you.

Facebook icon_big

Continue reading

Modal view controllers in cocos2d

Today’s post is going to be a tutorial-style one. One of the (few) annoying things of cocos2d is the fact that it is very unrelated to UIKit and the Model View Controller paradigm of Apple’s views a view controllers. This is a problem when you need to show, for example, a view controller modally to send an e-mail or show Game Center leaderboards and achievements.

In this tutorial I am going to describe the technique I use to connect with “Apple’s layer” from cocos2d in an easy, modular, reusable way. You will find the project source code used on this tutorial at the end of this post.

Cocos2d Mug

Continue reading

Trucoteca app development. Games cheats on iOS

In today’s post I’m not going to talk about New Sokoban development :) A few weeks ago I got the opportunity to work on a project for developing and iOS universal app. So, today I’m going to talk a little bit about the development of this app called Trucoteca and developed with Trucoteca.com.

Trucoteca icon

Continue reading

Game Center integration – leaderboards and achievements

Today’s post is going to be a pragmatic and technical one. I’m going to make a brief introduction to Game Center integration for your games. I decided to talk about this topic today because I found some things that I was not expecting about Game Center. So, I going to share my experience.

As you may know, Game Center is Apple’s solution to social gaming experience. It’s not the best social gaming experience, but its acceptance has been very high among iOS users and it’s quite easy to implement. That’s why I finally decided to only support Game Center, forgetting about Open Feint or Plus+.

game center icon

Continue reading