RSS

Monthly Archives: December 2014

Database migration with application update example

DbMigration

 
Leave a comment

Posted by on December 22, 2014 in Uncategorized

 

Appirater

Appirater

 
Leave a comment

Posted by on December 17, 2014 in Uncategorized

 

Sort mutable array containing dictionary

NSComparator compareDistances = ^(id string1, id string2)
{
NSNumber *number1 = [NSNumber numberWithFloat:[string1 floatValue]];
NSNumber *number2 = [NSNumber numberWithFloat:[string2 floatValue]];

return [number1 compare:number2];
};

// sort list and create nearest list
NSSortDescriptor *sortDescriptorNearest = [NSSortDescriptor sortDescriptorWithKey:@”petrolStation.pointCoordinates.distance” ascending:YES comparator:compareDistances];
_nearestList = (NSMutableArray *)[_gasStations sortedArrayUsingDescriptors:@[sortDescriptorNearest]];

 
Leave a comment

Posted by on December 16, 2014 in Uncategorized

 

UIActivityViewcontroller example for sharing like photo gallary

UIActivityViewController

– (IBAction)sendPost:(id)sender {
NSArray *activityItems;

if (_postImage.image != nil) {
activityItems = @[_postText.text, _postImage.image];
} else {
activityItems = @[_postText.text];
}

UIActivityViewController *activityController =
[[UIActivityViewController alloc]
initWithActivityItems:activityItems
applicationActivities:nil];

[self presentViewController:activityController
animated:YES completion:nil];
}

 
Leave a comment

Posted by on December 15, 2014 in Uncategorized