//
|
// Common.h
|
// PapayaPlayerDaqo
|
//
|
// Created by 味口 on 15-6-1.
|
// Copyright (c) 2015年 wgj. All rights reserved.
|
//
|
|
#import <UIKit/UIKit.h>
|
#import "YTHNetInterface.h"
|
#import "YTHsharedManger.h"
|
#import "AFURLSessionManager.h"
|
#import "HMSegmentedControl.h"
|
#import "SVProgressHUD.h"
|
#import "UIImageView+YTH.h"
|
#import "MJRefresh.h"
|
#import "YYModel.h"
|
#import "Share.h"
|
#import "YYWebImage.h"
|
#import <SDAutoLayout/SDAutoLayout.h>
|
#import <ReactiveCocoa/ReactiveCocoa.h>
|
|
#import "HXEasyCustomShareView.h"//分享界面
|
|
//#import <UMShare/UMShare.h> //友盟分享
|
#import "UIViewController+Tools.h"
|
#import "BSKImagesPageView.h"
|
#import "NoNetworkView.h"
|
|
//友盟分享
|
#define YMWXKEY @"wx428de66710fac55b"
|
#define YMWXSENT @"5d3b7203af18cc1b4cc4e3211bb87fe3"
|
#define YMQQKEY @"1105007756"
|
#define YMQQSENT @"eXCvbRkrRbOsC8Cr"
|
#define YMSinaKEY @"442189462"
|
#define YMSinaSecret @"eabb2a6d2d6e1faae5fd0f787e950f57"
|
// 购买vip链接
|
#define VIPLINK @"vipLink"
|
|
#define UNREGISTER_LINK @"unRegisterLink"
|
|
//设置里面的web网页链接
|
#define changjianwenti [NSString stringWithFormat:@"http://video.yeshitv.com:8089/BuWan/api_question_ios.jsp?package=%@",[[NSBundle mainBundle] bundleIdentifier]]//常见问题
|
#define guanyuwomen [NSString stringWithFormat:@"http://video.yeshitv.com:8089/BuWan/api_about_us_ios.jsp?package=%@",[[NSBundle mainBundle] bundleIdentifier]]//关于我们
|
#define mianzeshengming [NSString stringWithFormat:@"http://video.yeshitv.com:8089/BuWan/api_disclaimer_ios.jsp?package=%@",[[NSBundle mainBundle] bundleIdentifier]]//免责声明
|
|
//plist文件常量 ——>路径
|
#define DocumentsDirectory [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]
|
#define HISTORYFILE [DocumentsDirectory stringByAppendingPathComponent:@"historyMovie.plist"]
|
#define HISTORYSEARCHFILE [DocumentsDirectory stringByAppendingPathComponent:@"historySearch.plist"]
|
|
//推荐界面
|
#define ADVERTISEFILE [DocumentsDirectory stringByAppendingPathComponent:@"advertise.plist"]
|
#define HOMETYPEFILE [DocumentsDirectory stringByAppendingPathComponent:@"HomeType.plist"]
|
#define MOREFILE [DocumentsDirectory stringByAppendingPathComponent:@"MOREFILE.plist"]
|
#define HOTSEARCH [DocumentsDirectory stringByAppendingPathComponent:@"HOTSEARCH.plist"]
|
|
// 分类界面
|
#define CHANNELfILE [DocumentsDirectory stringByAppendingPathComponent:@"channelFile.plist"]
|
|
// 推送消息
|
#define MESSAGE [DocumentsDirectory stringByAppendingPathComponent:@"Message.plist"]
|
|
//记录分享
|
|
#define SHARE [DocumentsDirectory stringByAppendingPathComponent:@"Share.plist"]
|
|
|
//发现页面
|
#define DISCOVERSDY [DocumentsDirectory stringByAppendingPathComponent:@"discoverSDY.plist"]
|
#define DISCOVERSTAR [DocumentsDirectory stringByAppendingPathComponent:@"discoverStar.plist"]
|
#define DISCOVERMAPCHAR [DocumentsDirectory stringByAppendingPathComponent:@"discoverMapchar.plist"]
|
|
//获取appDelegates类
|
#define ApplicationDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate)
|
|
// 判断是否为iOS7
|
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)
|
// 判断是否为iOS8
|
#define iOS8 ([[UIDevice currentDevice].systemVersion doubleValue] >= 8.0)
|
// 判断是否为iOS9
|
#define iOS9 ([[UIDevice currentDevice].systemVersion doubleValue] >= 9.0)
|
// 判断是否为iOS10
|
#define iOS10 ([[UIDevice currentDevice].systemVersion doubleValue] >= 10.0)
|
// 判断是否为iOS11
|
#define iOS11 ([[UIDevice currentDevice].systemVersion doubleValue] >= 11.0)
|
|
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue] //系统版本号
|
|
//友盟的appkey
|
#define UmengKey @"578ece4167e58e6e6f001e5b"
|
|
//谷歌广告key
|
#define AdGoogleKey @"ca-app-pub-1096760388894580/6448344156"
|
|
//广点通广告
|
#define GDTADkey @"1105459781"
|
#define GDTFullADid @"7053298076190262"//广点通开屏广告
|
#define GDTYSADkey1 @"7020956692802803"//广点通原生广告_发现
|
#define GDTYSADkey2 @"6090655777307893"//广点通原生广告_推荐第一个
|
#define GDTYSADkey3 @"1010852707426274"//广点通原生广告_搜索
|
#define GDTYSADkey4 @"2060055777449803"//广点通原生广告_播放页
|
#define GDTYSADkey5 @"2031734168341661"//广点通原生广告_分类顶部
|
#define GDTYSADkey6 @"7010358693528617"//广点通原生广告_猜你喜欢
|
#define GDTYSADkey7 @"7020351787528318"//广点通原生广告_搜索详情
|
#define GDTYSADkey8 @"7030457727236454"//广点通原生广告_推荐第2个
|
#define GDTYSADkey9 @"3000458777836593"//广点通原生广告_推荐第3个
|
#define GDTYSADkey10 @"2010751797540216"//广点通原生广告_首页分类第1个
|
#define GDTYSADkey11 @"1050158757045759"//广点通原生广告_首页分类第2个
|
|
|
#define GDTBannerADkey @"6000418684535350"//广点通banner广告
|
#define GDTNomalKey @"1030541617885921"//原生模版广告
|
//优酷
|
#define YKCLIENTId @"758bef946d0050ef"
|
#define YKCLIENTSECRET @"e113a131d49e1f837402e2807f2daf58"
|
|
//阿里百川
|
#define AliBCKey @"23594297"
|
#define AliBCSecret @"5de7c85d114a8ec635583a7c99200c9"
|
|
//点开广告
|
#define DKID @"ddc40fb093e6a57a20e3dd81bbc86f0a"
|
#define DKSecret @"d61d579b8a09ca00ad7f1674e332b256"
|
#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
|
|
// 1.获得RGB颜色
|
#define YTHColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
|
#define SJColor(r, g, b , a ) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
|
|
// 2.用代码形式代码
|
#define UIColorFromRGBValue(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]
|
|
#define UICOLOR_FROM_RGB(rgbValue,trans) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:trans]
|
|
// 3.屏幕宽高
|
#define KScreenHp [[UIScreen mainScreen] bounds].size.height*1.0 // 屏幕高度
|
#define KScreenWp [[UIScreen mainScreen] bounds].size.width*1.0 // 屏幕宽度
|
|
#define KScreenH MAX(KScreenHp,KScreenWp) // 屏幕高度
|
#define KScreenW MIN(KScreenHp,KScreenWp)// 屏幕宽度
|
|
// 4.导航栏/工具栏/状态栏高度
|
#define IS_IPHONE_X ({\
|
BOOL isBangsScreen = NO; \
|
if (@available(iOS 11.0, *)) { \
|
UIWindow *window = [[UIApplication sharedApplication].windows firstObject]; \
|
isBangsScreen = window.safeAreaInsets.bottom > 0; \
|
} \
|
isBangsScreen; \
|
})
|
|
#define kNavigationBarH 64
|
|
#define kToolBarH 30
|
|
#define kStatusBarH [[UIApplication sharedApplication] statusBarFrame].size.height
|
#define ALNavBarH 44
|
#define ALTabBar_H (CGFloat)(IS_IPHONE_X?(49.0 + 34.0):(49.0))
|
|
// 5.全局颜色
|
//#define kGlobalMainColor YTHColor(48, 39, 37)//应用的主色调
|
#define kGlobalMainColor [UIColor blackColor]//应用的主色调
|
|
|
#define kGlobalBackgroundColor YTHColor(243, 243, 243)
|
#define kGlobalYellowColor YTHColor(254, 232, 77)
|
|
#define kGlobaLineColor YTHColor(200, 200, 200)
|
#define KGlobalTileColor YTHColor(66, 66, 66)
|
#define kGlobalDeepGreyColor YTHColor(51, 51, 51)
|
#define kGlobalLightBlueColor YTHColor(138, 197, 247)
|
#define kGlobalBlueColor YTHColor(45, 150, 220)
|
|
#define KGlobalLightGreyColor_90 YTHColor(90, 90, 90)
|
#define KGlobalLightGreyColor_153 YTHColor(153, 153, 153)
|
#define kGlobalLightGreyColor_210 YTHColor(210, 210, 210)
|
#define kGlobalLightGreyColor_218 YTHColor(218, 218, 218)
|
#define kGlobalLightGreyColor_223 YTHColor(223, 223, 223)
|
#define KGlobalLightGreyColor_230 YTHColor(230, 230, 230)
|
#define KGlobalLightGreyColor_245 YTHColor(245, 245, 245)
|
#define KGlobalLightGreyColor_255 YTHColor(255, 255, 255)
|
|
// 6.每张图片前面的前缀
|
#define ImageUrl @"http://sovideo.cn:8080/BuWan"
|
|
|
#define searchRecord @"searchRecord"
|