This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIViewController { | |
func recursiveDescription() -> String { | |
let description = view.perform(Selector(("recursiveDescription")))?.takeUnretainedValue() as! String | |
return description | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script embeds (and codesigns) a framework within an iOS app binary, but only when the configuration is Debug. | |
# It must be called from, or copied into an Xcode Run Script build phase with following setup: | |
# Input Files: | |
# - Path to framework within project folder (source path) | |
# - For example: $(SRCROOT)/ThirdPartyFrameworks/SimulatorStatusMagiciOS.framework | |
# Output Files: | |
# - Desired path to framework within ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH} (destination path) | |
# - For example: ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/SimulatorStatusMagiciOS.framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <CoreData/CoreData.h> | |
@implementation NSManagedObjectContext (FetchAggregates) | |
/** | |
* This method groups CoreData objects based on a list of user defined properties/relationships. | |
* Properties contain values, and Relationships are properties that specifically point to another NSManagedObject. | |
* Note: properties and relationships must be separated out as aggregate operations (count, max, min, avg) cannot be performed on relationships. | |
* | |
* NOTE: A common use for this method is finding duplicate NSManagedObject entities where 'duplicate' means exactly matching certain properties/relationships. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef NSError *(^NSManagedObjectContextBlock)(NSManagedObjectContext *context); | |
+ (void)performBlock:(NSManagedObjectContextBlock)block withTemporaryManagedObjectContextFromDatabaseAtURL:(NSURL *)url withModelBundle:(NSBundle *)bundle | |
{ | |
NSParameterAssert(block); | |
if (!block) | |
{ | |
return; | |
} | |