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
curl -X GET "http://192.168.1.200:808/workFlowWebService.asmx/GetAndriodInitDBListAL" | |
curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -H "Content-Length: 0" -X POST "http://192.168.1.200:808/workFlowWebService.asmx/GetAndriodInitDBListAL" |
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
var group = dispatch_group_create() | |
var queue = dispatch_queue_create("me.tutuge.test.gcd", DISPATCH_QUEUE_CONCURRENT); | |
dispatch_group_async(group, queue, { () -> Void in | |
NSThread.sleepForTimeInterval(10) | |
println("First block done...") | |
}) | |
dispatch_group_async(group, queue, { () -> Void in | |
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
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0) | |
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width) | |
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height) | |
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT)) | |
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT)) | |
#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0) |
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
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 | |
if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) { | |
UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil]; | |
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings]; | |
[[UIApplication sharedApplication] registerForRemoteNotifications]; | |
} else { | |
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; | |
} | |
#else | |
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTy |
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
+ (NSString *) appVersion | |
{ | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]; | |
} | |
+ (NSString *) build | |
{ | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey: (NSString *)kCFBundleVersionKey]; | |
} |
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
<key>UIStatusBarStyle</key> | |
<string>UIStatusBarStyleBlackOpaque</string> | |
<key>UIViewControllerBasedStatusBarAppearance</key> | |
<false/> | |
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; |
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
//RGB color macro | |
#define NormalBlue 0x25aae1 | |
#define PressedBlue 0x1A7AA2 | |
#define UIColorFromRGB(rgbValue) [UIColor \ | |
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ | |
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ | |
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | |
//RGB color macro with alpha |
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
显示文档: Ctr+J | |
查找调用位置:Ctrl + Option + H |
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
<!--抽屉效果, 有两部分组成,上边部分是主view, 下边部分是抽屉部分,抽屉部分的抽出方向由android:layout_gravity="start"这个参数决定--> | |
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
//app为自定义namespace的名称 | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/drawerLayout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<!-- 主view由相对布局构成--> | |
<RelativeLayout |
OlderNewer