Showing posts with label iphone. Show all posts
Showing posts with label iphone. Show all posts

2010/06/23

Transparent UIWebView on iPhone

Here's a little trick that allows you to create a WebView in your iPhone application that has it's background transparent, showing whatever controls you have underneath.
Could be used to create some sort of animation/background images behind the view.

2010/06/20

Shaking on the iPhone

Let’s say you have an iPhone application with many different View Controllers, and in some of them you want to detect a ‘Device Shake’ event. You can’t just catch it in the Controller itself, since it provide methods for that. So the solution is this – you subclass a UIWindow to detect an event and then broadcast it to your app. Then catch the event in appropriate places using NSNotificationCenter.

Don’t forget to change the parent class of your main Window to MotionWindow to catch the events.

Enjoy, here's the code: