- Copy the contents of the last snippet (lldbinit) from the gist page, and paste into your .lldbinit file. This makes the ksdiff macro known inside lldb.
- Put file ksdiff.py in ~/.lldb/
sudo pip install temp
- Restart Xcode debug session
(lldb) ksdiff ;
import Foundation | |
// Create a method that will be called instead of | |
// "bundleIdentifier()" that returns a non-empty | |
// bundle id, even for a CLI script | |
extension NSBundle { | |
func fakeBundleIdentifier() -> NSString { | |
if self == NSBundle.mainBundle() { | |
return "dont.mind.me.totally.a.normal.bundleid" | |
} else { |
COMPACT WIDTH (stacked view) | |
- 320 x 568 pt | |
-> iPhone 5, 5s | |
- 320 x 768 pt | |
-> iPad 9.7" Split Landscape 2/3 right | |
- 320 x 834 pt | |
-> iPad 10.5" Split Landscape 2/3 right | |
- 320 x 1024 pt | |
-> iPad 9.7" Split Portrait right |
/** | |
Provides the ability to verify key paths at compile time. | |
If "keyPath" does not exist, a compile-time error will be generated. | |
Example: | |
// Verifies "isFinished" exists on "operation". | |
NSString *key = SQKeyPath(operation, isFinished); | |
// Verifies "isFinished" exists on self. |
// Taken from http://PSPDFKit.com. This snippet is under public domain. | |
#define UIKitVersionNumber_iOS_7_0 0xB57 | |
BOOL PSPDFIsUIKitFlatMode(void) { | |
static BOOL isUIKitFlatMode = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7. | |
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { | |
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0; | |
} |
// Based on this discussion: | |
// https://twitter.com/listrophy/statuses/251074683594747904 | |
// To setup: | |
// Create an application that has a tableView with a couple cells in it, one of | |
// which has the "coffee" in it's label | |
var target = UIATarget.localTarget(); | |
var app = target.frontMostApp(); | |
var window = app.mainWindow(); |
/* | |
* System Versioning Preprocessor Macros | |
*/ | |
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |