Apple has filed for a patent which brings instant messaging to the iPhone and other touchscreen devices it produces.