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
func PrintableClassName<T>(variable : T) -> String | |
{ | |
// Test for ObjC | |
if let v = variable as? NSObject | |
{ | |
return v.classForCoder.description() | |
} | |
// If the object *can* be converted to ObjC type, do so | |
// However you lose any specifics as to type |
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 T! { | |
typealias ObjectiveCType = AnyObject | |
static func getObjectiveCType() -> Any.Type | |
func bridgeToObjectiveC() -> AnyObject | |
static func bridgeFromObjectiveC(x: AnyObject) -> T!? | |
static func isBridgedToObjectiveC() -> Bool | |
} |
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
[[NSNotificationCenter defaultCenter] addObserverForName:UIKeyboardWillShowNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) | |
{ | |
NSLog(@"Windows: %@", [UIApplication sharedApplication].windows); | |
for (UIWindow *window in [UIApplication sharedApplication].windows) | |
{ | |
if ([window.class.description rangeOfString:@"Text"].location != NSNotFound) | |
{ | |
window.alpha = 0.0f; |
NewerOlder