Speed up your iOS development workflow by adding keyboard shortcuts to UIAlertView and UIActionSheet. Inspired by Flipboard's approach shared at NSConference, I demonstrate how to intercept keyboard events to make simulators respond to Enter and Escape keys. This technique uses private APIs and direct memory access, making it unsuitable for production apps, but it's a powerful developer productivity hack for testing. I provide a complete implementation with the necessary safety precautions for different iOS versions.
Master the art of properly centering content in UIScrollView with this deep dive into implementation approaches. After exploring various methods like subclassing layoutSubviews and overriding setContentOffset, I reveal why using contentInset is the superior solution. Through real-world examples from developing PSPDFKit, I demonstrate how each approach affects zooming behavior, gesture recognition, and other scrollview interactions, helping you avoid subtle bugs that even Apple's documentation doesn't address.
Harness the power of UIAppearance for your custom views to create consistent styling across your iOS app. I explore how this often underutilized API works behind the scenes, share implementation requirements beyond just applying UI_APPEARANCE_SELECTOR, and reveal important gotchas like containment path considerations. Learn how to properly adopt appearance proxies in your custom components while understanding the performance implications and handling special cases to enable theme switching at runtime.
Dive into the inner workings of iOS's responder chain as I implement block support for UIMenuItem. I explore how UIMenuController targets actions through the responder chain, analyze Apple's design choice of omitting the target parameter, and create a cleaner API with blocks. This technical deep-dive includes implementation details for a swizzling-based solution, handling memory management challenges, and ensuring backward compatibility while maintaining app store safety.
Get a head start on using Objective-C's modern subscripting syntax in your iOS apps before Apple officially introduces it. I share a clever header-only hack that lets you use the elegant array[index] and dictionary[key] notation with Xcode 4.4 while maintaining backward compatibility with iOS 4.3+. Discover how this temporary shim works behind the scenes with ARCLite, and why you can safely adopt this cleaner syntax in your codebase today.
Enhance your iOS debugging toolkit with an improved recursiveDescription for UIViewController hierarchies. Learn how to augment the standard UIView debug output to clearly show view controller containment relationships, making it easier to spot issues in complex UI hierarchies. My simple but powerful implementation adds visual indicators for parent-child relationships and highlights common sizing bugs, solving a pain point I discussed with Apple engineers at WWDC.
Discover a significant, undocumented change in iOS 5: NSURLCache now properly implements disk caching, eliminating the need for custom solutions. I explore how iOS automatically saves web responses to a SQLite database based on Cache-Control headers, examine the cache database structure, and discuss proper configuration for performance optimization. This technical finding has important implications for developers working with network requests who previously relied on third-party caching implementations.
After months of waiting for a US visa, I share my journey from freelance iOS developer to becoming a full-time indie again. I reflect on what I learned during my time in San Francisco's startup culture, why I'm returning to Austria, and how this unexpected delay led me to discover PSPDFKit - the product that would become my passion and livelihood. A personal story about finding clarity and purpose in professional life.
Dive into the subtle details of Key-Value Observing (KVO) in Objective-C, where I clarify a common misconception about willChangeValueForKey and didChangeValueForKey. Learn why these manual notifications are unnecessary when using setter methods, how automatic change notifications actually work, and when manual KVO notifications are genuinely needed. This technical deep dive includes real-world examples from popular open-source projects that get this wrong.
This post marks the reboot of my blog where I plan to share iOS development insights and personal thoughts. After feedback about my frequent tweeting, I'm creating a space for longer-form content beyond Twitter's character limits. The previous blog content has been archived as it would have required significant updates.