<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Unsolicited Feedback</title>
	<atom:link href="http://unsolicitedfeedback.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://unsolicitedfeedback.com</link>
	<description></description>
	<lastBuildDate>Mon, 09 Mar 2009 15:39:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Set a Multi-line Title in UIButton</title>
		<link>http://unsolicitedfeedback.com/?p=59</link>
		<comments>http://unsolicitedfeedback.com/?p=59#comments</comments>
		<pubDate>Mon, 09 Mar 2009 01:38:42 +0000</pubDate>
		<dc:creator>jpedroso</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://unsolicitedfeedback.com/?p=59</guid>
		<description><![CDATA[I&#8217;ve seen lot of people complaining to the fact that UIButton doesn&#8217;t support a multi-line title. As of iPhone SDK version 2.2.1, UIButton&#8217;s title frame is always an one-liner, no matter how long the text is.
People are complaining and getting confused because UIButton seems to have the interfaces needed to do so cleanly, namely  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen lot of people complaining to the fact that UIButton doesn&#8217;t support a multi-line title. As of iPhone SDK version 2.2.1, UIButton&#8217;s title frame is always an one-liner, no matter how long the text is.</p>
<p>People are complaining and getting confused because UIButton seems to have the interfaces needed to do so cleanly, namely  <code>-setLineBreakMode:</code> with <code>UILineBreakModeWordWrap</code> which would affect the title label, and then adjusting <code>-titleRectForContentRect:</code > to manage room to accomodate multi-lines, but happens that both don't do nothing about it, so I'll show how to do it dirtily. Or sort of. </p>
<p><span id="more-59"></span></p>
<p>After some time, the best solution I came up with was to add a UILabel as subview to replace the title. I took the long run in order to make this patch work as seamless as possible with existing UIButton API and Interface Builder. I wanted this code to handle both the title and appearance settings that are defined both ways.</p>
<p>Below is the code that should be added into an UIButton subclass. Note that if you don't need/want to subclass you can pull of this exact same code into your button's <code>superview</code> drawing routines, replacing all references to <code>self</code> with the button variable name. Off to what matters.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#define TITLE_LABEL_TAG 1234</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>titleRectForContentRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>rect
<span style="color: #002200;">&#123;</span>   
    <span style="color: #11740a; font-style: italic;">// define the desired title inset margins based on the whole rect and its padding</span>
    UIEdgeInsets padding <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self titleEdgeInsets<span style="color: #002200;">&#93;</span>;
    CGRect titleRect <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span>rect.origin.x    <span style="color: #002200;">+</span> padding.left, 
                                  rect.origin.x    <span style="color: #002200;">+</span> padding.top, 
                                  rect.size.width  <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>padding.right <span style="color: #002200;">+</span> padding.left<span style="color: #002200;">&#41;</span>, 
                                  rect.size.height <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>padding.bottom <span style="color: #002200;">+</span> padding<span style="color: #002200;">&#93;</span>.top<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// save the current title view appearance</span>
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>title <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self currentTitle<span style="color: #002200;">&#93;</span>;
    UIColor  <span style="color: #002200;">*</span>titleColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self currentTitleColor<span style="color: #002200;">&#93;</span>;
    UIColor  <span style="color: #002200;">*</span>titleShadowColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self currentTitleShadowColor<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// we only want to add our custom label once; only 1st pass shall return nil</span>
    UILabel  <span style="color: #002200;">*</span>titleLabel <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span>UILabel<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span>self viewWithTag<span style="color: #002200;">:</span>TITLE_LABEL_TAG<span style="color: #002200;">&#93;</span>;
&nbsp;
&nbsp;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span>titleLabel<span style="color: #002200;">&#41;</span> 
    <span style="color: #002200;">&#123;</span>
        <span style="color: #11740a; font-style: italic;">// no custom label found (1st pass), we will be creating &amp; adding it as subview</span>
        titleLabel <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UILabel alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>titleRect<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>titleLabel setTag<span style="color: #002200;">:</span>TITLE_LABEL_TAG<span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #11740a; font-style: italic;">// make it multi-line</span>
        <span style="color: #002200;">&#91;</span>titleLabel setNumberOfLines<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>titleLabel setLineBreakMode<span style="color: #002200;">:</span>UILineBreakModeWordWrap<span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #11740a; font-style: italic;">// title appearance setup; be at will to modify</span>
        <span style="color: #002200;">&#91;</span>titleLabel setBackgroundColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIColor clearColor<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>titleLabel setFont<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>self font<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>titleLabel setShadowOffset<span style="color: #002200;">:</span>CGSizeMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">1</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>titleLabel setTextAlignment<span style="color: #002200;">:</span>UITextAlignmentCenter<span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #002200;">&#91;</span>self addSubview<span style="color: #002200;">:</span>titleLabel<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>titleLabel release<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// finally, put our label in original title view's state</span>
    <span style="color: #002200;">&#91;</span>titleLabel setText<span style="color: #002200;">:</span>title<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>titleLabel setTextColor<span style="color: #002200;">:</span>titleColor<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>titleLabel setShadowColor<span style="color: #002200;">:</span>titleShadowColor<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// and return empty rect so that the original title view is hidden</span>
    <span style="color: #a61390;">return</span> CGRectZero;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>Shortly, what I did there was to save all settings that define the appearance of the original label for a given current state, apply that settings to the custom label, and return an empty frame so that the original title isn't drawn. </p>
<p>As to the decision of putting this code in <code>-titleRectForContentRect:</code>, it is the method which gives me the best way to handle the change of state when the button is pressed. Surprisingly, <code>-drawRect:</code> is only called once.</p>
<p>That's a truck load of code for such basic good, but hey, that's why I set it up here neatly. And you can use the same UIButton API to set the title, title color and title shadow color without being worried about the extra UILabel.</p>
<p>Here's the final result.</p>
<div style="text-align:center;"><img src="http://unsolicitedfeedback.com/wp-content/uploads/2009/03/multiline-uibutton1.png" alt="multiline-uibutton.png" border="0" width="407" height="307" /></div>
<p><br/></p>
<p>You can download the code below.</p>
<div class="filedownload"><a href="http://unsolicitedfeedback.com/wp-content/uploads/2009/03/ufmultilinebutton.zip" title="UFMultiLineButton.zip">UFMultiLineButton.zip</a></div>
<h4>Sidenote</h4>
<p>An alternate way, is to hack the title's view UILabel. By inspecting <code>UIButton.h</code>, one sees the private <code>UILabel *_titleView</code>, but even subclassing UIButton, there's no way to access directly to <code>_titleView</code>. </p>
<p>Though, rembember: UIButton is a UIView subclass—it has subviews and it's possible to iterate over them. Looking carefully into <code>UIButton.h</code>, we can assume there's only one UILabel. I subclassed UIButton and in <code>-drawRect:</code> I hacked the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>drawRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>rect
<span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// looking for _titleView UILabel (see UIButton.h)</span>
    <span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span>UIView <span style="color: #002200;">*</span>s <span style="color: #a61390;">in</span> <span style="color: #002200;">&#91;</span>self subviews<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
        <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>s isKindOfClass<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UILabel class<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
            <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#40;</span>UILabel <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>s setNumberOfLines<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>self setLineBreakMode<span style="color: #002200;">:</span>UILineBreakModeWordWrap<span style="color: #002200;">&#93;</span>;    
    <span style="color: #002200;">&#91;</span>self setTextAlignment<span style="color: #002200;">:</span>UITextAlignmentCenter<span style="color: #002200;">&#93;</span>;
    <span style="color: #11740a; font-style: italic;">// ...</span>
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p><strong>Note to self</strong>: Sadly, this code doesn't work in <code>-awakeFromNib</code> nor <code>-initWithFrame:</code> — Oddly, the latter is never called when the button is created from a NIB. Also, beware this code is messing with UIKit private stuff. Use with advisory. For what it's worth, my experience tells me it doesn't hurt Apple much.</p>
<p>The original title view label is now capable of handling multiple lines and nicely word wraps its content. Only thing left is changing the frame for title. See the code above on <code>-titleRectForContentRect:</code> for how to  generate the frame and return it instead of the <code>CGRectZero</code>.</p>
<p>The only problem with this approach—besides messing around private views—is that the title will never be center aligned. Even changing the code that makes the title's label multi-line and center aligned from <code>drawRect:</code> to <code>-titleRectForContentRect:</code> doesn't fix the text alignment problem. </p>
<p>Bottom line: If you can get away with a left aligned multi-line title then you can consider this approach. Otherwise, don't.</p>
]]></content:encoded>
			<wfw:commentRss>http://unsolicitedfeedback.com/?feed=rss2&amp;p=59</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to Customize UIKeyboard by Adding Subviews</title>
		<link>http://unsolicitedfeedback.com/?p=44</link>
		<comments>http://unsolicitedfeedback.com/?p=44#comments</comments>
		<pubDate>Fri, 06 Feb 2009 00:27:33 +0000</pubDate>
		<dc:creator>jpedroso</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://unsolicitedfeedback.com/?p=44</guid>
		<description><![CDATA[So, you want to get your personal touch into the apparently unreachable iPhone keyboard, something along the line of the image below maybe. Read on.


You have two possible approaches.
Approach 1: Adding the custom view on top of UIKeyboard view
You can create the custom view you want, position it above the UIKeyboard and animate it the [...]]]></description>
			<content:encoded><![CDATA[<p>So, you want to get your personal touch into the apparently unreachable iPhone keyboard, something along the line of the image below maybe. Read on.</p>
<a href="http://unsolicitedfeedback.com/wp-content/uploads/2009/02/custom-uikeyboard.png"><img src="http://unsolicitedfeedback.com/wp-content/uploads/2009/02/customuikeyboard.png" alt="Custom UIKeyboard" title="Custom UIKeyboard" width="405" height="227" class="size-full wp-image-47" /></a>
<p><br/><br />
<span id="more-44"></span></p>
<p>You have two possible approaches.</p>
<h4>Approach 1: Adding the custom view on top of <code>UIKeyboard</code> view</h4>
<p>You can create the custom view you want, position it above the UIKeyboard and animate it the same way <code>UIKeyboard</code> is. This means your code will be constantly listening to the <code>UIKeyboardWillShow</code> and <code>UIKeyboadWillHide</code> notifications in order to show and hide the custom view along with the keyboard. Also you have the hassle of having to write all the animation code for the custom view to mimic the keyboard going up and down.</p>
<p>This approach will work in most situations but my experience tells me that in certain situations when alternating between text fields of a form, the <code>UIKeyboardWillHide</code> and <code>UIKeyboardWillShow</code> notifications are sent so quickly that the <code>UIkeyboard</code> doesn&#8217;t go down. Though, our custom view goes down and comes up very quickly. If you, reading this, have any idea how to prevent this behavior, leave it in the comments.</p>
<h4>Approach 2: Adding the custom view to the <code>UIKeyboard</code> view itself</h4>
<p>Apple keeps its keyboard implementation private for some reason. So, you know, you shouldn&#8217;t be modifying UIKeyboard&#8217;s inner subviews. Anyway, you shouldn&#8217;t doesn&#8217;t mean you can&#8217;t.</p>
<p>You start with the same custom view you had in the first approach, but you will be adding it to the UIKeyboard subviews instead. This will save you from all the hassle of animating the custom view so that it has a similar behavior to the UIKeyboard&#8217;s.  </p>
<p>The following block of code describes how to had your custom view to the UIKeyboard.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">/*!
 As of iPhone SDK 2.2.1:
 Keyboard view is in a separated window from our application main window.
 We're digging through the unknown here, but if for some wacky reason this
 code is broke, the only side effect will be that the keyboard dismiss 
 button will not be shown.
 */</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>modifyKeyboard<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSNotification</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notification 
<span style="color: #002200;">&#123;</span>
    <span style="color: #400080;">NSValue</span> <span style="color: #002200;">*</span>v <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>notification userInfo<span style="color: #002200;">&#93;</span> valueForKey<span style="color: #002200;">:</span>UIKeyboardBoundsUserInfoKey<span style="color: #002200;">&#93;</span>;
    CGRect kbBounds <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>v CGRectValue<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span>UIWindow <span style="color: #002200;">*</span>keyboardWindow <span style="color: #a61390;">in</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> windows<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
        <span style="color: #11740a; font-style: italic;">// Now iterating over each subview of the available windows</span>
        <span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span>UIView <span style="color: #002200;">*</span>keyboard <span style="color: #a61390;">in</span> <span style="color: #002200;">&#91;</span>keyboardWindow subviews<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
            <span style="color: #11740a; font-style: italic;">// Check to see if the description of the view we have referenced is UIKeyboard.</span>
            <span style="color: #11740a; font-style: italic;">// If so then we found the keyboard view that we were looking for.</span>
            <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>keyboard description<span style="color: #002200;">&#93;</span> hasPrefix<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&lt;UIKeyboard&quot;</span><span style="color: #002200;">&#93;</span> <span style="color: #002200;">==</span> <span style="color: #a61390;">YES</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
&nbsp;
                <span style="color: #11740a; font-style: italic;">// Your view specific code for the custom view goes here</span>
                <span style="color: #11740a; font-style: italic;">//</span>
                UIView <span style="color: #002200;">*</span>customView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self viewForDismissKeyboard<span style="color: #002200;">:</span>kbBounds<span style="color: #002200;">&#93;</span>;
                <span style="color: #11740a; font-style: italic;">//</span>
                <span style="color: #11740a; font-style: italic;">// End of custom view code</span>
&nbsp;
                <span style="color: #11740a; font-style: italic;">// Set a tag so that if you want to remove the view later, it is a lot easier.</span>
                <span style="color: #002200;">&#91;</span>customView setTag<span style="color: #002200;">:</span><span style="color: #2400d9;">666</span><span style="color: #002200;">&#93;</span>; 
&nbsp;
                <span style="color: #11740a; font-style: italic;">// Add the desired subview to the keyboard.</span>
                <span style="color: #002200;">&#91;</span>keyboard addSubview<span style="color: #002200;">:</span>customView<span style="color: #002200;">&#93;</span>;
&nbsp;
                <span style="color: #11740a; font-style: italic;">// Unregister as observer if you don't want to change the keyboard again</span>
                <span style="color: #11740a; font-style: italic;">// and leave the custom view across the whole application.</span>
                <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNotificationCenter</span> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self<span style="color: #002200;">&#93;</span>;
            <span style="color: #002200;">&#125;</span>
        <span style="color: #002200;">&#125;</span>
    <span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<h4>Where do you add this code?</h4>
<p>Since my application shares the same keyboard type across the whole app, I put this code in application delegate so that the code runs only the first time the keyborad is requested—note that I&#8217;m removing the observer in line 36.  Be sure to add the following line of code at the end of application delegate <code>applicationDidFinishLaunching:</code>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;">    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNotificationCenter</span> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self
                                             selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>modifyKeyboard<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> 
                                                 name<span style="color: #002200;">:</span>UIKeyboardWillShowNotification
                                               object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>But if your application uses, let&#8217;s say a numeric and a text keyboard, and you want to add a decimal point just to the numeric keyboard, you will want to put this code in the view controller or view that holds the numeric text field. Then, after leaving the view, you shall make sure that you remove the view (controller) as an observer for the UIKeyboardWillShow and UIKeyboardWillHide notifications so that it does not affect other keyboard types. I suggest you to see <code>UIViewController</code> <code>viewWillAppear</code> and <code>viewWillDisappear</code> methods add/remove the custom view and unregister for <code>UIKeyboardWillShow</code> and <code>UIKeyboardWillHide</code> notifications.</p>
<p>If you need further help adapting this code to your application, be at will to contact me.</p>
]]></content:encoded>
			<wfw:commentRss>http://unsolicitedfeedback.com/?feed=rss2&amp;p=44</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSSEdit Color Theme for Xcode &amp; IntelliJ IDEA</title>
		<link>http://unsolicitedfeedback.com/?p=39</link>
		<comments>http://unsolicitedfeedback.com/?p=39#comments</comments>
		<pubDate>Fri, 09 Jan 2009 09:10:56 +0000</pubDate>
		<dc:creator>jpedroso</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://unsolicitedfeedback.com/?p=39</guid>
		<description><![CDATA[I love everything in CSSEdit, from its features to the beautiful user interface. But there&#8217;s one thing I like so much that I want to have it everywhere: It&#8217;s the syntax coloring theme. 
I spent most of my time crafting code, either in Xcode, IntelliJ IDEA or TextMate, and, oh boy, I like to do [...]]]></description>
			<content:encoded><![CDATA[<p>I love everything in <a href="http://www.macrabbit.com/cssedit/">CSSEdit</a>, from its features to the beautiful user interface. But there&#8217;s one thing I like so much that I want to have it everywhere: It&#8217;s the syntax coloring theme. </p>
<p>I spent most of my time crafting code, either in <a href="http://developer.apple.com/technology/xcode.html">Xcode</a>, <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a> or <a href="http://macromates.com/">TextMate</a>, and, oh boy, I like to do it classy. Hence, to date, I&#8217;ve ported CSSEdit&#8217;s color theme to XCode and IntelliJ IDEA, and now I&#8217;m sharing the love here with you.</p>
<p><span id="more-39"></span></p>
<p>Below is how it looks on Xcode (go to Flickr to see the <a href="http://farm4.static.flickr.com/3313/3182374012_f22a8ff30a_o.jpg">full size version</a>).</p>
<p><a href="http://www.flickr.com/photos/jpedroso/3182374012/" title="CSSEdit Color Theme for Xcode by Jorge Pedroso, on Flickr"><img src="http://farm4.static.flickr.com/3313/3182374012_4c19319050.jpg" width="489" height="500" alt="CSSEdit Color Theme for Xcode" /></a></p>
<p>So without further ado, download the color themes with the links below.</p>
<div class="filedownload"><a href='http://unsolicitedfeedback.com/wp-content/uploads/2009/01/intellijidea-csseditcolors.zip'>CSSEditColors for IntelliJ IDEA (Mac + PC) 100 Kb</a></div>
<div class="filedownload"><a href='http://unsolicitedfeedback.com/wp-content/uploads/2009/01/xcode-csseditcolors.zip'>CSSEditColors for Xcode (Mac) 160 Kb</a></div>
<p>As a note, IntelliJ IDEA version supports Java, Java Properties, PHP, XML, HTML, XPath, CSS, JavaScript, Groovy, JSP, SQL and Diff. Both themes use Monaco 11pt. You can obviously use the typeface of your choice. If you don&#8217;t have the Monaco typeface you can download it <a href="http://www.gringod.com/2006/02/24/return-of-monacottf/">here</a>. Additionally, you can get a good compilation of programming fonts <a href="http://blog.hamstu.com/2008/02/03/the-typography-of-code/">here</a>.</p>
<p>I also started a repository in <a href="http://github.com">GitHub</a> hoping more themes and editors will join. Explore it <a href="http://github.com/jpedroso/color-themes/">here</a>, grab it, play with it and be at will to contact me if you want to contribute with more themes and editors.</p>
]]></content:encoded>
			<wfw:commentRss>http://unsolicitedfeedback.com/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Random (Witty) Desktop Pictures in Mac OS X</title>
		<link>http://unsolicitedfeedback.com/?p=32</link>
		<comments>http://unsolicitedfeedback.com/?p=32#comments</comments>
		<pubDate>Sun, 04 Jan 2009 16:00:56 +0000</pubDate>
		<dc:creator>jpedroso</dc:creator>
				<category><![CDATA[Stuff Others Made]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://unsolicitedfeedback.com/?p=32</guid>
		<description><![CDATA[Let me tell you about this simple Mac OS X feature that (randomly) alternates between desktop background pictures. 
I never really gave it much credit as something useful or witty until I came across this beautiful work by the gifted Louie Mantia. I immediately liked the background artwork of the pictures but I wasn&#8217;t convinced [...]]]></description>
			<content:encoded><![CDATA[<p>Let me tell you about this simple Mac OS X feature that (randomly) alternates between desktop background pictures. </p>
<p>I never really gave it much credit as something useful or witty until I came across this <a href="http://mantia.me/desktops/product-red/">beautiful work</a> by the gifted <a href="http://mantia.me">Louie Mantia</a>. I immediately liked the background artwork of the pictures but I wasn&#8217;t convinced to use them until I realized how well the subtle <a href="http://www.joinred.com/"><strong>(PRODUCT) RED</strong></a> letterings would work together with the mentioned feature.</p>
<p><span id="more-32"></span></p>
<p>Now, I&#8217;m wondering where can I find more desktop pictures bundles like this one. I&#8217;d also love to see you sharing some ideas for new pictures in the comments .</p>
<p>Below, is my System Preferences settings for the desktop picture.</p>
<p><img src="http://unsolicitedfeedback.com/wp-content/uploads/2009/01/sysprefs-random_desktop.png" alt="Desktop &#038; Screen Saver Settings" title="Desktop &#038; Screen Saver in System Preferences" width="500" height="440" class="size-full wp-image-35" /></p>
<p>Just for the record. It&#8217;s Sunday afternoon and I just had one of those two-hours-long lunches. I open my laptop to find that it salutes me with a bold <strong>SAVO(RED)</strong>—apologies to  british pundits—. Well, I don&#8217;t know about you, but this sure made me chuckle for the day. I already can imagine myself working late into night and seeing my desktop wallpaper displaying <strong>TI(RED)</strong> or <strong>HAMME(RED)</strong>.</p>
<p><a href="http://www.flickr.com/photos/jpedroso/3167378773/" title="INSPI(RED) by Jorge Pedroso, on Flickr"><img src="http://farm2.static.flickr.com/1125/3167378773_cca0de78b1.jpg" width="500" height="313" alt="INSPI(RED)" /></a></p>
<p><em>Sidenote: Now it&#8217;s displaying <strong>INSPI(RED)</strong> but something along the lines of <strong>BO(RED)</strong> would be more accurate.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://unsolicitedfeedback.com/?feed=rss2&amp;p=32</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Beginning</title>
		<link>http://unsolicitedfeedback.com/?p=22</link>
		<comments>http://unsolicitedfeedback.com/?p=22#comments</comments>
		<pubDate>Sat, 03 Jan 2009 22:13:00 +0000</pubDate>
		<dc:creator>jpedroso</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://unsolicitedfeedback.com/?p=22</guid>
		<description><![CDATA[Damn, it was about time!
I&#8217;ve been dragging the start of this blog for about a year now because neither time nor proper motivation haven&#8217;t been on my side. I have this day job, you know, just like you probably do. Problem is, I&#8217;m still finishing college. And this pretty much sucks up most of my [...]]]></description>
			<content:encoded><![CDATA[<p>Damn, it was about time!</p>
<p>I&#8217;ve been dragging the start of this blog for about a year now because neither time nor proper motivation haven&#8217;t been on my side. I have this day <a href="http://www.wit-software.com">job</a>, you know, just like you probably do. Problem is, I&#8217;m still finishing <a href="http://www.uc.pt/en/fctuc/dei/ensino/mestrados/mestrado_ei">college</a>. And this pretty much sucks up most of my time. </p>
<p>Truth be told, I&#8217;ve been neglecting almost all parts of my online social presence for the last couple of years—read <a href="http://unsolicitedfeedback.com">blog</a>, <a href="http://twitter.com/jpedroso">Twitter</a>, <a href="http://www.facebook.com/profile.php?id=1120168220">Facebook</a>, LinkedIn, and pretty much everything else, for that matter—.</p>
<p>Well, but this year, I&#8217;m off to a new start. New year, new life, new resolutions and now I&#8217;m really committed to this.</p>
<h4>What will I blog about?</h4>
<p>This will be an attempt to put into words my opinions, ideas, rants and occasionally to talk about and detail what I&#8217;ve been up to. While spelling out <a href="http://unsolicitedfeedback.com/tag/code">code</a>, dangling on <a href="http://unsolicitedfeedback.com/tag/software-development">software development</a> process and rambling on <a href="http://unsolicitedfeedback.com/tag/user-experience">user experience</a>/<a href="http://unsolicitedfeedback.com/tag/interface-design">interface design</a> for the <a href="http://unsolicitedfeedback.com/tag/web">web</a>, <a href="http://unsolicitedfeedback.com/tag/mac">desktop</a> and <a href="http://unsolicitedfeedback.com/tag/iphone">mobile</a> platforms, I guess something worth putting up here will come up.</p>
<p>Particularly, since lately I&#8217;ve been fully immersed with iPhone development, I&#8217;ll share some bits now and then around here on <a href="http://unsolicitedfeedback.com/tag/objective-c">Objective-C</a>, <a href="http://unsolicitedfeedback.com/tag/uikit">UIKit</a> and the <a href="http://unsolicitedfeedback.com/tag/app-store">App Store</a>.</p>
<p>Though, let me advise you. One could say I&#8217;m biased and annoyingly opinionated. That would come up totally true, but heck, that&#8217;s the way I&#8217;ve been getting along all my life, so you may expect this to reflect here.</p>
<p>So, here I go. I&#8217;m blogging now. Hope you&#8217;ll like it. Be at will to subscribe the <a href="http://unsolicitedfeedback.com/feed/">syndicate feed</a>.</p>
<p><em>Disclaimer: Here I&#8217;ll express my own opinions, which are not endorsed in any way by my <a href="http://www.wit-software.com">employer</a>, nor anyone else, for that matter.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://unsolicitedfeedback.com/?feed=rss2&amp;p=22</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TeleMultibanco for iPhone Hits the App Store</title>
		<link>http://unsolicitedfeedback.com/?p=1</link>
		<comments>http://unsolicitedfeedback.com/?p=1#comments</comments>
		<pubDate>Mon, 17 Nov 2008 10:00:42 +0000</pubDate>
		<dc:creator>jpedroso</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://unsolicitedfeedback.com/?p=1</guid>
		<description><![CDATA[TeleMultibanco hit the App Store today, published by Vodafone Portugal. 

The product, also known as TeleMB, was recently re-branded to MB Phone. I recommend you to give it a spin using the direct link to the App Store (Portuguese only) below.

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vodafone.pt/main/Particulares/Servicos/ServicosUteis/TeleMB.htm">TeleMultibanco</a> hit the App Store today, published by <a href="http://www.vodafone.pt">Vodafone Portugal</a>. </p>
<p><img src="http://unsolicitedfeedback.com/wp-content/uploads/2008/11/mb-main_menu-161x300.png" alt="TeleMB Main Menu" title="TeleMB Main Menu" width="161" height="300" class="aligncenter size-medium wp-image-26" /></p>
<p>The product, also known as TeleMB, was recently re-branded to <a href="http://www.sibs.pt/conteudo.php?id=135&#038;type=0">MB Phone</a>. I recommend you to give it a spin using the direct link to the App Store (Portuguese only) below.</p>
<p><a class="aligncenter" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294931000&#038;mt=8"><img alt="TeleMB now available on App Store" src="http://devimages.apple.com/global/elements/promos/avail_on_app_store.png" title="App Store" width="166" height="74" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://unsolicitedfeedback.com/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
