Archive for Snippets

More Informative NSLog’s with Prefix Headers

August 29th, 2011 Posted by: - posted under:Uncategorized » Snippets - 4 Comments

Hello iCoders,
I have a quick tip today that I have been using in some of my development that you guys may find helpful in yours. Lately I’ve been developing a Framework. We mentioned a little something about it earlier here on iCodeBlog. When developing a .framework, a lot of times during my work I couldn’t place break points in the code and had to rely mostly on NSLog. NSLog however really wasn’t doing the job for me. So I …


    Coding Conventions: iVars

    July 13th, 2011 Posted by: - posted under:Snippets - 8 Comments

    Hey iCoders,
    As we have worked together over the last three years, some of the other iCodeBlog writers and I have gotten some pretty good coding conventions going that we thought would be good to share with you guys. One of the toughest to read coding conventions on iPhone is the declaration and synthesis of iVars. I’m going to go through a quick example of the correct way to do this, and the advantages of using the practice. So lets dive …


      UIColor + Digital Color Meter

      April 11th, 2011 Posted by: - posted under:Snippets - 9 Comments

      Hey iCoders,
      Short post today on a little tool I made for myself that is turning out to be very useful. This is a simple UIColor category which adds a class level initializer that accepts the color strings output from the Digital Color Meter application in OS X. I regularly make iOS apps which refer to design PDF documents. Many times designers don’t provide exact details to what colors are in the design. To get them I use the Digial Color …

        READ MORE

        ELCTextFieldCell – A Useful TableViewCell for Forms

        January 4th, 2011 Posted by: - posted under:Featured » Snippets - 16 Comments
        Screen shot 2011-01-04 at 11.49.04 AM

        Hello iCoders, today I am going to be open sourcing a UITableViewCell we have created over at ELC that we have found to be very useful. When developing apps we have found that many times a form of some type is required. This is common in Registration forms, contact forms, feedback forms, etc. The problem was writing the same basic code over and over to have an elegant fast form experience for the user. To quicken the development time of these elements we created the ELCTextFieldCell class which facilitates the creation and flow of a larger form. In this post I will be walking you through the usage of the class.

          READ MORE

          Making Smarter Table View Cells

          November 18th, 2010 Posted by: - posted under:Featured » Snippets - 11 Comments

          Table Views are one of the most common things within iPhone Applications. The standard UITableViewCells that are provided by Apple are nice but have always had a HUGE flaw in my mind. When you apply some text to the textLabel or detailTextLabel of a UITableViewCell the length of the text is not considered at all. If the text is longer than a single line you need to set the numberOfLines property to be enough so that your content can be showed. Moreover, you also need to compute the new total height of the cell to supply for the height delegate method.

            READ MORE

            Adding a UIPopover to UISlider

            October 29th, 2010 Posted by: - posted under:Featured » Snippets - 6 Comments

            If you have an iPad you have probably used iBooks, Apple’s eBook application that gives users access to the iBooks store. In this application you can navigate through books in a number of ways. Today we are going to focus on the scroll bar at the bottom of a book that a user can utilize to skip to any given page within the book. This control involves a customized UISlider and a UIPopoverView that drags along with the slider as the value changes. Today we will be making a UISlider subclass that will duplicate this functionality.

              READ MORE

              How To Integrate Google Analytics Tracking Into Your Apps In 7 Minutes

              April 22nd, 2010 Posted by: - posted under:Snippets - 38 Comments

              So, why would you want to integrate Google Analytics into your iPhone application. Duh, for the same reasons you would integrate it into your site. Google has extended their killer analytics platform to include mobile devices including the iPhone and Android devices.

              The analytics API gives you some very powerful options to get as nitty gritty as you would like in your application tracking.

                READ MORE

                Adding TwitPic to your Application

                February 23rd, 2010 Posted by: - posted under:Snippets - 20 Comments

                Back in July of last year. Brandon put up a post showing you how to integrate twitter into your application. Today I am going to take the class he made last year and add a new class which will let you post to twit pic. First lets do a little overview of what tools we need for this.
                Required Tools
                Twit pic is an awesome service. They have created a …

                  READ MORE

                  iPhone Coding Snippet – Shortening URLs

                  February 4th, 2010 Posted by: - posted under:Snippets - 27 Comments

                  I had some a to shorten URLs for an in-application Twitter client I’m working on and thought I would share my simple solution with you guys.

                  It’s actually pretty straight forward and can be done in 1 line of code. I have broken it up into several for clarity.

                    READ MORE

                    iPhone Coding Snippet: Live Character Counter, Word filter, and 1337 Translator For A UITextField

                    January 6th, 2010 Posted by: - posted under:Snippets - 22 Comments

                    I’m sure you have seen a Twitter client such as or count down the characters as you type your Tweet. This is done by responding to the Editing Changed action on a UITextField.

                    Today, I will show you how you can implement this functionality in your application as well as show you some other real world examples of responding to this action. Here are a few of the uses that we will discuss:

                    • Countdown of characters allowed – Used when the user is limited by a certain number of characters
                    • Word filter – useful in filtering out swear words or other unwanted text
                    • Live translator – our example will translate english to :)

                    I will create the core code and show you how to modify it slightly to implement the other 2 applications.

                      READ MORE