Apple needs to fix this one. There is an inconsistency in the way that the UIDatePicker is rendered in Storyboards in Xcode vs. their rendering at runtime. This problem set me back longer than it should have this morning, since its effect was tricky to diagnose. The basic consequence of this was that the custom UIButton I had attached to the top of the date picker (inside a UIView) was not receiving taps and for the life of me I couldn’t figure out why… First, to diagnose the problem, I used this tip to get the UIView recursiveDescription method working in my Swift project, and I was able to get a dump of the view hierarchy. From that, I could tell that the[…]

In a much needed area of training for Xcode/Mac/iOS developers, iDeveloperTV and Graham Lee have put together a modestly-priced course on Unit Testing and TDD. Unit Testing with Xcode In this course Scotty and Graham Lee help you to not only understand the mechanics of unit testing in Xcode but also show you how you might design your code to be more testable. By working through a number of examples you will initially learn how to set up unit tests within Xcode 4 and perform basic unit testing before moving on to discover how you can test parts of your code that you previously might have thought were not possible to unit test such as code that uses singletons, networks,[…]

Good tip from iOS Developer Tips for using the “Related Files” button in the upper left corner of your code window (right next to the Back/Forward navigation buttons): Xcode 4 : Related Files List With Xcode 4 you can quickly access an assortment of files related to your project through the Related Files option in the Jump Bar.  

This sounds like it could really be a problem for developers who store anything but truly temporary data in the Caches or tmp directory… Cleaning… – Marco.org Every iOS app has its own “home” directory where it can store files. Every file and directory that an app puts there, except anything in a Caches or tmp directory, gets backed up when you sync your device to iTunes. Prior to iOS 5, the system never deleted the contents of Caches and tmp, so they were safe places for apps to put data that should always be available but could be redownloaded if the user did a complete restore or otherwise lost all data, and therefore shouldn’t be taking up space in[…]

Nice rundown on Xcode 4 Code Snippets: Xcode 4 Code Snippets – Speed of Light Xcode 4 Code Snippets   ? Perhaps my favourite feature of Xcode 4 is the Code Snippets feature. It allows you to use common bits quickly in your code, instead of requiring you retype them over and over again.

Nice little introductory tutorial for using UIActionSheets in iOS. Simple Menus and Messages with UIActionSheet If you need to create a quick menu or present a user with a short message, you may want to consider a UIActionSheet as an option. This control will slide up from the bottom of the screen, and offers a number of easily configurable options.

For the longest time, to perform a search in Xcode I would take a standard, yet uninformed, approach by selecting a desired region in my code, copy it to the clipboard with Command-C and then perform a Command-Shift-F to find all instances of the search in my project. Cool. Then after a while I actually looked at the bottom of the Edit –> Find menu. At the end of the list there is an item entitled “Use Selection for Find” and its shortcut is Command-E. The beauty of this command is that it puts the search term in a separate location preserving the contents of your clipboard. This is particularly nice since now I can have text in my clipboard and[…]

Recently, I was having an issue I was having with subviews added to my UIButton objects that I was customizing. The buttons would behave fine if they were standard rounded rect buttons, but the moment I added a UIView and some UILabels to it, the taps stopped responding. But I was able to resolve it, thanks to the tip provided here: iPhone: Subviews in UIButtons block the touch, unless… The solution boils down to something very simple and it makes sense when you think about it, but at first it seems strange: All you need to do is set userInteractionEnabled and exclusiveTouch to NO on the items that you want to add as subviews to your UIButton (and don’t set those properties[…]

For a project I’m working on, I needed to know how to monitor the input level using AVAudioRecorder. Thankfully, this post from Dan Grigsby was very helpful in setting up the polling mechanism (though you might not guess it from the title!): Tutorial: Detecting When A User Blows Into The Mic If, a couple of years back, you’d told me that people would expect to be able to shake their phone or blow into the mic to make something happen I would have laughed. And here we are. Detecting a shake gesture is straightforward, all the more so in 3.0 with the introduction of motion events. Detecting when a user blows into the microphone is a bit more difficult. In[…]