<?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>Marcus Follrud &#187; monotouch</title>
	<atom:link href="http://marcusfollrud.net/category/monotouch/feed/" rel="self" type="application/rss+xml" />
	<link>http://marcusfollrud.net</link>
	<description>Wish I had a slogan</description>
	<lastBuildDate>Tue, 24 Jan 2012 20:02:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Goals of 2011</title>
		<link>http://marcusfollrud.net/2011/08/15/goals-of-2011/</link>
		<comments>http://marcusfollrud.net/2011/08/15/goals-of-2011/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 18:59:36 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[monotouch]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Programmering]]></category>

		<guid isPermaLink="false">http://marcusfollrud.net/?p=594</guid>
		<description><![CDATA[Haha, just read my old post regarding the goals I had set in 2010. Did any of them come true? &#8211; No. This is how it went: #1 MonoTouch app I did start an iPhone application with MonoTouch, but the API for the application is was developing on never got completed so it just died. Would&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmarcusfollrud.net%2F2011%2F08%2F15%2Fgoals-of-2011%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmarcusfollrud.net%2F2011%2F08%2F15%2Fgoals-of-2011%2F&amp;source=marcusfollrud&amp;style=normal&amp;service=bit.ly&amp;service_api=R_7d280395e19104feae6bc0cd839f41c0&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Haha, just read my <a href="http://marcusfollrud.net/2010/01/01/goals-for-the-year/">old post</a> regarding the goals I had set in 2010. Did any of them come true? &#8211; No.</p>
<p>This is how it went:</p>
<p><strong>#1 MonoTouch app<br />
</strong>I did start an iPhone application with MonoTouch, but the API for the application is was developing on never got completed so it just died. Would&#8217;ve been a great app that&#8217;s for sure</p>
<p><strong>#2 Payson drupal module.</strong><br />
Also got started, even got quite far actually, but my leaving of the drupal site I was part of (linuxportalen.se) resulted in a non-complete code. Besides, I have a shallow memory that there were some problems with drupal when it came to directly hook into POST parameters, which were needed by the Payson API. When i think about it I should&#8217;ve just made a hacky php that connected to the database with the proper result, but if I&#8217;m not mistaken mind was set to do it &#8221;the proper&#8221; way, which resulted in a no go.</p>
<p><strong>#3 Community site based on Django<br />
</strong>Ah, i really loved python back in early 2010, and I still do, but when I did some research I found tornado server of better use, as I started to more and more like to writer proper API&#8217;s, instead of views with hooks of code.</p>
<p>I stopped with the Django project after some time, got back to PHP, created a small framework and started developing the new community site, which also kind of died along with my interest in the Swedish Linux community (yeah, it was meant to replace linuxportalen) whom were too much interested of internal conflicts plus distro war.</p>
<p>But, through the year I looked up some different Web frameworks for PHP, and I found <a href="http://doophp.com">DooPHP</a>, a wonderful and fast framework which is easy to learn and use. There&#8217;s a small project going on there, without a release date though, just something I do when I&#8217;m bored.</p>
<p>So to sum it up, none of my plans happened with the spare time I had part from my ordinary job, but it&#8217;s ok, none of them were too important, even though it looked like it when I think back about it.</p>
<p>&nbsp;</p>
<p><span style="color: #000000;"><strong>Goals of 2011<br />
</strong>Ha ha, right, I won&#8217;t set up any goals this year. I spend far too little time in front of the computer when I&#8217;m not working and the truth is, there are other things in life far more important to cherish and enjoy besides techie stuff. But hey, do I find something not too big and fun, I&#8217;ll probably do it <img src='http://marcusfollrud.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</span></p>
<p>Take care,<br />
Marcus</p>
]]></content:encoded>
			<wfw:commentRss>http://marcusfollrud.net/2011/08/15/goals-of-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2010 &#8211; Goals for the year</title>
		<link>http://marcusfollrud.net/2010/01/01/goals-for-the-year/</link>
		<comments>http://marcusfollrud.net/2010/01/01/goals-for-the-year/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 17:01:07 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[monotouch]]></category>
		<category><![CDATA[Programmering]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://marcusfollrud.net/?p=360</guid>
		<description><![CDATA[I didn&#8217;t make any new year promise to myself. Mostly because there&#8217;s nothing more broken than a promise made when welcoming the new year. So, instead of making promises, I&#8217;ve made goals that i&#8217;ll try to complete and deliver. #1 &#8211; My first iPhone application released A couple of months ago I beta tested MonoTouch, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmarcusfollrud.net%2F2010%2F01%2F01%2Fgoals-for-the-year%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmarcusfollrud.net%2F2010%2F01%2F01%2Fgoals-for-the-year%2F&amp;source=marcusfollrud&amp;style=normal&amp;service=bit.ly&amp;service_api=R_7d280395e19104feae6bc0cd839f41c0&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I didn&#8217;t make any new year promise to myself. Mostly because there&#8217;s nothing more broken than a promise made when welcoming the new year. So, instead of making promises, I&#8217;ve made goals that i&#8217;ll <strong><em>try</em></strong> to complete and deliver.</p>
<p><strong>#1 &#8211; My first iPhone application released<br />
</strong></p>
<p style="padding-left: 30px;">A couple of months ago I beta tested MonoTouch, the .NET framework for the iPhone. It&#8217;s a great tool for all of us who doesn&#8217;t want to learn Objective-C. After some testing I started to do some actual work for an application. It still needs  more work to be functional but at least I have something to go on. I all goes well this will be done somewhat in April.</p>
<p><strong>#2 &#8211; Payson Drupal Module</strong></p>
<p style="padding-left: 30px;">This one is a bit disturbing and embarrasing. For a long time I&#8217;ve wanted to make this module for Drupal where you, as a user have the possibility to sponsor sites by paying a small amount of cash using paysons money transaction system. I like Payson, and it really deserves more focus <img src='http://marcusfollrud.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Hopefulle this will come handy to Drupal site administrators. Hopefully this will can be expected in fall of 2010.</p>
<p><strong>#3 &#8211; Community Site based on Django</strong></p>
<p style="padding-left: 30px;">The Swedish Community has for a long time lacked a good community web site for tracking one of the finest things with open source &#8211; The great open project that makes whatever disitribution worthy of. It can be all from background search engines like <a href="http://www.beagle-project.org"><em>beagle</em> </a>to music players like <a href="http://www.listen-project.org"><em>Listen</em></a>. All small components that makes the linux experience that great! This should be expected in late 2010.</p>
<p style="padding-left: 30px;">
<p>That&#8217;s the three prioritized goals that I have as it is right now. I&#8217;ll end this post now to get started <img src='http://marcusfollrud.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>See you!<br />
/Marcus</p>
]]></content:encoded>
			<wfw:commentRss>http://marcusfollrud.net/2010/01/01/goals-for-the-year/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>#MonoTouch how to &#8211; Drag and Drop Image</title>
		<link>http://marcusfollrud.net/2009/09/23/monotouch-how-to-drag-and-drop-image/</link>
		<comments>http://marcusfollrud.net/2009/09/23/monotouch-how-to-drag-and-drop-image/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 05:32:00 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[monotouch]]></category>
		<category><![CDATA[Programmering]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[UIImageView]]></category>

		<guid isPermaLink="false">http://marcusfollrud.net/?p=312</guid>
		<description><![CDATA[My blog posts are commonly in Swedish, but since this might interest users outside the borders of Sweden I decided to write this post in English. Today, I&#8217;ll show how easy it is to Drag an Image around the screen using MonoTouch. Bear with me though, it&#8217;s my first how to . It&#8217;s actually really [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmarcusfollrud.net%2F2009%2F09%2F23%2Fmonotouch-how-to-drag-and-drop-image%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmarcusfollrud.net%2F2009%2F09%2F23%2Fmonotouch-how-to-drag-and-drop-image%2F&amp;source=marcusfollrud&amp;style=normal&amp;service=bit.ly&amp;service_api=R_7d280395e19104feae6bc0cd839f41c0&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>My blog posts are commonly in Swedish, but since this might interest users outside the borders of Sweden I decided to write this post in English.</p>
<p>Today, I&#8217;ll show how easy it is to <em>Drag an Image </em>around the screen using MonoTouch. Bear with me though, it&#8217;s my first how to <img src='http://marcusfollrud.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>It&#8217;s actually really simple, and you won&#8217;t need the Interface Builder.</p>
<p>What we need to do is to create an UIImageView class that overrides the functions <strong>TouchesBegan</strong>, <strong>TouchesMoved</strong> and <strong>TouchesEnded</strong>. It&#8217;s looking like this:</p>
<pre name="code" class="c-sharp">	public class myDraggableImage : UIImageView {

		//Store locations for remembering the last positions, and counting the future ones.
		PointF Location;
		PointF StartLocation;

		bool haveBeenTouchedOnce = false;

		public myDraggableImage ( RectangleF frame ){

					//Set the position of the frame with RectangleF (Replacement of CGRectangle)
					this.Frame = frame;
					StartLocation = this.Frame.Location;
		}

		//This event occurs when you just touch the object
		public override void TouchesBegan (MonoTouch.Foundation.NSSet touches, MonoTouch.UIKit.UIEvent e)
		{
			Console.WriteLine("Touched the object");
			Location = this.Frame.Location;

			var touch = (UITouch) e.TouchesForView (this).AnyObject;
			var bounds = Bounds;

			StartLocation = touch.LocationInView(this);
			this.Frame = new RectangleF(Location,bounds.Size);

		}
		//This event occurs when you drag it around
		public override void TouchesMoved (MonoTouch.Foundation.NSSet touches, MonoTouch.UIKit.UIEvent e)
		{
			Console.WriteLine("Dragged the object");
			var bounds = Bounds;
			var touch = (UITouch) e.TouchesForView (this).AnyObject;

			//Always refer to the StartLocation of the object that you've been dragging.
			Location.X += touch.LocationInView(this).X - StartLocation.X;
			Location.Y += touch.LocationInView(this).Y - StartLocation.Y;

			this.Frame = new RectangleF(Location,bounds.Size);

			haveBeenTouchedOnce = true;
		}

		public override void TouchesEnded (MonoTouch.Foundation.NSSet touches, MonoTouch.UIKit.UIEvent e)
		{
			StartLocation = Location;
		}

	}</pre>
<p>What&#8217;s being done here is that as soon as we Touch the object it will run &#8221;TouchesBegan&#8221; to start keeping track of the Object. And when we are moving it around, it constantly calls &#8221;TouchesMoved&#8221; where we are updating the position of the UIImageView on the screen.</p>
<p>When you&#8217;ve implemented the class class in your project, all you need to do is to create the object within &#8221;<span style="color: #0000ff;">public override bool</span> FinishedLaunching&#8221;.<br />
It can for instance look like this:</p>
<pre  name="code" class="c-sharp">myDraggableImage img = new myDraggableImage(new RectangleF(64,64,64,64));
			img.UserInteractionEnabled = true;
			img.BackgroundColor = UIColor.Green;
			img.Hidden = false;

			window.AddSubview(img);</pre>
<p>The result will be a UIImageView that can be dragged around the screen.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Hq-CvzW_D0E&amp;hl=sv&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/Hq-CvzW_D0E&amp;hl=sv&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://marcusfollrud.net/2009/09/23/monotouch-how-to-drag-and-drop-image/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

