#ifdef DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d \t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(FORMAT, ...) nil
#endif
#设置导航栏背景图片
//stretchableImageWithLeftCapWidth:5 topCapHeight:10
// 从 5 ,10 的位置拉升
UIImage * naviImage = [[UIImage imageNamed:@"navigationbar"]stretchableImageWithLeftCapWidth:5 topCapHeight:10];
##是图片不拉升
photoImageView.contentMode = UIViewContentModeScaleAspectFit;
//把图片保存到相册里
UIImageWriteToSavedPhotosAlbum(imageView.image, nil, nil, nil);
//直接打开网址 下载AppStor
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:_dataDict[@"itunesUrl"]]];
##//请求超时的时间设置
AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
//5秒 超时时间
manager.requestSerializer.timeoutInterval = 5;
##//更改状态栏 UIStatusBarStyleLightContent 字体改为白色
-(UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
#pragma mark -- 手势 --
//点击消失显示
-(void)tapAction:(UITapGestureRecognizer *)tap{
// _topImageView.hidden = !_topImageView.hidden;
if (_topImageView.hidden == YES) {
_topImageView.hidden = NO;
_bottomOpImageView.hidden = NO;
[UIView animateWithDuration:0.5 animations:^{
//
_topImageView.alpha = 1;
_bottomOpImageView.alpha = 1;
} completion:^(BOOL finished) {
//
}];
}else{
[UIView animateWithDuration:0.5 animations:^{
//
_topImageView.alpha = 0;
_bottomOpImageView.alpha = 0;
} completion:^(BOOL finished) {
//
_topImageView.hidden = YES;
_bottomOpImageView.hidden = YES;
}];
}
}
#第三方库
##第三方库UMSocial_Sdk_4.2
###分享东西
//UMSocialSns
[UMSocialSnsService presentSnsIconSheetView:self appKey:@"55bf7d1ee0f55a3ccc002b2c" shareText:@"今天去优衣库看了看" shareImage:[UIImage imageNamed:@"Defaultretein1@2x"]shareToSnsNames:@[UMShareToSina,UMShareToQQ,UMShareToLWTimeline] delegate:self];
##第三方库MBProgressHUD
加载等待提示
// MBP
MBProgressHUDManager * hudManager = [[MBProgressHUDManager alloc]initWithView:self.view];
[hudManager showIndeterminateWithMessage:@"正在加载"];
//成功
[hudManager showMessage:@"数据加载完成" duration:1];
//失败
[hudManager hide];
##第三方库KVNProgress
加载等待提示
[KVNProgress showWithStatus :@"正在加载"];
[KVNProgress showSuccessWithStatus:@"OK"];
[KVNProgress showErrorWithStatus:@"请检查你的网络"];