<?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>Mobile Perspectives &#187; UIView</title>
	<atom:link href="http://www.BluMtnWerx.com/blog/tag/uiview/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.BluMtnWerx.com/blog</link>
	<description>Computing at the Edge!</description>
	<lastBuildDate>Fri, 19 Aug 2011 00:29:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>More Fun With Coordinate Systems</title>
		<link>http://www.BluMtnWerx.com/blog/2009/04/more-fun-with-coordinate-systems/</link>
		<comments>http://www.BluMtnWerx.com/blog/2009/04/more-fun-with-coordinate-systems/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 03:18:51 +0000</pubDate>
		<dc:creator>deans</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[UIView]]></category>

		<guid isPermaLink="false">http://www.BluMtnWerx.com/blog/?p=59</guid>
		<description><![CDATA[We all know that each UIView has its own origin, thus, internally, its own coordinate space.&#160;  Except, that is, when you ask a view for its center.]]></description>
			<content:encoded><![CDATA[<p>Thus far, in my very brief iPhone SDK programming career, I probably have had more bugs caused by each view having its own coordinate space than any other single issue.&nbsp;  Just when I thought that I had it all figured out, I ran into this issue.</p>
<p>If you ask a UIView for its &#8220;<strong>bounds</strong>,&#8221; you get back a rectangle, with an origin at (0,0) and a size set to the frame size of the view.&nbsp;  That&#8217;s exactly what I would expect.&nbsp;  Now, I know that relative position in a header file means absolutely nothing.&nbsp;  However, the very next property specified in the UIViewGeometry category defined for UIView is &#8220;<strong>center</strong>.&#8221;&nbsp;  Guess which coordinate space &#8220;<strong>center</strong>&#8221; is in.&nbsp;  Unfortunately, I guessed that it would be in the space of the receiver &#8211; <strong><em>WRONG</em></strong>.&nbsp;  It&#8217;s actually in the space of the superview.&nbsp;  I even checked the UIView Class Reference documentation.&nbsp;  Surely enough, &#8220;<em>The center is specified within the coordinate system of its superview.</em>&#8221;</p>
<p>I&#8217;ve been warned, from now on, I&#8217;m always going to refer back to Apple&#8217;s Developer Documentation.</p>
<p>Happy coding&#8230;</p>
<p>Technorati Tags:&nbsp; <a href="http://technorati.com/tag/iPhone" rel="tag">iPhone</a>, <a href="http://technorati.com/tag/iPod+Touch" rel="tag">iPod Touch</a>, <a href="http://technorati.com/tag/Apple" rel="tag">Apple</a>, <a href="http://technorati.com/tag/mobile" rel="tag">mobile</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.BluMtnWerx.com/blog/2009/04/more-fun-with-coordinate-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

