Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block zedzhao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View detect keyboard mode chagne
[[NSNotificationCenter defaultCenter] addObserver:self
name:UITextInputCurrentInputModeDidChangeNotification object:nil];
- (void)changeInputMode:(NSNotification*)notification
NSString *inputMethod = [[UITextInputMode currentInputMode] primaryLanguage]; //判断当前键盘类型, emoji en-US en-HANS
if ([inputMethod isEqualToString:@"emoji"]) {
zedzhao / GetAllApps
Created Nov 5, 2014
Get all apps in the device
View GetAllApps
#include <objc/runtime.h>
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
NSLog(@"apps: %@", [workspace performSelector:@selector(allApplications)]);
zedzhao / hitTest
Created Apr 7, 2014
Determine if touch occurs in subview
View hitTest
- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
UIView *subView = [super hitTest:point withEvent:event];
if (UIEventTypeTouches == event.type) {
BOOL isOutsideTouch = (subView != self);
for (UIView *s in self.subviews){
You can’t perform that action at this time.