Skip to content

Instantly share code, notes, and snippets.

View leeprobert's full-sized avatar

Lee Probert leeprobert

View GitHub Profile
@leeprobert
leeprobert / AGNSession.m
Created July 3, 2013 11:33
AGNSession - Class for managing authentication and changes in permissions.
//
// AGNSession.m
// Agnitio iPlanner
//
// Created by Matt Gough on 04/02/2013.
// Copyright (c) 2013 Agnitio. All rights reserved.
//
#if ! __has_feature(objc_arc)
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
@leeprobert
leeprobert / AGNContainerWalker.h
Created July 3, 2013 11:29
AGNContainerWalker - class for traversing an Array or Dictionary and broadcasting notifications with the results.
//
// AGNContainerWalker.h
// Agnitio iPlanner
//
// Created by Matt Gough on 14/02/2013.
// Copyright (c) 2013 Agnitio. All rights reserved.
//
#import <Foundation/Foundation.h>
@leeprobert
leeprobert / AGNFolderDownloader.h
Created July 3, 2013 11:26
AGNFolderDownloader - Class for downloading a folder of files from a remote server. It will also make sure that a folder that is being updated is not corrupted whilst downloading. Folders are created in a temporary folder and then moved into place when completed.
//
// AGNFolderDownloader.h
// Agnitio iPlanner
//
// Created by Matt Gough on 11/03/2013.
// Copyright (c) 2013 Agnitio. All rights reserved.
//
#import <Foundation/Foundation.h>
@leeprobert
leeprobert / UIView+DragAndDrop.h
Last active December 18, 2015 19:09
UIView+DragAndDrop is an iOS Category for enabling simple drag & drop functionality on any UIView
//
// UIView+DragAndDrop.h
// Engager
//
// Created by Lee Probert on 21/06/2013.
// Copyright (c) 2013 Agnitio. All rights reserved.
//
#import <UIKit/UIKit.h>
@leeprobert
leeprobert / EntypoLabel.h
Last active December 18, 2015 01:39
Entypo font icons as UILabel subclass. The entypo character set is very handy for designers and developers. http://www.entypo.com/ This UILabel subclass has a bunch of convenience methods for displaying icons based on the type of icon. Download the fonts and then refer to the Glyph guide to see what the icons look like. The guide matches the typ…
//
// EntypoLabel.h
// Engager
//
// Created by Lee Probert on 31/05/2013.
// Copyright (c) 2013 Agnitio. All rights reserved.
//
/*
This label is designed to be used with the Entypo.ttf font.
@leeprobert
leeprobert / NSUserDefaults+registerDefaultsFromSettingsBundle.m
Last active June 9, 2017 16:23
Thanks to http://ijure.org/wp/archives/179 for this code that registers the Settings bundle defaults with the NSUserDefaults class.
- (void)registerDefaultsFromSettingsBundle
{
NSLog(@"Registering default values from Settings.bundle");
NSUserDefaults * defs = [NSUserDefaults standardUserDefaults];
[defs synchronize];
NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!settingsBundle)
{
@leeprobert
leeprobert / ScreenCaptureView.m
Created May 7, 2013 08:30
A UIView subclass for recording the screen and saving as a file. Credit to Aroth from CodeThink. From this blog entry : http://aroth.no-ip.org:82/wordpress/archives/673
//
//ScreenCaptureView.h
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
/**
* Delegate protocol. Implement this if you want to receive a notification when the
* view completes a recording.
*
@leeprobert
leeprobert / CoreDataStack.h
Created May 2, 2013 14:54
Core Data class categories to extend the functionality. There are convenience methods for grabbing ALL objects of a particular entity, or via predicate. Also a convenient and safe way of setting attribute values from a JSON object with the same key names. Credit to CoreDataStack code : https://github.com/adamgit/CoreDataStack and to Tom Harringt…
/**
CoreDataStack - CoreData made easy
c.f. https://github.com/adamgit/CoreDataStack for docs + support
*/
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#define kNotificationDestroyAllNSFetchedResultsControllers @"DestroyAllNSFetchedResultsControllers"
@leeprobert
leeprobert / StyleManager.h
Last active December 16, 2015 13:29
A collection of classes and a plist file that can be used to create ios themes with UIAppearance proxy. Note that the styles.plist contains all of the valid CSS color name references. You can use hex values as well as common ios color methods like 'redColor'. Will be adding the ability to also add RGB values as strings. Also note the string shor…
//
// StyleManager.h
// Engager
//
// Created by Lee Probert on 22/04/2013.
//
//
// PLIST FILENAME KEY IN INFO PLIST
#define kStylesFilenameInfoKey @"**.**.*****"
//
// NSColor+Hex.h
// SoundCloud
//
// Created by Robert Böhnke on 4/1/11.
// Copyright 2011 Soundcloud Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>