Skip to content

Instantly share code, notes, and snippets.

View wanggang316's full-sized avatar
🙃
Javaing...

Gump wanggang316

🙃
Javaing...
View GitHub Profile
@wanggang316
wanggang316 / helloworld
Created May 26, 2014 08:34
Hello Gist
I MUST COME ON!
#include <hash_map>
#include <iostream>
#include <list>
#include <vector>
#include <algorithm>
using namespace std;
using namespace stdext;
int R,C;//地图行列
__block BOOL flag = YES; //0 up 1 down
UINavigationBar *navbar = [[self navigationController] navigationBar];
[UIView animateWithDuration:0.3 animations:^(void)
{
if ([[UIApplication sharedApplication] respondsToSelector:@selector(setStatusBarHidden:withAnimation:)]) {
[[UIApplication sharedApplication] setStatusBarHidden:flag withAnimation:NO];
}
if (flag) {
@wanggang316
wanggang316 / gist:c266e8d56d588e040bf1
Created June 14, 2014 06:38
UIImageView上放UIButton
imageView.userInteractionEnabled = YES
@wanggang316
wanggang316 / gist:c5c4b66f527c42252afd
Created June 14, 2014 06:49
UINavigationController的几个问题
//1.UINaivgationController的bar有的需要隐藏,有的需要显示
//这时候可以重写UINavigationControllerDelegate的
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
if ( viewController == [MyViewController class]) {
[navigationController setNavigationBarHidden:YES animated:animated];
} else if ( [navigationController isNavigationBarHidden] ) {
[navigationController setNavigationBarHidden:NO animated:animated];
}
}
//但是这样push或者pop的时候navigation bar会有白边出现,也就是说bar隐藏或者显示的比较晚
@wanggang316
wanggang316 / README.md
Last active August 29, 2015 14:11 — forked from calebd/README.md

@wanggang316
wanggang316 / gist:230fe7a1d86e9751da8e
Created March 9, 2015 05:48
UINavigationBar&UIStateBar height
UINavigationController *rootnav = (UINavigationController *)window.rootViewController;
CGFloat topbarHeight = rootnav.navigationBar.frame.size.height + [UIApplication sharedApplication].statusBarFrame.size.height;
@wanggang316
wanggang316 / gist:59cfaa24d54f02893fff
Created January 5, 2016 02:19 — forked from floriankugler/gist:6870499
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N
# Surge for Mac 配置文件
# 显示 Finder 隐藏文件,将 .surge.conf 文件复制到 ~/ 也就是「个人」目录下。
[General]
# warning, notify, info, verbose
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, e.crashlytics.com, apple.cn
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
}