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] addObserver:self | |
selector:@selector(changeInputMode:) | |
name:UITextInputCurrentInputModeDidChangeNotification object:nil]; | |
- (void)changeInputMode:(NSNotification*)notification | |
{ | |
NSString *inputMethod = [[UITextInputMode currentInputMode] primaryLanguage]; //判断当前键盘类型, emoji en-US en-HANS | |
if ([inputMethod isEqualToString:@"emoji"]) { | |
} |
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
#include <objc/runtime.h> | |
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace"); | |
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)]; | |
NSLog(@"apps: %@", [workspace performSelector:@selector(allApplications)]); |
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
- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event{ | |
UIView *subView = [super hitTest:point withEvent:event]; | |
if (UIEventTypeTouches == event.type) { | |
BOOL isOutsideTouch = (subView != self); | |
if(!isOutsideTouch){ | |
for (UIView *s in self.subviews){ |