Set a symbolic breakpoint for the symbol CGPostError
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 Publishers { | |
private struct IndexedResult<T> { | |
let index: Int | |
let result: T | |
} | |
private struct IndexedPublisher<Upstream>: Publisher where Upstream: Publisher { | |
typealias Output = IndexedResult<Upstream.Output> | |
typealias Failure = Upstream.Failure |
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
// Swift 2.3 | |
UIFont.familyNames().sort().forEach({print($0)}) | |
// Swift 3.0 | |
UIFont.familyNames.sorted().forEach({print($0)}) |
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
NSArray *syms = [NSThread callStackSymbols]; | |
if ([syms count] > 1) { | |
NSLog(@"<%@ %p> %@ - caller: %@ ", [self class], self, NSStringFromSelector(_cmd),[syms objectAtIndex:1]); | |
} else { | |
NSLog(@"<%@ %p> %@", [self class], self, NSStringFromSelector(_cmd)); | |
} |
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
- (void)printChildControllersForViewControllerRecursively:(UIViewController *)controller { | |
NSMutableString *logString = [NSMutableString stringWithString:[NSString stringWithFormat:@"child controllers for controller: %@ ::: [", controller]]; | |
for (UIViewController *childController in controller.childViewControllers) { | |
[logString appendString:[NSString stringWithFormat:@"child: %@", childController]]; | |
[self printChildControllersForViewControllerRecursively:childController]; | |
} | |
NSLog(@"%@]",logString); | |
} |
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
// Objective-C | |
NSLog(@"app dir: %@",[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]); | |
// Swift | |
println("app dir: \(NSArray(array:NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)).lastObject)") |
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
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:" | |
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/" |
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
rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/* |