Skip to content

Instantly share code, notes, and snippets.

View markdarling's full-sized avatar

Mark Darling markdarling

View GitHub Profile

Keybase proof

I hereby claim:

  • I am markdarling on github.
  • I am markdarling (https://keybase.io/markdarling) on keybase.
  • I have a public key ASABZKjolTCGEbz7GgBFRqCRfKiQvyYa67P4aYp280iNGQo

To claim this, I am signing this object:

@markdarling
markdarling / gist:2138177
Created March 20, 2012 16:55
Git Ignore for iOS Projects
# Exclude the build directory
build/*
# Exclude temp nibs and swap files
*~.nib
*.swp
# Exclude OS X folder attributes
.DS_Store
@markdarling
markdarling / gist:2037771
Created March 14, 2012 16:42
Get Last Photo from Camera Roll
- (void)getLatestPhoto {
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
[group setAssetsFilter:[ALAssetsFilter allPhotos]];
[group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:[group numberOfAssets]-1] options:0 usingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop) {
if (alAsset) {
ALAssetRepresentation *representation = [alAsset defaultRepresentation];