Skip to content

Instantly share code, notes, and snippets.

View quellish's full-sized avatar

Dan quellish

View GitHub Profile
@quellish
quellish / docset.sh
Created January 25, 2012 05:08
AppleDoc docset generator script for xcode
# This can be inserted as a Run Script build phase or a Build Rule in your Xcode project.
# You can set this to whatever you like.
DOCUMENTATION_DIR="Documentation"
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "${BUILD_ROOT}/${INFOPLIST_PATH}")
# DOCUMENTATION_FOLDER_PATH
if [ -e /usr/local/bin/appledoc ] ; then
/usr/local/bin/appledoc --project-name $PRODUCT_NAME --output $DOCUMENTATION_DIR --logformat xcode --exit-threshold 2 --verbose xcode --docset-bundle-filename "$BUNDLE_ID.$PRODUCT_NAME.docset" .
@quellish
quellish / FBClasses.txt
Created August 15, 2015 01:50
Facebook iOS App Class List
headers:
_ASAsyncTransaction.h
_ASAsyncTransactionGroup.h
_ASDisabledPanUITextView.h
_ASDisplayLayer.h
_ASDisplayLayerDelegate-Protocol.h
_ASDisplayView.h
_ASImageNodeDrawParameters.h
_ASPendingState.h
_ASTextNodeCachedMetrics.h
@quellish
quellish / xcci.md
Created October 28, 2014 03:03
Xcode CI script variables

Variable

Type

@quellish
quellish / Foo.m
Created August 29, 2014 05:58
UIResponder Informal Protocol
/**
Informal protocol that traverses the responder chain until a concrete class provides
an instance of NSManagedObjectContext. If no responder provides on, UIApplication is extended to forward
the request to it's delegate. We extend the UIApplicationDelegate to add this new behavior.
Concrete responders can provide optional implementations of managedObjectContext. For example, a responder such as
a view may call [self managedObjectContext], which would start walking up the responder chain. When it gets to the view controller that owns the view, the view controller may have a concrete implementation of managedObjectContext. This can be a property, or a method that creates a new context, etc. The instance vended by the view controller method is what the view that called [self managedObjectContext] gets as a response from that method.
Both the responder chain and informal protocols are incredible powerful concepts that are often under utilized by developers outside of Apple.
@quellish
quellish / FailingSilentNotificationWithAlert.md
Created October 3, 2018 22:39
Mixing content-available and alert
{
    "aps": {
        "alert": {
            "body": "Test message",
            "title": "Optional title",
            "subtitle": "Optional subtitle"
        },
        "content-available": 1
 }
@quellish
quellish / CocoapodsToSubmodules.md
Created June 28, 2018 07:14
CocoaPods conversion to Submodules Specs
  1. WordPress-iOS project must build and run all targets correctly.
  2. All dependencies must be using the version specified in the original Podfile.
  3. All work must be based on WordPress-iOS repository version 72862f6651bf5dbe77235e836607bc74717f7d21.

The WordPress-iOS app repository is: https://github.com/wordpress-mobile/WordPress-iOS

Fork or clone and create a branch for this work.

Go through the existing Podfile. For each pod listed:

@quellish
quellish / FriendsSpecs.md
Created June 28, 2018 07:13
Friends Specs
@quellish
quellish / waitForBlock.m
Created August 9, 2014 20:09
Pseudo-sample of synchronous use of Core Data performBlock: using dispatch group
group = dispatch_group_create();
dispatch_group_enter(group);
[context performBlock:^{
result = [context executeFetch:...
dispatch_group_leave(group);
}];
groupResult = dispatch_group_wait(group, DISPATCH_TIME_FOREVER);
@quellish
quellish / asyncFetchFRC.m
Created August 9, 2014 20:14
Asynchronous fetch with an NSFetchedResultsController
[[[self fetchedResultsController] managedObjectContext] performBlock:^{
NSError *fetchError = nil;
if (![self fetchedResultsController] performFetch:&fetchError]){
/// handle the error. Don't just log it.
} else {
// Update the view from the main queue.
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[tableView reloadData];
}];
@quellish
quellish / property.m
Created September 29, 2014 07:46
Managed object property access
[[managedObject managedObjectContext] performBlock:^{
NSString *value = [managedObject someValue];
[NSOperationQueue mainQueue] addOperationWithBlock:^{
[[self label] setText:value];
}];
}];