Thursday, March 20, 2014

My disappointment in Amnesty International

Today, I want to write about something that has nothing to do with computers but with my life. After all, this Blog is called Life of a Tech Dude and I decided it is time to put something up about my life or better write about something that really pisses me off!

Tuesday, March 18, 2014

Giving back to the community

In the past days, I tried to clean up my computer and delete stuff I do not need anymore or are just plain junk.  I stopped at my "Projects" folder and wondered what I might find if I really look a bit deeper and I was quite surprised not just by the cheer amount of 'Projects' I had on my computer. To be honest, almost all of my projects are prototypes with some not in a working condition anymore due to broken dependencies, changes in chosen language or just due to some 'improvements' made on-the-run.

Saturday, March 15, 2014

Generator function in Python or How to use yield

What are generator functions

A Generator function  in Python is essentially a custom iterator to be used a loop. For example, it can be used to create a custom iterator that will walk through a date range e.g. return all dates between an start and end date or you could  Iterate over all prime numbers.

Tuesday, October 9, 2012

Modern Objective C : Literals

With the Introduction of iOS6 and the new LLVM Compiler Version 4.0, Apple introduced a few very handy and powerful features to the Objective C Language.

Sunday, October 7, 2012

iOS 6 : Add Social Networking with Social Framework

Another Quick and easy Post for everyone who quickly wants to implement a social sharing solution.
Essentially, all you have to do is calling the UIActivityController. 
Sure, you don't always want to show all sharing options but the out-of-the-box solution is fairly good and should suffice for a lot of Projects.

Assuming you have a Button in your View and a Touch Event such as TouchInsideOut is hooked-up to a receiver function, following code is all you need :

NSArray* shareStuff = @[@"Cool stuff to share",[UIImage imageNamed:@"coolimage.png"]];
UIActivityViewController* shareVC = [[UIActivityViewController alloc] initWithActivityItems:shareStuff applicationActivities:Nil];
[self presentViewController:shareVC animated:YES completion:Nil];

You always have to pass an NSArray containing your shared content towards the Activity Controller.
Please note that, if you want to share an Image you have to pass in an UIImage and not UIImageView.

Easy solution, nice effect.