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.